Skip to content

[CI] Update docker file#84

Merged
Luohaothu merged 1 commit intomasterfrom
feature-docker
Jan 27, 2026
Merged

[CI] Update docker file#84
Luohaothu merged 1 commit intomasterfrom
feature-docker

Conversation

@Luohaothu
Copy link
Contributor

@Luohaothu Luohaothu commented Jan 27, 2026

Summary by CodeRabbit

  • Chores
    • Updated Docker build process to automatically detect and apply the latest GCC and LLVM versions.
    • Docker images now include both GCC and LLVM/Clang compiler toolchains with semantic version tagging.
    • Optimized build pipeline to skip rebuilds when image versions already exist.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR updates the Docker build workflow and Dockerfile to support dynamic GCC and LLVM version detection, conditional builds based on existing image tags, and parameterized version arguments. A new version detection script fetches latest versions from upstream sources, and the workflow conditionally builds and pushes images only when new version combinations are detected.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/docker-build.yml
Renamed job from build-and-push to check-and-build; introduced global DOCKER_IMAGE env var; added job outputs exposing gcc-version, llvm-version, should-build, image-tag; added steps for version detection, tag formatting, and existence checking; gated Docker login and build/push steps behind conditional should-build == 'true'; replaced static with dynamic tags and added version/date labels
Docker Build Setup
scripts/Dockerfile, scripts/detect-latest-versions.sh
Added parameterized GCC_VERSION and LLVM_VERSION args to Dockerfile; replaced Ubuntu sources with Tsinghua mirror; added build tools and dev libraries; introduced LLVM/Clang build flow with CMake/Ninja; added compiler environment variables and post-install verification; cleanup of build artifacts; version labels in metadata. Created new detect-latest-versions.sh script that fetches latest GCC/LLVM versions from FTP and GitHub API, validates them, and outputs to CI environment

Sequence Diagram(s)

sequenceDiagram
    participant GHA as GitHub Actions
    participant VD as detect-versions<br/>Script
    participant FTP as GCC FTP
    participant API as LLVM GitHub API
    participant CT as check-tag<br/>Script
    participant DH as Docker Hub
    participant BP as build-push<br/>Action

    GHA->>VD: Trigger version detection
    VD->>FTP: Fetch latest GCC releases
    FTP-->>VD: Return versions
    VD->>API: Fetch latest LLVM tag
    API-->>VD: Return version
    VD-->>GHA: Output gcc-version, llvm-version
    
    GHA->>CT: Check if image tag exists
    CT->>DH: Query for tag<br/>${DOCKER_IMAGE}:${tag}
    DH-->>CT: Tag exists? (yes/no)
    CT-->>GHA: Output should-build flag

    alt should-build == 'true'
        GHA->>GHA: Login to Docker Hub
        GHA->>BP: Build with version args
        BP-->>BP: Execute Dockerfile<br/>(GCC_VERSION, LLVM_VERSION)
        BP->>DH: Push image with tag<br/>and labels
        DH-->>BP: Confirm push
    else should-build == 'false'
        GHA->>GHA: Skip build/push
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit's ode to versioned builds:

With whiskers twitching, versions detected,
From FTP gardens and GitHub's halls,
Conditional builds, no waste of energy,
Dynamic tags and labels adorn each creation,
Now GCC and Clang hop together! 🐇✨

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Luohaothu Luohaothu merged commit 9fb5f8c into master Jan 27, 2026
2 of 3 checks passed
@Luohaothu Luohaothu deleted the feature-docker branch January 27, 2026 16:48
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.

1 participant