Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker image] Nightly build of docker image #2229

Merged
merged 35 commits into from
Jan 28, 2024
Merged
Changes from 14 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
069727d
added release build actions
PratikKumar125 Jul 13, 2023
6b4ac54
added release build
PratikKumar125 Jul 13, 2023
06cf17f
release build modified
PratikKumar125 Jul 13, 2023
394794f
Update release-build.yaml
PratikKumar125 Jul 13, 2023
a2cf2ef
Update release-build.yaml
PratikKumar125 Jul 13, 2023
2630f3a
Update release-build.yaml
PratikKumar125 Jul 13, 2023
47d1bc4
Implemented release-build workflow.
PratikKumar125 Jul 13, 2023
4e7b7b3
Added final nightly and release build workflows
PratikKumar125 Jul 13, 2023
8863014
Merge branch 'ci-cd/2193' of https://github.com/PratikKumar125/skypil…
PratikKumar125 Jul 13, 2023
6eca4ed
made suggested changes in release and nightly workflow files
PratikKumar125 Jul 15, 2023
c17cc0c
Merge branch 'ci-cd/2193' of github.com:PratikKumar125/skypilot; bran…
Michaelvll Jan 22, 2024
5a5dfa4
Install nightly from pypi for docker build
Michaelvll Jan 22, 2024
4d82507
fix username
Michaelvll Jan 22, 2024
40ca1cf
rename secrets
Michaelvll Jan 22, 2024
f5031cb
test on push
Michaelvll Jan 22, 2024
f29a506
fix password secret
Michaelvll Jan 22, 2024
1e390a3
change to env
Michaelvll Jan 22, 2024
8840e34
test
Michaelvll Jan 22, 2024
f0132a2
avoid push on
Michaelvll Jan 22, 2024
fa8d932
Fix docker repo
Michaelvll Jan 22, 2024
02fd870
test
Michaelvll Jan 22, 2024
53f96d4
remove push
Michaelvll Jan 22, 2024
3a61ecd
fix version
Michaelvll Jan 22, 2024
107a5b9
test
Michaelvll Jan 22, 2024
6b96003
remove push
Michaelvll Jan 22, 2024
d7b9896
fix version
Michaelvll Jan 22, 2024
0ede04d
test
Michaelvll Jan 22, 2024
adab2ea
Change back to user name
Michaelvll Jan 22, 2024
e6af47c
remove push
Michaelvll Jan 22, 2024
f1f8000
remove python
Michaelvll Jan 22, 2024
fb9db50
add arm64
Michaelvll Jan 25, 2024
1b4900e
Use python 3.10, update dockerfile to use
Michaelvll Jan 25, 2024
58ddc3a
Merge branch 'test-docker-nightly-build' of github.com:Michaelvll/sky…
Michaelvll Jan 25, 2024
b8ab197
Remove arm64
Michaelvll Jan 25, 2024
39bf5b4
Change to python 3.10 for conda
Michaelvll Jan 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/docker-nightly-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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: Set up Python 3.10
uses: actions/setup-python@v4
- name: Find the release 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')

- name: Setup Dockerfile
run: |
touch Dockerfile
cat <<EOF > Dockerfile
FROM continuumio/miniconda3:4.11.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[aws,gcp,azure,kubernetes]==$LATEST_VERSION" --no-cache-dir
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth a quick check to measure the size difference between an image with skypilot-nightly[aws,gcp,azure,kubernetes] vs skypilot-nightly[all]. If not too big, perhaps we can ship with skypilot-nightly[all]?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! I was using the older python version and the installation of [all] seems taking forever, due to some dependency issue with the kubernetes extra for python 3.9. I just switched the base image to use python 3.10, and it seems working nicely with [all]

EOF
- 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_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: "${{ secrets.DOCKER_USERNAME }}/skypilot-nightly:latest,${{ secrets.DOCKER_USERNAME }}/skypilot-nightly:$LATEST_VERSION"
cache-from: type=gha
cache-to: type=gha,mode=max
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: since running a linux/amd64 image on apple silicon can be a bit slow because of emulation (e.g., on my M2 Mac, sky -v takes 4 seconds on this image compared to 1 second running natively), consider adding builds for apple silicon.

IIUC from this guide, it should involve:

  1. Adding the qemu action above
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
  1. In docker/build-push-action@v5, add:
platforms: linux/amd64,linux/arm64

Feel free to defer for a future PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! I just tried adding it, but it seems the conda install -c conda-forge google-cloud-sdk fail to be installed in the linux/arm64 version. Do you have an idea how to resolve it?