Closed lklimek closed 3 days ago
This pull request introduces several changes across multiple GitHub Actions workflows and configurations, primarily focusing on managing AWS credentials and enhancing caching mechanisms. A new action for AWS credentials management is added, along with modifications to existing workflows to utilize new caching parameters. The changes also include the introduction of sccache
for caching Rust builds, updates to input parameters, and the removal of deprecated AWS credential configurations in various workflows. Overall, the modifications streamline the configuration and improve the handling of AWS credentials and caching strategies.
File Path | Change Summary |
---|---|
.github/actions/aws_credentials/action.yaml |
New action added for managing AWS credentials with inputs: access_key_id , secret_access_key , and optional profile . |
.github/actions/docker/action.yaml |
Input parameters modified for caching: bucket β cache_bucket , region β cache_region , new parameters added: cache_endpoint , cache_access_key_id , cache_secret_access_key . |
.github/actions/librocksdb/action.yaml |
Removed input parameter bucket , preserving other inputs and workflow structure. |
.github/actions/rust/action.yaml |
Updated output handling for Rust toolchain version, added conditional logic for protoc installation, and retained caching logic. |
.github/actions/s3-layer-cache-settings/action.yaml |
Changed action name quotes, updated input descriptions to double quotes, and added optional input endpoint . |
.github/actions/sccache/action.yaml |
New action introduced for sccache configuration with required inputs for S3 caching and multiple steps for installation and configuration. |
.github/workflows/release-docker-image.yml |
Removed AWS credentials configuration step, introduced new environment variables for caching. |
.github/workflows/release.yml |
Modified release-npm job to remove AWS credentials configuration and added sccache setup step. |
.github/workflows/tests-build-image.yml |
Updated AWS region handling, introduced new caching variables, and removed old AWS credentials parameters. |
.github/workflows/tests-build-js.yml |
Commented out AWS credentials configuration, added sccache setup step, and removed related environment variables. |
.github/workflows/tests-codeql.yml |
Updated AWS region input to use vars.AWS_REGION instead of secrets.AWS_REGION . |
.github/workflows/tests-dashmate.yml |
Changed AWS region handling to use vars.AWS_REGION , updated Docker login command, and improved conditional logic for test execution. |
.github/workflows/tests-js-package.yml |
Updated AWS region handling, added conditional check for skipping tests, and revised comments regarding AWS credentials. |
.github/workflows/tests-packges-functional.yml |
Updated AWS region handling in multiple places to use vars.AWS_REGION . |
.github/workflows/tests-rs-package.yml |
Removed AWS credentials configuration, added sccache setup step, and updated environment variable usage. |
.github/workflows/tests-test-suite.yml |
Updated AWS region handling and corrected indentation for environment variables. |
.github/workflows/tests.yml |
Added sccache setup step in rs-crates-security job with parameters for S3 configuration. |
Dockerfile |
Introduced new build arguments for sccache configuration, removed RUSTC_WRAPPER , and improved error handling. |
packages/rs-dpp/src/lib.rs |
Modified comment style for coding conventions without functional changes. |
.github/actions/aws_ecr_login/action.yaml |
New action added for logging into AWS ECR, with required inputs for AWS account and credentials. |
librocksdb
, which is relevant to the main PR's focus on managing AWS credentials and caching mechanisms.librocksdb
library within a Docker image, which relates to the main PR's changes in AWS credential management and caching strategies.π° In the land of code where bunnies play,
Weβve tidied up our workflows today!
With credentials safe and caches bright,
Our builds will run with all their might!
So hop along, letβs celebrate,
For smoother paths we now create! π
[!WARNING]
Rate limit exceeded
@lklimek has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 35 seconds before requesting another review.
β How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.π¦ How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://docs.coderabbit.ai/faq) for further information.π₯ Commits
Reviewing files that changed from the base of the PR and between 5fbe5810cc9578714d690eb7e59ee38d8523a3e7 and b9102560a054c8a677c0c440f955524c898d721c.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review all
[!TIP] For best results, initiate chat on the files or code changes.
@lklimek, I've reviewed the changes in Pull Request #2344. Here are some observations:
Consistent Quotation Marks in YAML Files: In .github/actions/docker/action.yaml
and .github/actions/s3-layer-cache-settings/action.yaml
, there's a mix of single and double quotation marks. For consistency and to prevent parsing issues, it's recommended to use double quotes throughout YAML files.
AWS Credentials Handling in Dockerfile:
--mount=type=secret,id=AWS
in the Dockerfile
for mounting AWS credentials. Ensure that during the Docker build process, the AWS credentials are correctly provided and mounted to avoid any authentication issues.RUN
commands that use --mount=type=secret,id=AWS
, consider adding checks to verify that the secrets are available before proceeding. This can prevent potential build failures due to missing credentials.Removal of AWS Credentials Configuration in Workflows:
release-docker-image.yml
and release.yml
, the step configuring AWS credentials using aws-actions/configure-aws-credentials@v4
has been removed. Please confirm that this change won't impact any AWS operations that rely on those credentials.tests-build-js.yml
, the AWS credentials configuration step has been commented out. If AWS services are still being accessed in these workflows, ensure that credentials are provided through other means or consider restoring the configuration step.Addition of environment: test
in Workflows:
environment: test
to several jobs across different workflows (e.g., tests-build-image.yml
, tests-rs-package.yml
). Verify that this environment is correctly defined in your GitHub repository settings and that it doesn't interfere with production environments or permissions.Consistency in Variable Naming and Usage:
${{ vars.AWS_REGION }}
and ${{ vars.CACHE_REGION }}
. Ensure that the correct variables are used consistently across the workflows to prevent any misconfigurations.${{ secrets.AWS_REGION }}
vs. ${{ vars.AWS_REGION }}
). Double-check that the variables are correctly defined and accessible in the workflow context.Security Considerations:
tests-rs-package.yml
, there's a debug step where AWS environment variables and credentials are printed:
set | grep AWS
cat $HOME/.aws/credentials
Be cautious with such commands, as they can expose sensitive information in the workflow logs. It's advisable to remove or secure these steps to protect secret data.
SCCACHE Configuration:
sccache
action and related configurations is a good step towards optimizing builds. Ensure that all necessary environment variables and secrets are correctly set so that sccache
can connect to the S3 backend without issues.Dockerfile
, the logic for determining if sccache
is enabled has been updated. Verify that this logic works as intended in all build environments.Cleanup of Redundant Steps:
Documentation Updates:
Dockerfile
, comments related to sccache
and how to provide secrets have been updated. Ensure these comments are clear and help future maintainers understand the build process.If you have any questions or need further assistance, feel free to let me know.
Issue being fixed or feature implemented
We use Amazon S3 as a cache backend. With very big cache sizes (just cache layers have multiple GBs of size), it became very expensive. We need to find a way to avoid this cost.
What was done?
aws_credentials
action that creates AWS credentials file, to be used as secret mount during Docker buildcache_
, addedcache_region
,cache_endpoint
bucket
fromlibrocksdb
actionendpoint
tos3-layer-cache-settings
actionsccache
action that configures sccache (incl. environment variables)secrets.AWS_REGION
withvars.AWS_REGION
How Has This Been Tested?
Run GHA pipelines multiple times and observe the results.
Breaking Changes
None from external user perspective, CI/CD config is not publicly useable.
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Summary by CodeRabbit
New Features
sccache
caching, enhancing build performance for Rust projects.tests
workflows with new input parameters to control test execution.Bug Fixes
Documentation
Chores