Add ci #34
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: Ray CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to test' | |
required: false | |
default: 'main' | |
type: string | |
env: | |
PYTHON_VERSION: '3.11' | |
DOCKER_BUILDKIT: 1 | |
RAY_CI_POST_WHEEL_TESTS: 1 | |
jobs: | |
build-base-images: | |
name: Build Base Images | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ['3.11'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Check Test Image Existence | |
id: check_test_image | |
run: | | |
if docker manifest inspect ghcr.io/${{ github.repository }}/oss-ci-base_test-py${{ matrix.python }} > /dev/null 2>&1; then | |
echo "exists=true" >> $GITHUB_OUTPUT | |
else | |
echo "exists=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Build Base Test Image | |
if: steps.check_test_image.outputs.exists != 'true' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ci/docker/base.test.Dockerfile | |
tags: | | |
ghcr.io/${{ github.repository }}/oss-ci-base_test-py${{ matrix.python }} | |
push: true | |
- name: Check Build Image Existence | |
id: check_build_image | |
run: | | |
if docker manifest inspect ghcr.io/${{ github.repository }}/oss-ci-base_build-py${{ matrix.python }} > /dev/null 2>&1; then | |
echo "exists=true" >> $GITHUB_OUTPUT | |
else | |
echo "exists=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Build OSS CI Base | |
if: steps.check_build_image.outputs.exists != 'true' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ci/docker/base.build.Dockerfile | |
tags: ghcr.io/${{ github.repository }}/oss-ci-base_build-py${{ matrix.python }} | |
build-args: | | |
DOCKER_IMAGE_BASE_TEST=ghcr.io/${{ github.repository }}/oss-ci-base_test-py${{ matrix.python }} | |
push: true | |
core-tests: | |
name: Core Tests | |
needs: build-base-images | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ['3.11'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch || github.ref }} | |
- name: Copy repository to /ray | |
run: | | |
sudo mkdir -p /ray | |
sudo cp -a $GITHUB_WORKSPACE/. /ray/ | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build core CI Base | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ci/docker/core.build.Dockerfile | |
tags: citemp:unknown-corebuild | |
build-args: | | |
RAYCI_IS_GPU_BUILD=false | |
DOCKER_IMAGE_BASE_BUILD=ghcr.io/${{ github.repository }}/oss-ci-base_build-py${{ matrix.python }} | |
cache-from: | | |
type=registry,ref=citemp:cache | |
cache-to: | | |
type=registry,ref=citemp:cache,mode=max | |
outputs: type=docker,dest=./myimage.tar | |
- name: Run Core Python Tests | |
env: | |
RAYCI_WORK_REPO: citemp | |
run: | | |
docker load --input ./myimage.tar | |
echo "Running core: python tests..." | |
# First command set (excluding debug, asan, etc.) | |
bazel run //ci/ray_ci:test_in_docker -- //python/ray/tests/... //python/ray/dag/... python/ray/autoscaler/v2/... core \ | |
--workers 4 --worker-id 0 --parallelism-per-worker 3 \ | |
--except-tags debug_tests,asan_tests,post_wheel_build,ha_integration,mem_pressure,tmpfs,container,manual,use_all_core,multi_gpu | |
bazel run //ci/ray_ci:test_in_docker -- //python/ray/tests/... //python/ray/dag/... python/ray/autoscaler/v2/... core \ | |
--workers 4 --worker-id 0 \ | |
--only-tags use_all_core --skip-ray-installation | |
- name: Run Dashboard Tests | |
run: | | |
echo "Running core: dashboard tests..." | |
bazel run //ci/ray_ci:test_in_docker -- python/ray/dashboard/... core \ | |
--parallelism-per-worker 3 | |
- name: Run Wheel Tests | |
run: | | |
echo "Running core: wheel tests..." | |
bazel run //ci/ray_ci:test_in_docker -- //python/ray/tests/... //doc/... core \ | |
--build-type wheel --parallelism-per-worker 3 \ | |
--only-tags post_wheel_build --test-env=RAY_CI_POST_WHEEL_TESTS=True |