-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[CI] Set environment variables correctly #3680
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
base: staging
Are you sure you want to change the base?
Conversation
511c0af
to
b74a03a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! Should some of this also be moved to snarkVM?
In snarkVM we use the cache to store gigabytes of parameters, so it would be nice to not change daily
It should be possible to have multiple caches. So we can update the sccache one more frequently. |
Rebased this on the Rust version upgrade (#3699) which also has some CI improvements. |
1b425b3
to
60cc758
Compare
This makes sure sccache can be invoked properly and also updates it to 0.10.
I updated this PR to use Google Cloud Storage as a backend for sccache. There is a single bucket shared among all jobs. We now get a decent number of cache hits and do not have to rely on CircleCI's cumbersome caching mechanism. These are the stats for building
All jobs, except for There are still a few downsides to this approach:
|
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list | ||
sudo apt-get update | ||
sudo apt-get install google-cloud-cli -y | ||
echo $GCLOUD_SERVICE_KEY > /home/circleci/gcloud-key.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was the environment variable set? If it leaks, is the damage contained? Should we add a mini-manual/doc for how to set the environment variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's stored in CircleCI similar to how we store the instance types right now. The more complicated thing is to set up the service key with the needed permissions, but I can add documentation for that.
Motivation
I noticed a few issues with the CircleCI setups:
Proposed Changes
Notes
While we now get cache hits, compilation still takes some time. I have a bigger PR that aims to share build artifacts using CircleCI workspaces, but this smaller one should be merged first.
It would be good if we could have the cache files expire quicker, maybe after five days or so. There should be a setting in CircleCI, but I might not have permission to change it.
I did not change the prefix for the cache keys, but it might still be good to remove the version number, as the keys are getting quite long with this change.
Windows builds seem to generate a new cache entry whenever the
Cargo.lock
file changes. That might be too infrequent, so opted for daily updates. However, it might make sense to unify the behavior between the two.