[go: up one dir, main page]

ci:add static versions for base images

What

This MR adds static version numbers to base image CI configurations.

Why

on our runners, if an image is already present on the runner, because of the pull policy if-not-present, it is not going to be updated, even if the sha256 of the images is different.

Introducing explicit versioning for base images will avoid this problem pinning each base image to a specific label. The dev now must manually increment the base image version number whenever either the docker file or any files in the docker context are changed.

To do this I introduce a new script that by looking at the dockerfile will create a hash of these files and tag the base image with this tag.

In a second MR I'll update the function let make_img distro _version = in Tezos_ci to actually use these new version. It is not possible to do it at once.

How

The MR adds a VERSION: 1.0.0 variable to all base image jobs in both the daily and regular base images pipelines:

  • Debian
  • Ubuntu
  • Fedora
  • Rocky Linux
  • Rust (debian-rust)
  • Debian-homebrew

This establishes a baseline version (1.0.0) for all base images from which future versions can increment.

Manually testing the MR

The CI pipeline should run successfully with the new VERSION variable properly propagated to all base image jobs. Check that:

  1. Base image builds complete successfully
  2. The VERSION variable is correctly set in the job environment
  3. No regressions in existing image building process

Notice the tag is only added to the protected branches, so not available in the jobs associated to this MR.

After this MR, this is the workflow to update base images:

graph TD
    %% --- Phase 1: Preparation & Validation ---
    subgraph "Phase 1: Validation"
        START([Start]) --> STEP1[" Update Base Images"]
        STEP1 --> STEP2[" Increment static version"]
        
        STEP2 --> STEP3[" Commit: Temporarily use new tag"]
        
        %% Annotation Node
        NOTE3[/"ℹ️ Use new image on this branch for testing"/]
        STEP3 -.- NOTE3
        
        STEP3 --> STEP4[" Create Merge Request 1"]
        STEP4 --> STEP5{" Run CI / Test MR"}
        
        STEP5 -- "❌ Fails" --> STEP1
    end

    %% --- Phase 2: Cleanup & Merge Image Def ---
    subgraph "Phase 2: Merge Definition"
        STEP5 -- "✅ Passes" --> STEP6A[" Revert/Remove Temporary Commit"]
        
        STEP6A --> STEP6B[" Merge MR 1"]
        
        STEP6B --> STATE_AVAIL["Image Definition Merged"]
    end

    %% --- Phase 3: Activation ---
    subgraph "Phase 3: Activation"
        STATE_AVAIL --> STEP7[" Modify Images.Base_images"]
        
        %% Annotation Node
        NOTE7[/"ℹ️ Update static version string"/]
        STEP7 -.- NOTE7
        
        STEP7 --> STEP8[" Create Merge Request 2"]
        STEP8 --> STEP9{" Test & Merge"}
        
        STEP9 -- "❌ Fails" --> STEP7
        STEP9 -- "✅ Passes" --> DONE(["End"])
    end

    %% --- Styling ---
    style START fill:#333,stroke:#333,color:#fff
    style DONE fill:#333,stroke:#333,color:#fff
    
    style STEP5 fill:#ff9,stroke:#333
    style STEP9 fill:#ff9,stroke:#333
    
    style STEP6B fill:#bfb,stroke:#333
    
    %% Style for Notes
    style NOTE3 fill:#fff,stroke:#666,stroke-dasharray: 5 5
    style NOTE7 fill:#fff,stroke:#666,stroke-dasharray: 5 5
Edited by pietro

Merge request reports

Loading