Skip to content

feat: Add sccache to speed up Docker image building#7618

Open
tfhddd wants to merge 1 commit intovllm-project:mainfrom
ascend-gha-runners:tfh_docker_image
Open

feat: Add sccache to speed up Docker image building#7618
tfhddd wants to merge 1 commit intovllm-project:mainfrom
ascend-gha-runners:tfh_docker_image

Conversation

@tfhddd
Copy link
Contributor

@tfhddd tfhddd commented Mar 25, 2026

What this PR does / why we need it?

The current Docker build time is too long. By adding sccache, the compilation speed of mooncake and vllm-ascend can be improved.

Does this PR introduce any user-facing change?

  1. Install sccache;
  2. Connect to GitHub's GHA for sccache caching;
  3. Enable sccache caching in mooncake;
  4. Add sccache compatibility to vllm-ascend.

Why use GitHub's GHA for caching:
Docker image builds use GitHub servers, and using GitHub's GHA can avoid network latency.

How was this patch tested?

Currently, the overall build time is 2 hours and 38 minutes.
image

After optimization, the overall build time is 1 hour and 14 minutes.
image

@github-actions
Copy link
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Docker image building process by introducing sccache, a compiler caching tool. The changes modify several Dockerfiles and associated build configurations to enable and utilize sccache, aiming to reduce build times and improve overall efficiency, especially within a GitHub Actions environment.

Highlights

  • Integration of sccache: sccache is integrated into various Dockerfiles (Dockerfile, Dockerfile.310p, Dockerfile.310p.openEuler, Dockerfile.a3, Dockerfile.a3.openEuler) to leverage its caching capabilities for faster Docker image builds.
  • Build process enhancements: The build scripts and CMake configurations are updated to prioritize sccache over ccache when available, ensuring that the build process benefits from the new caching mechanism.
  • Environment variable configuration: New ARG variables (SCCACHE_GHA_ENABLED, MATRIX_ARCH) and ENV variables (ACTIONS_RESULTS_URL, ACTIONS_RUNTIME_TOKEN, ACTIONS_CACHE_SERVICE_V2, SCCACHE_GHA_ENABLED) are introduced in the Dockerfiles to support GitHub Actions caching for sccache.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/_schedule_image_build.yaml
    • .github/workflows/schedule_image_build_and_push.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request integrates sccache into the Docker image build process across various Dockerfiles to enhance build caching and reduce build times. It introduces new build arguments and modifies build scripts to utilize sccache. The review highlights a critical issue where the specified sccache version v0.14.0 is incorrect and will cause build failures, suggesting v0.8.0 as a valid alternative. Additionally, the sccache installation logic is duplicated across multiple Dockerfiles, which should be refactored into a shared script for better maintainability.

@tfhddd tfhddd force-pushed the tfh_docker_image branch from 7e93879 to 7081208 Compare March 25, 2026 08:20
feat: Add sccache to speed up compilation

feat: Add sccache to speed up compilation

feat: Add sccache to speed up compilation

feat: Add sccache to speed up compilation

feat: Add sccache to speed up compilation
Signed-off-by: tfhddd <2272751277@qq.com>
@tfhddd tfhddd force-pushed the tfh_docker_image branch from 7081208 to 8e67fee Compare March 25, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant