Use ray-project fork in CI build and Dockerfile #237
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dockerfile | |
on: | |
push: | |
tags: ["*"] # Triggers from tags ignore the `paths` filter: https://github.com/orgs/community/discussions/26273 | |
pull_request: | |
paths: | |
- "build/**" | |
- "Dockerfile" | |
- ".dockerignore" | |
- ".github/workflows/Dockerfile.yml" | |
# Each PR and each commit on `main` use distinct concurrency groups. Note canceling workflows in | |
# progress may result in having to rebuild layers as the Docker layer caching is only uploaded | |
# once the image has been fully built. That said, new commits may invalidate these layers anyway. | |
concurrency: | |
group: dockerfile-${{ github.ref_name }}-${{ github.ref == 'refs/heads/main' && github.run_number }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04-16core | |
env: | |
# Reference the HEAD commit which triggered this workflow. By default PRs use a merge commit | |
SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
TAG: ray-jl:latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.SHA }} # Always checkout HEAD commit | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/build-push-action@v5 | |
with: | |
# Use Path context to ensure that the `.git` directory is included in the image. | |
# https://github.com/docker/build-push-action#git-context | |
context: . | |
load: true | |
push: false | |
tags: ${{ env.TAG }} | |
file: Dockerfile | |
# TODO: May want to switch to another cache type as GHA have a 10 GB limit | |
cache-from: type=gha | |
cache-to: type=gha,mode=min | |
# https://docs.docker.com/build/ci/github-actions/export-docker/ | |
- name: Export to Docker | |
run: docker image inspect ${{ env.TAG }} | |
- name: Report Docker image size | |
run: | | |
size=$(docker images ${{ env.TAG }} --format "{{.Size}}") | |
echo ":whale: Docker image size: $size" | tee -a "$GITHUB_STEP_SUMMARY" |