Skip to content

Commit

Permalink
[Docker image] Nightly build of docker image (#2229)
Browse files Browse the repository at this point in the history
* added release build actions

* added release build

* release build modified

* Update release-build.yaml

* Update release-build.yaml

* Update release-build.yaml

* Implemented release-build workflow.

* Added final nightly and release build workflows

* made suggested changes in release and nightly workflow files

* Install nightly from pypi for docker build

* fix username

* rename secrets

* test on push

* fix password secret

* change to env

* test

* avoid push on

* Fix docker repo

* test

* remove push

* fix version

* test

* remove push

* fix version

* test

* Change back to user name

* remove push

* remove python

* add arm64

* Use python 3.10, update dockerfile to use

* Remove arm64

* Change to python 3.10 for conda

---------

Co-authored-by: Zhanghao Wu <[email protected]>
  • Loading branch information
PratikKumar125 and Michaelvll authored Jan 28, 2024
1 parent 0af0b1b commit 9c08b7b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/docker-nightly-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: docker-nightly-build

on:
schedule:
# Set the time to be 20 mins after the pypi nightly build
- cron: '55 10 * * *' # 10:55am UTC, 2:55am PST, 5:55am EST
workflow_dispatch:

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: Find the release version
id: version
run: |
PACKAGE_NAME="skypilot-nightly"
# Fetch package info from PyPI
PACKAGE_INFO=$(curl -s https://pypi.org/pypi/$PACKAGE_NAME/json)
# Parse JSON and get the latest version
LATEST_VERSION=$(echo $PACKAGE_INFO | jq -r '.info.version')
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
- name: Setup Dockerfile
run: |
touch Dockerfile
cat <<EOF > Dockerfile
# Use the latest version with Python 3.10
FROM continuumio/miniconda3:23.3.1-0
# Install dependencies
RUN conda install -c conda-forge google-cloud-sdk && \
apt update -y && \
apt install rsync vim -y && \
rm -rf /var/lib/apt/lists/*
RUN pip install "skypilot-nightly[all]==${{ steps.version.outputs.latest_version }}" --no-cache-dir
EOF
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
# TODO: add support for linux/arm64 for M series Macs
# It currently fails due to the failure to install google-cloud-sdk
platforms: linux/amd64
push: true
tags: "${{ secrets.DOCKER_USERNAME }}/skypilot-nightly:latest,${{ secrets.DOCKER_USERNAME }}/skypilot-nightly:${{ steps.version.outputs.latest_version }}"
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM continuumio/miniconda3:4.11.0
# Use the latest version with Python 3.10
FROM continuumio/miniconda3:23.3.1-0

# Install dependencies
RUN conda install -c conda-forge google-cloud-sdk && \
Expand Down

0 comments on commit 9c08b7b

Please sign in to comment.