Skip to content

Update image publish jobs for mutable tags to new method #37720

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

Merged
merged 8 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 17 additions & 51 deletions .gitlab/deploy_containers/deploy_containers_a7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,39 +118,6 @@ deploy_containers-a7-fips:
- ""
- "-jmx"

deploy_containers-a7-rc:
extends: .deploy_containers-a7_external
rules:
!reference [.on_rc]
variables:
VERSION: 7-rc

deploy_containers-a7-win-only-rc:
extends: .deploy_containers-a7_win_only_external
rules:
!reference [.on_rc]
variables:
VERSION: 7-rc

deploy_containers-a7-full-rc:
extends: .deploy_containers-a7-full-base
rules:
!reference [.on_rc]
variables:
VERSION: 7-rc

deploy_containers-a7-fips-rc:
extends: .deploy_containers-a7-base-fips
rules:
!reference [.on_rc]
variables:
VERSION: 7-fips-rc
parallel:
matrix:
- JMX:
- ""
- "-jmx"

deploy_containers-dogstatsd:
extends: .docker_publish_job_definition
stage: deploy_containers
Expand All @@ -162,36 +129,35 @@ deploy_containers-dogstatsd:
- export IMG_SOURCES="${SRC_DSD}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-amd64,${SRC_DSD}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-arm64"
- export IMG_DESTINATIONS="${DSD_REPOSITORY}:${VERSION}"

deploy_containers-a7_internal:
extends: .deploy_containers-a7-base
rules:
!reference [.on_internal_final]
variables:
JMX: "-jmx"

# Jobs [.on_internal_rc]

deploy_containers-a7_internal-rc:
extends: .deploy_containers-a7-base
rules:
!reference [.on_internal_rc]
variables:
VERSION: 7-rc

deploy_containers-a7-fips_internal:
extends: .deploy_containers-a7-base-fips
rules:
!reference [.on_internal_final]
variables:
JMX: "-jmx"

deploy_containers-a7-fips_internal-rc:
extends: .deploy_containers-a7-base-fips
rules:
!reference [.on_internal_rc]
variables:
VERSION: 7-fips-rc
parallel:
matrix:
- JMX:
- ""
- "-jmx"

# Jobs [.on_internal_final]

deploy_containers-a7_internal:
extends: .deploy_containers-a7-base
rules:
!reference [.on_internal_final]
variables:
JMX: "-jmx"

deploy_containers-a7-fips_internal:
extends: .deploy_containers-a7-base-fips
rules:
!reference [.on_internal_final]
variables:
JMX: "-jmx"
126 changes: 107 additions & 19 deletions .gitlab/deploy_containers/deploy_mutable_image_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,109 @@
- VERSION="$(dda inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?
- export IMG_TAG_REFERENCE=${AGENT_REPOSITORY}:${VERSION}${IMG_TAG_REFERENCE_SUFFIX}

# Stable tags
.deploy_mutable_image_tags-base_rc:
extends: .docker_publish_job_definition
stage: deploy_mutable_image_tags
dependencies: []
before_script:
- VERSION="$(dda inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- VERSION="$(dda inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?
- VERSION="$(dda inv -- agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?

- export IMG_TAG_REFERENCE=${AGENT_REPOSITORY}:${VERSION}${IMG_TAG_REFERENCE_FLAVOR}${IMG_TAG_REFERENCE_WIN_OS}${IMG_TAG_REFERENCE_JMX}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we try to further simplify that with maybe something like ${AGENT_REPOSITORY}:${VERSION}${SUFFIX} ?
I also think IMG_TAG_* variable names can be shortened

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMG_TAG_REFERENCE has to stay, as it is passed to public-images. I wanted to make those names explicit, but I guess we can use the shortening here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just think that this might be difficult to read and change for example:

      - IMG_TAG_REFERENCE_FLAVOR:
          - ""
          - "-servercore"
          - "-linux"
        IMG_TAG_REFERENCE_JMX:
          - ""
          - "-jmx"

Where as this would be easier to maintain:

- SUFFIX: ""
- SUFFIX: "-jmx"
- SUFFIX: "-servercore"
- SUFFIX: "-servercore-jmx"
- SUFFIX: "-linux"
- SUFFIX: "-linux-jmx"

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 idea, I tried to change it to look more like that and it should work and is much easier to read.

- export IMG_NEW_TAGS=7-rc${IMG_TAG_REFERENCE_FLAVOR}${IMG_TAG_REFERENCE_WIN_OS}${IMG_TAG_REFERENCE_JMX}

# Jobs [.on_rc]

deploy_mutable_image_tags-a7-rc:
extends: .deploy_mutable_image_tags-base_rc
stage: deploy_mutable_image_tags
rules:
!reference [.on_rc]
parallel:
matrix:
- IMG_TAG_REFERENCE_FLAVOR:
- ""
- "-servercore"
- "-linux"
IMG_TAG_REFERENCE_JMX:
- ""
- "-jmx"

deploy_mutable_image_tags-a7-win-only-rc:
extends: .deploy_mutable_image_tags-base_rc
stage: deploy_mutable_image_tags
rules:
!reference [.on_rc]
parallel:
matrix:
- IMG_TAG_REFERENCE_FLAVOR:
- ""
- "-servercore"
IMG_TAG_REFERENCE_JMX:
- ""
- "-jmx"
IMG_TAG_REFERENCE_WIN_OS:
- "-ltsc2019"
- "-ltsc2022"

deploy_mutable_image_tags-a7-full-rc:
extends: .deploy_mutable_image_tags_base
stage: deploy_mutable_image_tags
rules:
!reference [.on_rc]
variables:
IMG_TAG_REFERENCE_SUFFIX: ["-full"]
IMG_NEW_TAGS: ["7-rc-full"]

deploy_mutable_image_tags-a7-fips-rc:
extends: .deploy_mutable_image_tags_base
stage: deploy_mutable_image_tags
rules:
!reference [.on_rc]
parallel:
matrix:
- IMG_TAG_REFERENCE_SUFFIX: ["-fips"]
IMG_NEW_TAGS: ["7-fips-rc"]
- IMG_TAG_REFERENCE_SUFFIX: ["-fips-jmx"]
IMG_NEW_TAGS: ["7-fips-rc-jmx"]

# Jobs [.on_internal_rc]

deploy_mutable_image_tags-a7_internal-rc:
extends: .deploy_mutable_image_tags_base
stage: deploy_mutable_image_tags
rules:
!reference [.on_internal_rc]
variables:
IMG_TAG_REFERENCE_SUFFIX: [""]
IMG_NEW_TAGS: ["7-rc"]

deploy_mutable_image_tags-a7-fips_internal-rc:
extends: .deploy_mutable_image_tags_base
stage: deploy_mutable_image_tags
rules:
!reference [.on_internal_rc]
parallel:
matrix:
- IMG_TAG_REFERENCE_SUFFIX: ["-fips"]
IMG_NEW_TAGS: ["7-fips-rc"]
- IMG_TAG_REFERENCE_SUFFIX: ["-fips-jmx"]
IMG_NEW_TAGS: ["7-fips-rc-jmx"]

# Jobs [.on_internal_final]

deploy_mutable_image_tags-a7_internal:
extends: .deploy_mutable_image_tags_base
stage: deploy_mutable_image_tags
rules: !reference [.on_internal_final]
parallel:
matrix:
- IMG_TAG_REFERENCE_SUFFIX: ["-jmx"]
IMG_NEW_TAGS: ["7-jmx"]
- IMG_TAG_REFERENCE_SUFFIX: ["-full"]
IMG_NEW_TAGS: ["7-full"]
- IMG_TAG_REFERENCE_SUFFIX: ["-fips-jmx"]
IMG_NEW_TAGS: ["7-fips-jmx"]

# Jobs [.on_final]

deploy_mutable_image_tags-a7:
extends: .deploy_mutable_image_tags_base
Expand Down Expand Up @@ -40,19 +142,6 @@ deploy_mutable_image_tags-a7:
- IMG_TAG_REFERENCE_SUFFIX: ["-full"]
IMG_NEW_TAGS: ["7-full,latest-full"]

deploy_mutable_image_tags-a7_internal:
extends: .deploy_mutable_image_tags_base
stage: deploy_mutable_image_tags
rules: !reference [.on_internal_final]
parallel:
matrix:
- IMG_TAG_REFERENCE_SUFFIX: "-jmx"
IMG_NEW_TAGS: 7-jmx
- IMG_TAG_REFERENCE_SUFFIX: "-full"
IMG_NEW_TAGS: 7-full
- IMG_TAG_REFERENCE_SUFFIX: "-fips-jmx"
IMG_NEW_TAGS: 7-fips-jmx

deploy_mutable_image_tags-dogstatsd:
extends: .docker_publish_job_definition
stage: deploy_mutable_image_tags
Expand All @@ -68,8 +157,7 @@ deploy_mutable_image_tags-a7-fips:
rules: !reference [.on_final]
parallel:
matrix:
- IMG_TAG_REFERENCE_SUFFIX: "-fips"
IMG_NEW_TAGS: 7-fips
- IMG_TAG_REFERENCE_SUFFIX: "-fips-jmx"
IMG_NEW_TAGS: 7-fips-jmx

- IMG_TAG_REFERENCE_SUFFIX: ["-fips"]
IMG_NEW_TAGS: ["7-fips"]
- IMG_TAG_REFERENCE_SUFFIX: ["-fips-jmx"]
IMG_NEW_TAGS: ["7-fips-jmx"]