Skip to content

[Backport 7.78.x] Use dd-pkg for public image publication (BARX-1697) - #51945

Merged
FlorentClarret merged 3 commits into
7.78.xfrom
ali.b/backport-51599-7.78.x
Jun 9, 2026
Merged

[Backport 7.78.x] Use dd-pkg for public image publication (BARX-1697)#51945
FlorentClarret merged 3 commits into
7.78.xfrom
ali.b/backport-51599-7.78.x

Conversation

@AliDatadog

Copy link
Copy Markdown
Contributor

Backport #51599 to 7.78.x.

This PR also includes prerequisite backports:

Jira:

Conflict notes:

  • Preserved release-branch-specific Windows image pins and public-image source lists.
  • For 7.75.x and older, adapted the changes to the older .gitlab/common/... and .gitlab/deploy_containers/... layout.
  • Branches without the host-profiler preview job omit the Use dd-pkg for public image publication (BARX-1697) #51599 IMG_REGISTRIES: default hunk because there is no target job on those branches.

Validation:

  • git diff --check on every backport branch.
  • Conflict-marker scan across changed GitLab files on every backport branch.
  • Ruby YAML.parse_file syntax parse for every changed YAML file on every backport branch.
  • Signed commits verified with git log --format='%h %G? %s' -3 on every branch.
  • Pre-commit/pre-push hooks passed while creating commits and pushing branches.
  • Representative GitLab CI lint passed for 7.80.x root and distribution configs.
  • Representative GitLab CI lint passed for 7.75.x root config, covering the old trigger distribution include.
  • 7.72.x root GitLab CI lint was attempted but stopped with GitLab API 401 Unauthorized in that older linter/auth path.

AliDatadog and others added 3 commits June 8, 2026 15:02
Stop installing `dd-pkg` at runtime in Agent CI.

- `.log_dd_pkg_version` logs the preinstalled `dd-pkg` version before use, so jobs fail fast if the build image does not provide the CLI.
- Removes `DD_PKG_VERSION` and the per-job `DD_PKG_ARCH` variables that only existed to download the runtime tarball.
- Keeps existing `dd-pkg` upload, lint, sign, and promote usage unchanged.

```mermaid
flowchart LR
  Old[CI job starts] --> Download[curl dd-pkg tarball from S3]
  Download --> Run[dd-pkg upload/sign/promote]
  New[CI job starts with updated build image] --> Version[dd-pkg version]
  Version --> Run
```

`dd-pkg` should be part of the build images instead of being downloaded during every CI job.

The required buildimage changes are now merged:

- Buildimages change: DataDog/datadog-agent-buildimages#1176
- Agent buildimage bump: #51283

Jira: https://datadoghq.atlassian.net/browse/BARX-1747

- `git diff --check`
- `dda inv linter.gitlab-ci --test=all`
- `dda inv invoke-unit-tests.run --tests gitlab_api --directory tasks/unit_tests`
- Pre-push `gitlab-configuration` hook passed while pushing the branch.

This intentionally keeps `DD_PKG_GITLAB_URL` and all actual `dd-pkg` command usage. Only the runtime installation path was removed.

Co-authored-by: ali.benabdallah <ali.benabdallah@datadoghq.com>
(cherry picked from commit 2e067e5)
DataDog/datadog-agent-buildimages#1184 published build images at `v116490909-fc35a1a5`. Agent needs to consume that tag before the stacked dd-pkg public-images rollout.

- Replace `v114725131-b7fd2a07` with `v116490909-fc35a1a5` for existing CI image pins in `.gitlab-ci.yml`.
- This updates `CI_IMAGE_BTF_GEN`, `CI_IMAGE_DOCKER_X64`, `CI_IMAGE_DOCKER_ARM64`, `CI_IMAGE_GITLAB_AGENT_DEPLOY`, `CI_IMAGE_LINUX`, `CI_IMAGE_RPM_X64`, `CI_IMAGE_RPM_ARM64`, and `CI_IMAGE_RPM_ARMHF`.
- Keep suffixes empty.
- Leave Windows pins unchanged because they were on `v114471858-795a98da`, not `v114725131-b7fd2a07`.

Buildimages changelog: DataDog/datadog-agent-buildimages@b7fd2a0...fc35a1a

Jira: BARX-1697

Not rerun per request.

Co-authored-by: ali.benabdallah <ali.benabdallah@datadoghq.com>
(cherry picked from commit 710221c)
Agent public-image publish jobs should move through `dd-pkg publish-image` so artifact-gateway can own policy and signature handling. During rollout, release engineers need the current direct `public-images` trigger to remain the default until individual paths are enabled.

- Add a `dd-pkg publish-image` path to the shared `.docker_publish_job_definition`.
- Use the Datadog public feature flag `ci-public-images-dd-pkg` to choose between dd-pkg and the legacy direct trigger.
- Default to the legacy direct trigger when the flag is disabled, missing, or lookup fails.
- Rely on `dda self feature` built-in CI scopes, and add `ci.project.name`, `registries`, and `destination_repo` scopes for rollout targeting.
- Log the explicit extra scopes and feature flag result before selecting the publish path.
- Preserve the previous no-signing behavior with `--signing=false` and `IMG_SIGNING=false`.
- Keep the existing 30-minute publish timeout and release suffix handling.

```mermaid
flowchart LR
  Job[Agent publish job] --> Flag{ci-public-images-dd-pkg}
  Flag -- true/targeted opt-in --> DDPkg[dd-pkg publish-image]
  DDPkg --> Gateway[artifact-gateway]
  Gateway --> PublicImages[public-images]
  Flag -- false/default --> Legacy[direct public-images trigger]
  Legacy --> PublicImages
```

Jira: BARX-1697

Use `ci-public-images-dd-pkg` as a Datadog public boolean feature flag. The code default is `false`, so the legacy trigger remains the fallback when the flag is disabled or unavailable.

Feature flag: https://app.datadoghq.com/feature-flags/6bfc0383-6dc0-44e9-8a93-37496ad9d2d4?environmentId=a0e7e064-fec8-42fa-b8e1-728a342d8f2a&envs=a0e7e064-fec8-42fa-b8e1-728a342d8f2a&fromUser=false&refresh_mode=sliding&showSuggestionSuccess=false&start=1780670636049&end=1780674236049&paused=false

Useful targeting scopes:

- `ci.project.name=datadog-agent`
- `ci.job.name=<CI_JOB_NAME>`
- `ci.stage.name=<CI_JOB_STAGE>`
- `git.branch=<CI_COMMIT_BRANCH>`
- `registries=<IMG_REGISTRIES>`
- `destination_repo=agent-dev`

- `git diff --check`
- `dda inv linter.gitlab-ci --input-file .gitlab/distribution.yml --test release`
- `dda inv linter.gitlab-ci --input-file .gitlab-ci.yml --test release`
- pre-commit hooks passed
- pre-push hooks passed, including `gitlab-configuration`
- GitLab deploy test: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/pipelines/116757190

Co-authored-by: ali.benabdallah <ali.benabdallah@datadoghq.com>
(cherry picked from commit 419dbf9)
@dd-octo-sts dd-octo-sts Bot added the internal Identify a non-fork PR label Jun 8, 2026
@github-actions github-actions Bot added the medium review PR review might take time label Jun 8, 2026
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 26 Pipeline jobs failed

DataDog/datadog-agent | bazel:test:linux-arm64   View in Datadog   GitLab

DataDog/datadog-agent | build_dogstatsd-binary_arm64   View in Datadog   GitLab

DataDog/datadog-agent | build_dogstatsd-binary_x64   View in Datadog   GitLab

View all 26 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b1b4a67 | Docs | Datadog PR Page | Give us feedback!

@agent-platform-auto-pr

agent-platform-auto-pr Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Gitlab CI Configuration Changes

Updated: .gitlab-ci.yml

⚠️ Diff too large to display on Github.

Changes Summary

Removed Modified Added Renamed
1 202 1 0

Updated: .gitlab/distribution.yml

⚠️ Diff too large to display on Github.

Changes Summary

Removed Modified Added Renamed
1 69 1 0

ℹ️ Diff available in the job log.

@AliDatadog
AliDatadog marked this pull request as ready for review June 9, 2026 08:37
@AliDatadog
AliDatadog requested review from a team as code owners June 9, 2026 08:37
@dd-octo-sts-6cbbf8

Copy link
Copy Markdown

🐑 PR Shepherd is maintaining this PR

I watch your PR and automatically fix CI failures, rebase your branch, handle flaky tests, and push it to the merge queue when it's ready.

More about what I do → Guide

To pause me on this PR, add the flow-skip label.

@FlorentClarret
FlorentClarret merged commit c3960f1 into 7.78.x Jun 9, 2026
258 of 284 checks passed
@FlorentClarret
FlorentClarret deleted the ali.b/backport-51599-7.78.x branch June 9, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport changelog/no-changelog No changelog entry needed internal Identify a non-fork PR medium review PR review might take time qa/no-code-change No code change in Agent code requiring validation team/agent-build team/agent-delivery team/agent-devx team/container-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants