Skip to content

Commit

Permalink
Merge branch 'main' into cv/ci-artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Oct 4, 2023
2 parents 96cc6eb + f6a3006 commit e243cfb
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 17 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- "1.9" # Latest release
os:
- ubuntu-20.04-16core
- macos-latest-xlarge # M1
- macos-latest-xlarge # Apple silicon
arch:
- x64
- aarch64
Expand All @@ -58,6 +58,11 @@ jobs:
repository: beacon-biosignals/ray
path: ${{ env.ray_dir }}
ref: ${{ steps.ray-commit.outputs.sha }}
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: ${{ env.ray_dir }}/python/setup.py
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -74,7 +79,7 @@ jobs:
uses: actions/cache/restore@v3
id: build-cache
with:
key: build-cache.ray-jl.${{ matrix.os }}.${{ matrix.arch }}.julia-${{ matrix.version }}.ray-${{ steps.ray-commit.outputs.sha }}.hash-${{ hashFiles('ray_julia_jll/build/WORKSPACE.bazel.tpl', 'ray_julia_jll/build/BUILD.bazel') }}
key: build-cache.ray-jl.${{ matrix.os }}.${{ matrix.arch }}.julia-${{ matrix.version }}.ray-${{ steps.ray-commit.outputs.sha }}.hash-${{ hashFiles('build/WORKSPACE.bazel.tpl', 'build/BUILD.bazel') }}
path: ~/.cache
restore-keys: |
build-cache.ray-jl.${{ matrix.os }}.${{ matrix.arch }}.julia-${{ matrix.version }}.ray-${{ steps.ray-commit.outputs.sha }}.
Expand All @@ -86,32 +91,52 @@ jobs:
run: |
pip install --upgrade pip wheel
# Use `~/.cache/bazel` as the Bazel cache directory on macOS
# https://bazel.build/remote/output-directories
if [ "$(uname -s)" = "Darwin" ]; then
mkdir -p ~/.cache/bazel/_bazel_$USER
rm -rf /private/var/tmp/_bazel_$USER # Bazel cached data may be present from unrelated builds
ln -s ~/.cache/bazel/_bazel_$USER /private/var/tmp/_bazel_$USER
fi
# The Ray BUILD.bazel includes a bunch of `copy_to_workspace` rules which copy build output
# into the Ray worktree. When we only restore the Bazel cache then re-building causes these
# rules to be skipped resulting in `error: [Errno 2] No such file or directory`. By manually
# saving/restoring these files we can work around this.
RAY_GEN_CACHE_DIR=~/.cache/ray-generated
if [ -d "$RAY_GEN_CACHE_DIR" ]; then
dest=$(pwd)
pushd $RAY_GEN_CACHE_DIR
cp -rp --parents \
ray_repo=$(pwd)
srcs=(
python/ray/_raylet.so \
python/ray/core/generated \
python/ray/serve/generated \
python/ray/core/src/ray/raylet/raylet \
python/ray/core/src/ray/gcs \
$dest
popd
)
# Reimplemented `cp --parents` as this isn't supported by macOS
for rel in "${srcs[@]}"; do
echo "Restoring $rel" >&2
src="$RAY_GEN_CACHE_DIR/$rel"
dest=$(dirname "$ray_repo/$rel")
mkdir -p $dest
cp -rp $src $dest
done
fi
pushd python
pip install . --verbose # Fresh build takes ~50 minutes on basic GH runner
popd
# By copying the entire Ray worktree we can easily restore missing files without having to
# delete the cache and build from scratch.
mkdir -p "$RAY_GEN_CACHE_DIR"
cp -rfp . "$RAY_GEN_CACHE_DIR"
# delete the cache and build from scratch. Skip copy when we don't save the cache.
if [ "${{ steps.build-cache.outputs.cache-hit }}" != "true" ]; then
mkdir -p "$RAY_GEN_CACHE_DIR"
cp -rfp . "$RAY_GEN_CACHE_DIR"
fi
# Verify Ray CLI works
echo "Verify Ray CLI works" >&2
ray --version
working-directory: ${{ env.ray_dir }}
- name: Build ray_julia library
id: ray_julia
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/Dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ concurrency:
jobs:
build:
name: Build
runs-on:
labels: ubuntu-20.04-16core
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 }}
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter", version="1"))
- name: Check formatting
id: check
shell: julia --color=yes {0}
run: |
using JuliaFormatter
Expand All @@ -58,5 +59,15 @@ jobs:
end
if !formatted
@error "Found some unformatted files:\n" * read(`git diff --name-only`, String)
exit(1)
end
open(ENV["GITHUB_OUTPUT"], "a") do io
println(io, "formatted=$formatted")
end
- uses: reviewdog/action-suggester@v1
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
with:
tool_name: JuliaFormatter
fail_on_error: true
- name: Fail if not formatted
if: ${{ steps.check.outputs.formatted != 'true' }}
run: exit 1
25 changes: 21 additions & 4 deletions .github/workflows/artifacts_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,47 @@ concurrency:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on:
labels: ubuntu-20.04-16core
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1.8" # Version used with MVP
- "1.9" # Latest release
os:
- ubuntu-latest
- ubuntu-20.04-16core
- macos-latest-xlarge # Apple silicon
arch:
- x64
- aarch64
exclude:
- os: ubuntu-20.04-16core
arch: aarch64
- os: macos-latest-xlarge
arch: x64
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Ray CLI
run: |
pip install --upgrade pip wheel
case $(uname -s) in
Linux) OS=manylinux2014;;
Darwin) OS=macosx_13_0;;
esac
ARCH=$(uname -m)
PYTHON=$(python3 --version | perl -ne '/(\d+)\.(\d+)/; print "cp$1$2-cp$1$2"')
pip install -U "ray[default] @ https://github.com/beacon-biosignals/ray/releases/latest/download/ray-2.5.1-${PYTHON}-manylinux2014_x86_64.whl" "pydantic<2"
pip install -U "ray[default] @ https://github.com/beacon-biosignals/ray/releases/latest/download/ray-2.5.1-${PYTHON}-${OS}_${ARCH}.whl" "pydantic<2"
# Verify Ray CLI works
ray --version
- name: Delete Overrides.toml
shell: julia --color=yes --project {0}
run: |
Expand Down

0 comments on commit e243cfb

Please sign in to comment.