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

Improve docker building workflow #165

Merged
merged 3 commits into from
May 14, 2024

Conversation

isZumpo
Copy link
Contributor

@isZumpo isZumpo commented May 13, 2024

Speeds up the docker building process by utilizing one build agent per platform. In addition, better makes use of the github action caching by scoping it per platform. Since one platform would overwrite the other otherwise, resulting in low cache hit rates when building arm64. In addition, moved the testing of the docker image itself into its own job, which the building jobs are now dependent on.

Build times went from ~10 min down to ~2 min when running on github actions.

Copy link
Contributor

coderabbitai bot commented May 13, 2024

Walkthrough

The recent updates to the GitHub Actions workflow focus on renaming jobs and steps, updating action versions, and modifying tag values for Docker image builds. These changes aim to improve clarity, maintain up-to-date dependencies, and ensure proper testing of Docker images.

Changes

File Change Summary
.github/workflows/docker-build.yml Renamed job push-docker-image to test-docker-image
Updated uses versions for actions/checkout, docker/setup-buildx-action, and docker/build-push-action
Renamed steps for clarity
Changed tags values in Build amd64 image for testing and Build and push docker image steps

🐇
In the realm of code, we dance and play,
Updating actions, come what may.
With Docker tags and steps renamed,
Our workflow's now more aptly framed.
Keep on coding, night and day,
For progress is the rabbit's way!
🐇


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 0611c54 and 3fda898.
Files selected for processing (1)
  • .github/workflows/docker-build.yml (2 hunks)
Additional comments not posted (12)
.github/workflows/docker-build.yml (12)

10-10: Job test-docker-image has been renamed from push-docker-image.

The renaming clarifies the job's purpose, which is to test the Docker image rather than push it.


14-15: Updated actions/checkout to version v4.1.5.

Keeping actions up-to-date ensures compatibility and access to the latest features and fixes.


17-18: Updated docker/setup-buildx-action to version v3.3.0.

Updating to the latest version helps maintain compatibility and leverage new features.


20-28: Updated docker/build-push-action to version v5.3.0 and added caching scoped per platform.

The update and caching improvements enhance build efficiency and reduce build times, especially for arm64 builds.


30-33: Added step to install ALSA dummy module for testing the built image.

This step ensures the necessary modules are available for testing the Docker image, improving test reliability.


Line range hint 35-45: Added step to test the built amd64 image.

Testing the built image ensures it functions correctly before proceeding to the push stage, improving overall workflow reliability.


47-48: Job push-docker-image now depends on test-docker-image.

This dependency ensures that the image is tested before being pushed, improving the reliability of the deployment process.


56-57: Updated actions/checkout to version v4.1.5.

Keeping actions up-to-date ensures compatibility and access to the latest features and fixes.


59-64: Updated docker/login-action to version v3.1.0.

Updating to the latest version helps maintain compatibility and leverage new features.


66-68: Step Generate downcase repository name remains unchanged.

No changes detected in this step.


70-71: Updated docker/setup-buildx-action to version v3.3.0.

Updating to the latest version helps maintain compatibility and leverage new features.


73-83: Updated docker/build-push-action to version v5.3.0 and added caching scoped per platform.

The update and caching improvements enhance build efficiency and reduce build times, especially for arm64 builds.

@tphakala tphakala merged commit c267342 into tphakala:main May 14, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants