Skip to content

Add workflow_dispatch to the pipelines to set Docker image tag (suffix)#50

Closed
bthomee wants to merge 2 commits intomainfrom
bthomee/dispatch
Closed

Add workflow_dispatch to the pipelines to set Docker image tag (suffix)#50
bthomee wants to merge 2 commits intomainfrom
bthomee/dispatch

Conversation

@bthomee
Copy link
Contributor

@bthomee bthomee commented Sep 24, 2025

To ensure reproducible builds and no surprises, we should be able to set the Docker image tags for the images we build and push.

This PR adds the workflow_dispatch to each of the four CI pipelines with a "tag" as input value. The workflow will then use that value as the Docker image tag suffix (for the distro images, which currently get the compiler name and version as tag) or as the image tag itself (for the tools image, which currently gets "latest" as tag).

Thus, before this change, e.g.:

  • debian-bookworm:gcc-15
  • tools-rippled:latest

After this change, e.g.

  • debian-bookworm:gcc-15-latest (when merging a PR) and debian-bookworm:gcc-15-v1.2.3 (when using workflow dispatch)
  • tools-rippled:latest (when merging a PR) and tools-rippled:v1.2.3 (when using workflow dispatch)

workflow_dispatch:
inputs:
tag:
description: "Tag suffix to give the Docker images (e.g. v1.2.3)."
Copy link
Collaborator

@mathbunnyru mathbunnyru Sep 24, 2025

Choose a reason for hiding this comment

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

How to verify we're not pushing the same tag again (completely defeating reproducible builds)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I'll add an extra step that performs the check in a bit.

Copy link
Collaborator

@Bronek Bronek Sep 24, 2025

Choose a reason for hiding this comment

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

What if we make use of git tags for this purpose ?

Although they are not guaranteed to never change, it is something that is rarely done and typically for a very good reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we've come back full circle then based on our offline conversation. I don't mind using Git tags as Docker tags, as that would simplify the pipelines (can use on: push: tags), so either way works for me.

In the meantime, I added a step that checks if the image exists via docker manifest inspect.

tags: |
type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}
type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-${{ env.CONTAINER_TAG }}
type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha-
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Bronek I did not add the tag here, but am not sufficiently familiar with this action. Should the tag be added here too?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bthomee
Copy link
Contributor Author

bthomee commented Sep 25, 2025

After offline discussion, we'll use the images as-is, as they already have the shortened Git commit hash, e.g. clang-16-sha-5dd7158 and gcc-14-sha-5dd7158.

@bthomee bthomee closed this Sep 25, 2025
@bthomee bthomee deleted the bthomee/dispatch branch September 25, 2025 14:35
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.

3 participants