Skip to content

Commit

Permalink
[CI] Upload macOS bazel test files (ray-project#25744)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo committed Jun 15, 2022
1 parent f61f60f commit 503e197
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
9 changes: 7 additions & 2 deletions .buildkite/hooks/post-artifact
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ if [ -d "/tmp/artifacts" ]; then

if [ "$(ls -A /tmp/artifacts)" ]; then
echo "Directory not empty, cleaning up..."
# Need to run in docker to avoid permission issues
docker run --rm -v /tmp/artifacts:/artifact-mount alpine:latest /bin/sh -c 'rm -rf /artifact-mount/*; rm -rf /artifact-mount/.[!.]*' || true
if [[ "${OSTYPE}" = darwin* ]]; then
rm -rf /tmp/artifacts
mkdir -p /tmp/artifacts
else
# Need to run in docker to avoid permission issues
docker run --rm -v /tmp/artifacts:/artifact-mount alpine:latest /bin/sh -c 'rm -rf /artifact-mount/*; rm -rf /artifact-mount/.[!.]*' || true
fi
else
echo "Directory already empty, no need to clean up."
fi
Expand Down
8 changes: 4 additions & 4 deletions .buildkite/pipeline.macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
common: &common
artifact_paths:
- "/tmp/bazel_event_logs/*"
env:
BUILDKITE: "true"
CI: "true"
Expand All @@ -11,7 +9,8 @@ common: &common
LANG: en_US.UTF-8

prelude_commands: &prelude_commands |-
./ci/build/upload_build_info.sh
rm -rf /tmp/bazel_event_logs
cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
(which bazel && bazel clean) || true;
. ./ci/ci.sh init && source ~/.zshrc
. ./ci/ci.sh build
Expand All @@ -29,7 +28,8 @@ steps:
conditions: ["RAY_CI_MACOS_WHEELS_AFFECTED", "RAY_CI_PYTHON_DEPENDENCIES_AFFECTED"]
commands:
# Cleanup environments
- ./ci/build/upload_build_info.sh
- rm -rf /tmp/bazel_event_logs
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- (which bazel && bazel clean) || true
# TODO(simon): make sure to change both PR and wheel builds
# Special setup for jar builds (will be installed to the machine instead)
Expand Down
10 changes: 3 additions & 7 deletions ci/build/upload_build_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ if [[ -z "${BUILDKITE-}" ]]; then

aws s3 cp --recursive /tmp/bazel_event_logs "${DST}"
else
if [[ "${OSTYPE}" = darwin* ]]; then
echo "Using Buildkite Artifact Store on macOS"
else
# Codepath for Buildkite
pip install -q docker aws_requests_auth boto3
python .buildkite/copy_files.py --destination logs --path /tmp/bazel_event_logs
fi
# Codepath for Buildkite
pip install -q docker aws_requests_auth boto3
python .buildkite/copy_files.py --destination logs --path /tmp/bazel_event_logs
fi

0 comments on commit 503e197

Please sign in to comment.