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

chore: enable rosetta cache for builds #17336

Merged
merged 5 commits into from
Nov 5, 2021
Merged

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Nov 4, 2021

Avail ourselves of the new build cache feature in cdklabs/cdk-ops#1776.
Adds two new things:

A persistently cached directory

The directory $HOME/.s3buildcache will be stored and restored in the
S3 bucket, if configured. The build can assume that files it puts in
there will be availble on the next build (and on the corresponding
PR build).

Cache rosetta tablet

If there is a file in the persistent cache directory for Rosetta,
pass it to jsii-rosetta as an input.

Afterwards, store whatever tablet the build produced back into the
cache directory.

The latter will only impact the persistent cache if done on a build
that is actually configured to store the cache back, which is only
the main pipeline build.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Avail ourselves of the new build cache feature in cdklabs/cdk-ops#1776.
Adds two new things:

**A persistently cached directory**

The directory `$HOME/.s3buildcache` will be stored and restored in the
S3 bucket, if configured. The build can assume that files it puts in
there will be availble on the next build (and on the corresponding
PR build).

**Cache rosetta tablet**

If there is a file in the persistent cache directory for Rosetta,
pass it to `jsii-rosetta` as an input.

Afterwards, store whatever tablet the build produced back into the
cache directory.

The latter will only impact the persistent cache if done on a build
that is actually configured to store the cache back, which is only
the main pipeline build.
@rix0rrr rix0rrr requested a review from a team November 4, 2021 15:26
@rix0rrr rix0rrr self-assigned this Nov 4, 2021
@gitpod-io
Copy link

gitpod-io bot commented Nov 4, 2021

@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Nov 4, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 4, 2021
Comment on lines +8 to +9
cachedir=$HOME/.s3buildcache
mkdir -p $cachedir
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ (Nit) - Move this to after the env variable check so this script no-ops if the environment variable isn't set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I did this on purpose. It's convenient to always be able to rely on the ~/.s3buildcache directory existing (whether it's empty or not).

Makes the shell scripts easier to write... (?)

@mergify
Copy link
Contributor

mergify bot commented Nov 5, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 1afd9e2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 14da458 into master Nov 5, 2021
@mergify mergify bot deleted the huijbers/enable-rosetta-cache branch November 5, 2021 21:03
@mergify
Copy link
Contributor

mergify bot commented Nov 5, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

iliapolo pushed a commit that referenced this pull request Nov 7, 2021
Avail ourselves of the new build cache feature in cdklabs/cdk-ops#1776.
Adds two new things:

**A persistently cached directory**

The directory `$HOME/.s3buildcache` will be stored and restored in the
S3 bucket, if configured. The build can assume that files it puts in
there will be availble on the next build (and on the corresponding
PR build).

**Cache rosetta tablet**

If there is a file in the persistent cache directory for Rosetta,
pass it to `jsii-rosetta` as an input.

Afterwards, store whatever tablet the build produced back into the
cache directory.

The latter will only impact the persistent cache if done on a build
that is actually configured to store the cache back, which is only
the main pipeline build.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
Avail ourselves of the new build cache feature in cdklabs/cdk-ops#1776.
Adds two new things:

**A persistently cached directory**

The directory `$HOME/.s3buildcache` will be stored and restored in the
S3 bucket, if configured. The build can assume that files it puts in
there will be availble on the next build (and on the corresponding
PR build).

**Cache rosetta tablet**

If there is a file in the persistent cache directory for Rosetta,
pass it to `jsii-rosetta` as an input.

Afterwards, store whatever tablet the build produced back into the
cache directory.

The latter will only impact the persistent cache if done on a build
that is actually configured to store the cache back, which is only
the main pipeline build.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants