diff --git a/.buildkite/hooks/post-artifact b/.buildkite/hooks/post-artifact index ad2312aa9..7eb7eb137 100644 --- a/.buildkite/hooks/post-artifact +++ b/.buildkite/hooks/post-artifact @@ -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 diff --git a/.buildkite/pipeline.macos.yml b/.buildkite/pipeline.macos.yml index 9cdc3d8ce..fc0ad6611 100644 --- a/.buildkite/pipeline.macos.yml +++ b/.buildkite/pipeline.macos.yml @@ -1,6 +1,4 @@ common: &common - artifact_paths: - - "/tmp/bazel_event_logs/*" env: BUILDKITE: "true" CI: "true" @@ -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 @@ -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) diff --git a/ci/build/upload_build_info.sh b/ci/build/upload_build_info.sh index 255609e05..9cdab978c 100755 --- a/ci/build/upload_build_info.sh +++ b/ci/build/upload_build_info.sh @@ -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