-
Notifications
You must be signed in to change notification settings - Fork 9
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
Adds multi-arch build support #10
Conversation
WalkthroughThe recent updates to the GitHub Actions workflow significantly enhance the process for building and uploading Geth binaries. The workflow now supports multi-architecture builds across various operating systems, improves management of internal and public binaries, and introduces new cleanup functionalities. These changes promote better organization and traceability of binary versions while adopting a feature-driven development approach. Changes
Assessment against linked issues
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (5)
.github/workflows/ci-geth-s3.yml (5)
6-6
: Branch trigger update is appropriate.The workflow now triggers on the
feat/add-multi-arch-build
branch, which aligns with the feature-driven development approach.
15-16
: Environment variable changes are well-structured.The introduction of separate variables for internal and public binaries enhances manageability and clarity.
27-29
: Matrix strategy for multi-arch builds is well-implemented.The use of a strategy matrix allows the workflow to efficiently handle multiple platforms, aligning with the PR's objectives.
44-62
: Build process modifications are robust.The build step correctly adapts to different platforms and includes necessary error checks to ensure build success.
67-149
: Archiving and cleanup functionalities are well-implemented.The archiving process enhances traceability, and the cleanup function is flexible and maintainable.
Ensure the cleanup logic correctly identifies and deletes old binaries as expected.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (6)
.github/workflows/ci-geth-s3.yml (6)
6-6
: Branch trigger update approved.The workflow now triggers on the
feat/add-multi-arch-build
branch, which is appropriate for feature development.
15-16
: Environment variable updates approved.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
provides better control over binary retention policies.
27-29
: Job strategy enhancement approved.The strategy matrix for multiple platforms supports the multi-arch build objective effectively.
44-62
: Build process modifications approved.The dynamic handling of platform-specific variables and binary naming is well-implemented for multi-platform support.
67-109
: Archiving and uploading process approved.The use of platform, version, and commit hash in naming archives improves traceability and organization.
111-150
: Cleanup functionality approved.The
cleanup
job andcleanup_s3
function provide a robust method for managing old binaries in S3.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (7)
.github/workflows/ci-geth-s3.yml (7)
6-6
: Branch trigger update is appropriate.The change to trigger on the
feat/add-multi-arch-build
branch supports feature-driven development and isolated testing.
15-16
: Environment variables update enhances binary management.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for more granular control over binary retention policies.
27-29
: Job strategy matrix enhances multi-architecture support.The use of a strategy matrix for platforms supports the PR's goal of multi-architecture builds, improving the workflow's flexibility and scalability.
44-62
: Dynamic build process supports multi-architecture configurations.The changes to dynamically handle platform-specific configurations ensure correct binary generation across different architectures.
67-109
: Archiving and uploading process enhances traceability.Creating an archive before uploading improves the organization and traceability of binaries, aligning with best practices for managing multiple versions and architectures.
111-150
: Cleanup functionality improves storage management.The introduction of the
cleanup
job andcleanup_s3
function allows for efficient management of old binaries, ensuring optimal use of storage resources.
80-90
: Conditional upload logic centralizes internal binary management.The condition to upload internal binaries only for
linux-amd64
aligns with the use case for internal testing, ensuring focused management of binaries.
c6c6501
to
5152c24
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (6)
.github/workflows/ci-geth-s3.yml (6)
15-16
: Environment variables look good.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
is a clear and effective way to manage binary retention separately for internal and public use.
27-29
: Strategy matrix for multi-arch builds is well-implemented.The use of a strategy matrix for different platforms is a robust way to handle multi-architecture builds.
44-62
: Build process adjustments are appropriate.The build process correctly sets the output name based on the platform and includes error handling for build failures and missing binaries.
80-90
: Conditional upload logic for internal binaries is correct.The logic to upload internal binaries only for
linux-amd64
is implemented correctly, ensuring that the manifest file is updated accordingly.
92-109
: Archiving and uploading process is well-structured.The process of creating an archive and uploading it to S3 is clearly defined, with appropriate error handling in place.
111-150
: Cleanup job andcleanup_s3
function are well-implemented.The
cleanup
job and itscleanup_s3
function effectively manage old binaries, using jq for JSON processing and ensuring flexibility in cleanup operations.
5152c24
to
9660539
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (6)
.github/workflows/ci-geth-s3.yml (6)
6-6
: Branch Trigger Update Approved.The workflow now triggers on the
feat/add-multi-arch-build
branch, which is appropriate for feature-specific development.
15-16
: Environment Variables Update Approved.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for better management of binaries.
27-29
: Job Strategy Enhancement Approved.The strategy matrix supports multiple platforms, facilitating multi-architecture builds.
61-79
: Build Process Modifications Approved.The build step is refactored to dynamically handle multiple platforms. Ensure that all necessary build dependencies are installed on the runner.
84-125
: Archiving and Uploading Changes Approved.The process now includes archiving with enhanced naming. Ensure that the archive creation and upload commands are successful.
127-166
: Cleanup Functionality Approved.The
cleanup
job andcleanup_s3
function are well-structured for managing old binaries. Verify that the cleanup function correctly identifies and deletes old binaries.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (6)
.github/workflows/ci-geth-s3.yml (6)
6-6
: Branch trigger update is appropriate.The workflow now triggers on the
feat/add-multi-arch-build
branch, aligning with the feature development objectives.
15-16
: Environment variables for binary retention are well-defined.The separation into
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for more granular control over binary retention.
27-29
: Multi-arch strategy matrix is well-implemented.The matrix strategy enables systematic builds for multiple architectures, aligning with the PR's objectives.
61-79
: Dynamic build process is effectively implemented.The build process adapts to platform-specific configurations, which is essential for multi-architecture support.
84-125
: Archiving and uploading enhancements are well-executed.The improvements in naming and archiving enhance traceability and organization of binaries.
127-166
: Cleanup functionality is effectively designed.The
cleanup_s3
function provides a flexible and maintainable approach to managing old binaries.
fdea453
to
ed70435
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (5)
.github/workflows/ci-geth-s3.yml (5)
15-16
: Improved binary management with new environment variables.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for better management of internal and public binaries.
27-29
: Enhanced multi-architecture build support.The strategy matrix now supports multiple platforms, enabling multi-architecture builds as per the PR objectives.
61-79
: Robust build process with platform-specific logic.The build process dynamically adapts to different platforms, including handling for Windows executables, enhancing the robustness of the workflow.
84-125
: Improved organization and traceability in the upload process.The archiving and naming of binaries based on platform, version, and commit hash enhance traceability and organization.
127-166
: Flexible and maintainable cleanup functionality.The introduction of a reusable
cleanup_s3
function allows for efficient management of old binaries, enhancing the maintainability of the workflow.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (7)
.github/workflows/ci-geth-s3.yml (7)
6-6
: Branch trigger update is appropriate.The workflow now triggers on the
feat/add-multi-arch-build
branch, which is suitable for testing the new feature in isolation.
15-16
: Environment variable updates enhance binary management.The addition of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for better management of internal and public binaries.
27-29
: Job strategy enhancement supports multi-architecture builds.The strategy matrix for multiple platforms is a key enhancement for enabling multi-architecture builds.
61-79
: Build process modifications are well-implemented.The refactoring to dynamically handle platform information and adjust output filenames is crucial for supporting multi-architecture builds.
84-125
: Archiving and uploading process improvements are effective.Creating an archive of the built binary before uploading enhances traceability and organization.
127-166
: Cleanup functionality is well-designed.The introduction of the
cleanup
job andcleanup_s3
function provides a flexible and maintainable approach to managing old binaries.
96-106
: Conditional upload logic is appropriate.The condition to upload internal binaries only for
linux-amd64
centralizes binary version management effectively.
cd43c15
to
ed70435
Compare
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main | ||
|
||
# Build and upload the geth binary | ||
build_and_push: | ||
needs: Timestamp | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [linux-386, linux-amd64, linux-arm, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64, windows-386] |
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.
linux-386
linux-arm
windows-386
those are not needed IMO.
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::478656756051:role/iac-max-role |
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.
please hide this aws ID.
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.
@AndyBoWu is there a way to hide this?
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.
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.
added some comments, please make sure the entire flow will work.
f106f30
to
edcc06d
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (8)
.github/workflows/ci-geth-s3.yml (8)
6-6
: Branch trigger update is appropriate.The branch trigger update to
feat/add-multi-arch-build
aligns with the PR objectives.
15-16
: Environment variable updates enhance binary management.Introducing
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for better organization and traceability of binaries.
61-79
: Build step refactoring is correct and robust.The build step refactoring accommodates the new matrix strategy and includes necessary error handling.
84-126
: Upload process enhancements are well-implemented.The upload process includes archiving and error handling, aligning with the objectives of effective binary management.
127-137
: AWS credential configuration for cleanup is necessary.The configuration is required for the cleanup job to function correctly.
140-166
:cleanup_s3
function is well-implemented.The function provides flexible and maintainable cleanup operations for old binaries in S3.
42-57
: Ensure consistency ofversion.go
format.The version extraction logic assumes a specific format. Verify that
version.go
consistently follows this format across the codebase.Verification successful
Version extraction logic is consistent with
version.go
format.The format of
version.go
is consistent with the assumptions in the workflow script. The version components are defined as constants and used consistently across the codebase.
params/version.go
: DefinesVersionMajor
,VersionMinor
,VersionPatch
, andVersionMeta
as constants.- References in
eth/backend.go
andbuild/ci.go
confirm consistent usage.No changes are needed.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the `version.go` format. # Test: Check for the expected version format. Expect: Consistent formatting across all occurrences. rg --type go 'Version(Major|Minor|Patch|Meta)' --context 2Length of output: 2029
27-29
: Verify the necessity of all platforms in the strategy matrix.The strategy matrix supports multi-architecture builds, but some platforms may not be needed according to previous comments.
Verification successful
Platforms in the strategy matrix are necessary.
The platforms listed in the strategy matrix are referenced in key files such as
build/ci.go
andbuild/checksums.txt
, indicating their necessity for the build and verification processes. Thus, their inclusion in the matrix is justified.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the necessity of all platforms listed in the strategy matrix. # Test: Check for platform-specific code. Expect: Code supporting all listed platforms. rg --type yaml 'platform: \[linux-386, linux-amd64, linux-arm, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64, windows-386\]'Length of output: 135
Script:
#!/bin/bash # Description: Search for references to the platforms listed in the strategy matrix across the entire codebase. # Test: Check for any references to the platforms in code, documentation, or scripts. rg 'linux-386|linux-amd64|linux-arm|linux-arm64|darwin-amd64|darwin-arm64|windows-amd64|windows-386'Length of output: 2944
edcc06d
to
d6e28b7
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.
Caution
Inline review comments failed to post
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (7)
.github/workflows/ci-geth-s3.yml (7)
6-6
: Branch Trigger Update Approved.The workflow's trigger on the
feat/add-multi-arch-build
branch aligns with the PR objectives for multi-architecture support.
15-16
: Environment Variables Update Approved.The renaming and addition of variables for managing internal and public binaries improve the workflow's organization and functionality.
61-79
: Build Process Modifications Approved.The refactoring to accommodate the new matrix strategy and platform-specific handling ensures adaptability for multi-architecture support.
84-125
: Archiving and Uploading Logic Approved.Creating an archive of the built binary before uploading enhances traceability and organization, aligning with best practices.
96-106
: Conditional Upload Logic Approved.Uploading internal binaries only for the
linux-amd64
platform centralizes version management effectively.
127-166
: Cleanup Functionality Approved.The introduction of a
cleanup
job with a reusablecleanup_s3
function enhances flexibility and maintainability in managing old binaries.
27-29
: Job Strategy Enhancement Approved.The strategy matrix for multiple platforms supports multi-architecture builds, aligning with the PR objectives.
However, verify the necessity of all platforms listed, as existing comments suggest some may not be needed.
Comments failed to post (1)
.github/workflows/ci-geth-s3.yml
132-135: Hide AWS Role Information.
Sensitive information like AWS role IDs should be hidden. Consider using GitHub secrets to manage these credentials securely.
- role-to-assume: arn:aws:iam::478656756051:role/iac-max-role + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: us-west-1
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (6)
.github/workflows/ci-geth-s3.yml (6)
6-6
: Branch trigger update looks good.The workflow now triggers on the
feat/add-multi-arch-build
branch, aligning with the PR objectives.
15-16
: Environment variables update looks good.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for distinct management of internal and public binaries.
27-29
: Job strategy enhancement looks good.The strategy matrix now supports multiple platforms, aligning with the multi-architecture build objective.
Note: A previous comment suggests removing certain platforms. Ensure alignment with project requirements.
61-79
: Build process modifications look good.The process correctly handles different platforms and adjusts the output filename, including Windows executables.
84-125
: Archiving and uploading process looks good.The process enhances traceability and organization of binaries. Ensure AWS credentials are secured.
Note: A previous comment suggests hiding the AWS ID. Verify that sensitive information is not exposed.
127-166
: Cleanup functionality looks good.The
cleanup_s3
function is flexible and maintainable, efficiently managing old binaries.
d6e28b7
to
4a33621
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (8)
.github/workflows/ci-geth-s3.yml (8)
6-6
: Branch trigger update is approved.The change to trigger the workflow on the
feat/main
branch aligns with feature-driven development practices.
15-16
: Environment variable changes are approved.The renaming and addition of environment variables allow for better management of internal and public binaries.
27-29
: Job strategy enhancement is approved.The introduction of a strategy matrix for multiple platforms supports the PR's objective of multi-architecture builds.
61-79
: Build step logic is approved.The logic for setting the output name and checking for build success is correctly implemented.
84-125
: Upload step logic is approved.The logic for archiving and uploading binaries to S3, including conditions for internal use, is well-implemented.
127-166
: Cleanup job logic is approved.The cleanup function is flexible and effectively manages binary retention in S3.
42-58
: Verify version extraction logic.Ensure that the
params/version.go
file exists and contains the expected version information format.Verification successful
Version extraction logic is correctly implemented.
The
params/version.go
file exists and contains the expected version information format. The workflow should extract the version correctly. No changes are needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and format of the `params/version.go` file. # Test: Check for the file and expected format. fd 'version.go' | xargs rg 'Version(Major|Minor|Patch|Meta)'Length of output: 773
Line range hint
33-40
: Verify AWS credentials configuration.Ensure that the AWS role
arn:aws:iam::478656756051:role/iac-max-role
and regionus-west-1
are appropriate for the intended operations.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/ci-geth-s3.yml (3 hunks)
Additional comments not posted (5)
.github/workflows/ci-geth-s3.yml (5)
15-16
: Environment variable changes approved.The introduction of
NUM_INTERNAL_BINARIES_TO_KEEP
andNUM_PUBLIC_BINARIES_TO_KEEP
allows for distinct management of internal and public binaries, enhancing workflow flexibility.
27-29
: Job strategy enhancement approved.The strategy matrix supports multi-architecture builds, aligning with the PR objectives of expanding architecture support.
61-79
: Build process modifications approved.The build process dynamically adjusts for each platform, ensuring correct outputs and includes error handling for build failures.
84-125
: Archiving and uploading process approved.The archiving process enhances traceability, and the conditional logic centralizes internal binary management.
127-166
: Cleanup functionality approved.The
cleanup_s3
function provides a flexible and maintainable approach to managing old binaries in S3.
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.
LGTM
This change fixes #9 and adds support for binary builds of the following arch types:
Linux
Mac
Windows
Summary by CodeRabbit
New Features
Improvements