Skip to content

Separate needs for ot_agent_standalone builds by architecture #36769

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

Conversation

alopezz
Copy link
Contributor

@alopezz alopezz commented May 7, 2025

What does this PR do?

Specifies the actual dependency for each architecture of the ot_agent_standalone builds.

Motivation

Fixing this kind of error: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/928465297.

Both docker_build_ot_agent_standalone_amd64 and docker_build_ot_agent_standalone_arm64 are depending on docker_build_base_image_arm64 on GitLab terms, but the amd64 image actually depends on its matching base image being present in the registry. This leads to situations where the amd64 build can fail because its base image is still not there. In the above example, the base image build failed for amd64 on the first attempt while the arm64 didn't, causing it to fail.

Describe how you validated your changes

Pipeline passing would be enough.

Possible Drawbacks / Trade-offs

Additional Notes

@alopezz alopezz marked this pull request as ready for review May 7, 2025 19:02
@alopezz alopezz requested review from a team as code owners May 7, 2025 19:02
@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label May 7, 2025
@agent-platform-auto-pr
Copy link
Contributor

Gitlab CI Configuration Changes

Modified Jobs

.docker_build_ot_agent_standalone
  .docker_build_ot_agent_standalone:
-   needs:
-   - job: docker_build_base_image_arm64
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    variables:
      BUILD_ARG: --target release
      BUILD_CONTEXT: Dockerfiles/otel-agent
      FLATTEN_IMAGE: false
      IMAGE: registry.ddbuild.io/ci/datadog-agent/otel-agent
      TAG_SUFFIX: -7
docker_build_ot_agent_standalone_amd64
  docker_build_ot_agent_standalone_amd64:
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/docker_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
-   - job: docker_build_base_image_arm64
?                                   -
+   - job: docker_build_base_image_amd64
?                                    +
    retry: 2
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - TAG_SUFFIX=${TAG_SUFFIX:-}
    - BUILD_ARG=${BUILD_ARG:-}
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMAGE\" =~ \"ci/datadog-agent/agent\"\
      \ || \"$IMAGE\" =~ \"ci/datadog-agent/cluster-agent\" || \"$IMAGE\" =~ \"ci/datadog-agent/cws-instrumentation\"\
      \  || \"$IMAGE\" =~ \"ci/datadog-agent/otel-agent\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=${CI_COMMIT_TAG+-release}\nfi\n"
    - AGENT_BASE_IMAGE_TAG=registry.ddbuild.io/ci/datadog-agent/agent-base-image${ECR_RELEASE_SUFFIX}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-$ARCH
    - TARGET_TAG=${IMAGE}${ECR_RELEASE_SUFFIX}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}$TAG_SUFFIX-$ARCH
    - DOCKER_LOGIN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DOCKER_REGISTRY_RO user)
      || exit $?
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DOCKER_REGISTRY_RO token | docker login
      --username "$DOCKER_LOGIN" --password-stdin "$DOCKER_REGISTRY_URL"
    - EXIT="${PIPESTATUS[0]}"; if [ $EXIT -ne 0 ]; then echo "Unable to locate credentials
      needs gitlab runner restart"; exit $EXIT; fi
    - docker buildx build --no-cache --push --pull --platform linux/$ARCH --build-arg
      AGENT_BASE_IMAGE_TAG=${AGENT_BASE_IMAGE_TAG} --build-arg CIBUILD=true --build-arg
      GENERAL_ARTIFACTS_CACHE_BUCKET_URL=${GENERAL_ARTIFACTS_CACHE_BUCKET_URL} $BUILD_ARG
      --build-arg DD_GIT_REPOSITORY_URL=https://github.com/DataDog/datadog-agent --build-arg
      DD_GIT_COMMIT_SHA=${CI_COMMIT_SHA} --file $BUILD_CONTEXT/Dockerfile --tag ${TARGET_TAG}
      --label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" --label
      "org.opencontainers.image.authors=Datadog <[email protected]>" --label "org.opencontainers.image.source=https://github.com/DataDog/datadog-agent"
      --label "org.opencontainers.image.version=$(dda inv agent.version)" --label "org.opencontainers.image.revision=${CI_COMMIT_SHA}"
      --label "org.opencontainers.image.vendor=Datadog, Inc." --label "target=none"
      $BUILD_CONTEXT
    - FLATTEN_IMAGE=${FLATTEN_IMAGE:-true}
    - "if [[ \"$FLATTEN_IMAGE\" == \"true\" ]]; then\n  crane flatten -t ${TARGET_TAG}\
      \ ${TARGET_TAG}\nfi\n"
    stage: container_build
    tags:
    - arch:amd64
    timeout: 30m
    variables:
      ARCH: amd64
      BUILD_ARG: --target release
      BUILD_CONTEXT: Dockerfiles/otel-agent
      FLATTEN_IMAGE: false
      IMAGE: registry.ddbuild.io/ci/datadog-agent/otel-agent
      TAG_SUFFIX: -7

Changes Summary

Removed Modified Added Renamed
0 2 0 0

ℹ️ Diff available in the job log.

@alopezz alopezz added changelog/no-changelog qa/no-code-change No code change in Agent code requiring validation labels May 7, 2025
@agent-platform-auto-pr
Copy link
Contributor

Uncompressed package size comparison

Comparison with ancestor 6f4b965a2c1ade2639866c63b7d2c29e0eb32116

Diff per package
package diff status size ancestor threshold
datadog-agent-amd64-deb 0.00MB 775.98MB 775.98MB 0.50MB
datadog-agent-x86_64-rpm 0.00MB 784.92MB 784.92MB 0.50MB
datadog-agent-x86_64-suse 0.00MB 784.92MB 784.92MB 0.50MB
datadog-agent-arm64-deb 0.00MB 765.77MB 765.77MB 0.50MB
datadog-agent-aarch64-rpm 0.00MB 774.69MB 774.69MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 31.20MB 31.20MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 31.28MB 31.28MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 31.28MB 31.28MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 30.03MB 30.03MB 0.50MB
datadog-heroku-agent-amd64-deb 0.00MB 377.85MB 377.85MB 0.50MB
datadog-iot-agent-amd64-deb 0.00MB 60.52MB 60.52MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 60.60MB 60.60MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 60.60MB 60.60MB 0.50MB
datadog-iot-agent-arm64-deb 0.00MB 57.81MB 57.81MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.00MB 57.89MB 57.89MB 0.50MB

Decision

✅ Passed

@agent-platform-auto-pr
Copy link
Contributor

Static quality checks

✅ Please find below the results from static quality gates

Successful checks

Info

Result Quality gate On disk size On disk size limit On wire size On wire size limit
static_quality_gate_agent_deb_amd64 750.7 MiB 778.06 MiB 185.02 MiB 191.06 MiB
static_quality_gate_agent_deb_amd64_fips 748.59 MiB 776.09 MiB 184.64 MiB 190.72 MiB
static_quality_gate_agent_heroku_amd64 368.43 MiB 434.99 MiB 98.05 MiB 114.34 MiB
static_quality_gate_agent_msi 968.69 MiB 978.45 MiB 146.83 MiB 151.65 MiB
static_quality_gate_agent_rpm_amd64 750.79 MiB 778.06 MiB 186.82 MiB 193.42 MiB
static_quality_gate_agent_rpm_amd64_fips 748.54 MiB 776.06 MiB 185.75 MiB 192.61 MiB
static_quality_gate_agent_rpm_arm64 740.98 MiB 768.33 MiB 169.28 MiB 174.71 MiB
static_quality_gate_agent_rpm_arm64_fips 739.01 MiB 766.55 MiB 168.05 MiB 173.92 MiB
static_quality_gate_agent_suse_amd64 750.66 MiB 778.08 MiB 186.82 MiB 193.42 MiB
static_quality_gate_agent_suse_amd64_fips 748.62 MiB 776.11 MiB 185.75 MiB 192.78 MiB
static_quality_gate_agent_suse_arm64 740.91 MiB 768.31 MiB 169.28 MiB 174.71 MiB
static_quality_gate_agent_suse_arm64_fips 738.98 MiB 766.5 MiB 168.05 MiB 173.92 MiB
static_quality_gate_docker_agent_amd64 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_arm64 858.33 MiB 876.0 MiB 272.02 MiB 278.3 MiB
static_quality_gate_docker_agent_jmx_amd64 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_jmx_arm64 858.33 MiB 876.63 MiB 272.02 MiB 278.4 MiB
static_quality_gate_docker_agent_windows1809 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows1809_core 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows1809_core_jmx 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows1809_jmx 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows2022 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows2022_core 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows2022_core_jmx 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_agent_windows2022_jmx 844.93 MiB 862.5 MiB 285.2 MiB 292.0 MiB
static_quality_gate_docker_cluster_agent_amd64 259.65 MiB 263.4 MiB 101.94 MiB 104.07 MiB
static_quality_gate_docker_cluster_agent_arm64 275.65 MiB 279.38 MiB 96.89 MiB 98.95 MiB
static_quality_gate_docker_cws_instrumentation_amd64 6.66 MiB 7.12 MiB 2.82 MiB 3.29 MiB
static_quality_gate_docker_cws_instrumentation_arm64 6.44 MiB 6.92 MiB 2.6 MiB 3.07 MiB
static_quality_gate_docker_dogstatsd_amd64 37.97 MiB 46.39 MiB 14.64 MiB 17.78 MiB
static_quality_gate_docker_dogstatsd_arm64 36.88 MiB 45.05 MiB 13.72 MiB 16.65 MiB
static_quality_gate_dogstatsd_deb_amd64 29.83 MiB 38.4 MiB 7.89 MiB 10.26 MiB
static_quality_gate_dogstatsd_deb_arm64 28.71 MiB 36.98 MiB 6.87 MiB 8.96 MiB
static_quality_gate_dogstatsd_rpm_amd64 29.83 MiB 38.4 MiB 7.9 MiB 10.27 MiB
static_quality_gate_dogstatsd_suse_amd64 29.83 MiB 38.4 MiB 7.9 MiB 10.27 MiB
static_quality_gate_iot_agent_deb_amd64 57.81 MiB 58.51 MiB 14.55 MiB 15.02 MiB
static_quality_gate_iot_agent_deb_arm64 55.22 MiB 55.94 MiB 12.56 MiB 13.05 MiB
static_quality_gate_iot_agent_deb_armhf 53.99 MiB 54.32 MiB 12.58 MiB 13.05 MiB
static_quality_gate_iot_agent_rpm_amd64 57.81 MiB 58.51 MiB 14.57 MiB 15.04 MiB
static_quality_gate_iot_agent_rpm_arm64 55.22 MiB 55.94 MiB 12.59 MiB 13.07 MiB
static_quality_gate_iot_agent_suse_amd64 57.81 MiB 58.51 MiB 14.57 MiB 15.04 MiB

@alopezz
Copy link
Contributor Author

alopezz commented May 8, 2025

/merge

@dd-devflow
Copy link

dd-devflow bot commented May 8, 2025

View all feedbacks in Devflow UI.

2025-05-08 11:34:32 UTC ℹ️ Start processing command /merge


2025-05-08 11:34:36 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 45m (p90).


2025-05-08 12:02:18 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit db4dbd0 into main May 8, 2025
287 of 289 checks passed
@dd-mergequeue dd-mergequeue bot deleted the alopez/fix_build_ot_agent_standalone_build_deps branch May 8, 2025 12:02
@github-actions github-actions bot added this to the 7.67.0 milestone May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog qa/no-code-change No code change in Agent code requiring validation short review PR is simple enough to be reviewed quickly team/agent-delivery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants