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

Ensure local builds can use CI cache #38

Closed
ajschmidt8 opened this issue Jan 26, 2023 · 6 comments
Closed

Ensure local builds can use CI cache #38

ajschmidt8 opened this issue Jan 26, 2023 · 6 comments

Comments

@ajschmidt8
Copy link
Member

The changes in #35 allow users to run CI test scripts locally by enabling the artifact transfer commands to work in a non-CI environment.

One thing that's still left to confirm is whether local builds are able to properly utilize the sccache that's been populated by CI.

This workflow is useful for the following scenario:

  • A user opens a PR and the builds fail
  • User wants to replicate the build failure locally while utilizing the build cache that was populated by CI

The changes from #35 should enable this to be possible, but I haven't yet been able to verify it locally.

Opening this issue as a reminder to confirm this.

@ajschmidt8
Copy link
Member Author

One additional change that will need to be made across repositories for this to work is to add this SCCACHE_NO_CREDENTIALS environment variable to the conda recipes' script_env section (e.g. here).

We should also check that the inclusion of that environment variable doesn't interfere with CI's regular use of sccache.

My local testing suggests that, as long as that environment variable is not set in CI, it will not be passed through to the conda build environment and therefore should not interfere with regular sccache usage.

That environment variable is documented here: https://github.com/mozilla/sccache/blob/f8972dcc5570b9308847ea7c9b7c25e86e293fbf/docs/S3.md#L29.

@ajschmidt8
Copy link
Member Author

ajschmidt8 commented Apr 12, 2023

This sccache PR should help with this effort:

Once that PR is merged and released, we can add a ENV SCCACHE_S3_NO_CREDENTIALS=false line below:

This way CI builds will not use the SCCACHE_S3_NO_CREDENTIALS feature, but local builds will use the feature, since it gets set to true for local builds here:

if [ "${CI:-false}" = "false" ]; then
# Configure sccache for read-only mode since no credentials
# are available in local builds.
export SCCACHE_S3_NO_CREDENTIALS=true
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-$(nproc)}
export RAPIDS_BUILD_TYPE=${RAPIDS_BUILD_TYPE:-"pull-request"}
fi
).

Then we can add the SCCACHE_S3_NO_CREDENTIALS environment variable to the script_env section of all of our recipes:

After these changes, local builds should be able to seamlessly use the sccache cache that's populated by CI.

@ajschmidt8
Copy link
Member Author

I also updated our rapids-sccache-east bucket to enable all objects to be publicly readable by default.

I've confirmed that enabling this setting allows local builds to use the rapids-sccache-east cache in combination with the SCCACHE_S3_NO_CREDENTIALS variable.

@ajschmidt8
Copy link
Member Author

ajschmidt8 commented Apr 24, 2023

mozilla/sccache#1724 has been merged and released in https://github.com/mozilla/sccache/releases/tag/v0.4.2.

The next action items are:

@ajschmidt8
Copy link
Member Author

closing this issue now that all the PRs above are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant