Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.17: ci: add the ability to use GCS backend for sccache (backport of #33967) #33984

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ fi

export SBF_TOOLS_VERSION

SCCACHE_S3_KEY_PREFIX="${rust_stable}_${rust_nightly}_${SBF_TOOLS_VERSION}"
SCCACHE_KEY_PREFIX="${rust_stable}_${rust_nightly}_${SBF_TOOLS_VERSION}"
export SCCACHE_KEY_PREFIX

SCCACHE_S3_KEY_PREFIX="$SCCACHE_KEY_PREFIX"
export SCCACHE_S3_KEY_PREFIX

SCCACHE_GCS_KEY_PREFIX="$SCCACHE_KEY_PREFIX"
export SCCACHE_GCS_KEY_PREFIX
30 changes: 24 additions & 6 deletions ci/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,34 @@ if [[ -n $CI ]]; then
# sccache-related bugs
echo "--- $0 ... (with sccache being DISABLED due to many (${BUILDKITE_RETRY_COUNT}) retries)"
else
echo "--- $0 ... (with sccache enabled with prefix: $SCCACHE_S3_KEY_PREFIX)"
echo "--- $0 ... (with sccache enabled with prefix: $SCCACHE_KEY_PREFIX)"

# sccache
ARGS+=(
--env "RUSTC_WRAPPER=/usr/local/cargo/bin/sccache"
--env AWS_ACCESS_KEY_ID
--env AWS_SECRET_ACCESS_KEY
--env SCCACHE_BUCKET
--env SCCACHE_REGION
--env SCCACHE_S3_KEY_PREFIX
)

# s3
if [ -n "$AWS_ACCESS_KEY_ID" ]; then
ARGS+=(
--env AWS_ACCESS_KEY_ID
--env AWS_SECRET_ACCESS_KEY
--env SCCACHE_BUCKET
--env SCCACHE_REGION
--env SCCACHE_S3_KEY_PREFIX
)
fi

# gcs
if [ -n "$SCCACHE_GCS_KEY_PATH" ]; then
ARGS+=(
--env SCCACHE_GCS_KEY_PATH
--volume "$SCCACHE_GCS_KEY_PATH:$SCCACHE_GCS_KEY_PATH"
--env SCCACHE_GCS_BUCKET
--env SCCACHE_GCS_RW_MODE
--env SCCACHE_GCS_KEY_PREFIX
)
fi
fi
fi
else
Expand Down