Skip to content
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

feat(gitlab): Job retry on agent.version and pipeline.changelog #29546

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

chouetz
Copy link
Member

@chouetz chouetz commented Sep 24, 2024

What does this PR do?

Added an Exit(code=42) on python invoke tasks calling aws cli during the pipeline.
And throw that exit code in the gitlab script call (using command || exit $?) as this is currently mandatory for gitlab to get the correct error code.

Motivation

acix-435 - Follow-up of #29262. In some situation the first call to aws cli is not a call to aws ssm but aws cp. With addition of the Exit(code=42), if these tasks fail the job will be retried

Describe how to test/QA your changes

We can only validate I didn't change the current behaviour. We can validate with a log search of looking at retried job executions, which is tedious. Otherwise we can just monitor if any "Unable to locate credential" issue re-occurs in the pipeline.

Possible Drawbacks / Trade-offs

In some modified calls there are still some other aws commands called first, this will come in a next PR

Additional Notes

I took the opportunity to remove unnecessary export keywords

@chouetz chouetz requested review from a team as code owners September 24, 2024 15:01
@chouetz chouetz added changelog/no-changelog qa/no-code-change Skip QA week as there is no code change in Agent code labels Sep 24, 2024
@@ -185,7 +185,7 @@ deploy_staging_iot_agent:
needs: ["build_iot_agent-binary_x64"]
script:
- $S3_CP_CMD $S3_ARTIFACTS_URI/iot/agent ./agent
Copy link
Member Author

Choose a reason for hiding this comment

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

Here the script can fail on that line. I did the modification below for consistency and will do a follow-up PR for such calls

@pr-commenter
Copy link

pr-commenter bot commented Sep 24, 2024

Gitlab CI Configuration Changes

Updated: .gitlab-ci.yml

Modified Jobs

.agent_release_management_trigger
  .agent_release_management_trigger:
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    script:
-   - export RELEASE_VERSION=$(inv agent.version --major-version 7 --url-safe --omnibus-format)-1
?    -------
+   - RELEASE_VERSION="$(inv agent.version --major-version 7 --url-safe --omnibus-format)-1"
?                     +                                                                    +
+     || exit $?
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - inv pipeline.trigger-child-pipeline --project-name "DataDog/agent-release-management"
      --git-ref "main" --variable ACTION --variable AUTO_RELEASE --variable BUILD_PIPELINE_ID
      --variable RELEASE_PRODUCT --variable RELEASE_VERSION --variable TARGET_REPO --variable
      TARGET_REPO_BRANCH $NO_FOLLOW
    stage: trigger_release
    tags:
    - arch:amd64
    variables:
      ACTION: promote
      BUILD_PIPELINE_ID: $CI_PIPELINE_ID
      RELEASE_PRODUCT: datadog-agent
      TARGET_REPO_BRANCH: $BUCKET_BRANCH
.common_build_oci
  .common_build_oci:
    artifacts:
      expire_in: 2 weeks
      paths:
      - $OMNIBUS_PACKAGE_DIR
    cache:
    - key:
        files:
        - omnibus/Gemfile
        - release.json
        prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION-$OMNIBUS_SOFTWARE
      paths:
      - omnibus/vendor/bundle
    script:
    - echo "About to build for $RELEASE_VERSION"
+   - AGENT_VERSION="$(inv agent.version -u)-1" || exit $?
-   - export INSTALL_DIR=/opt/datadog-packages/datadog-agent/$(inv agent.version -u)-1
?                                                             ^^^^^^^^^^^^^^^^^^^^^^^^
+   - export INSTALL_DIR=/opt/datadog-packages/datadog-agent/"$AGENT_VERSION"
?                                                            + ^^^^^^^^^^^^^^
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.xz
    - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
    - rm -rf $OMNIBUS_PACKAGE_DIR/*
    - tar -xf $CI_PROJECT_DIR/sysprobe-build-outputs.tar.xz
    - mkdir -p /tmp/system-probe
    - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/clang-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/clang-bpf
    - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/llc-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/llc-bpf
    - cp $CI_PROJECT_DIR/minimized-btfs.tar.xz /tmp/system-probe/minimized-btfs.tar.xz
    - chmod 0744 /tmp/system-probe/clang-bpf /tmp/system-probe/llc-bpf
    - inv -e omnibus.build --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION"
      --python-runtimes "$PYTHON_RUNTIMES" --base-dir $OMNIBUS_BASE_DIR  ${USE_S3_CACHING}
      --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --system-probe-bin=/tmp/system-probe
      --host-distribution=ociru --install-directory="$INSTALL_DIR"
    - ls -la $OMNIBUS_PACKAGE_DIR
    - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
    variables:
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
.deploy_containers-cws-instrumentation-base
  .deploy_containers-cws-instrumentation-base:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CWS_INSTRUMENTATION_REPOSITORY" == "" ]]; then export CWS_INSTRUMENTATION_REPOSITORY="cws-instrumentation";
      fi
    - export IMG_BASE_SRC="${SRC_CWS_INSTRUMENTATION}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CWS_INSTRUMENTATION_REPOSITORY}:${VERSION}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_cws_instrumentation
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
.deploy_containers-dca-base
  .deploy_containers-dca-base:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
.deploy_packages_oci
  .deploy_packages_oci:
    before_script:
    - ls $OMNIBUS_PACKAGE_DIR
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    - if: $DEPLOY_INSTALLER == "true" || $DDR_WORKFLOW_ID != null
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - .gitlab/**/*
        - omnibus/config/**/*
        - pkg/fleet/**/*
        - cmd/installer/**/*
        - test/new-e2e/tests/installer/**/*
        - tasks/installer.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - set +x
-   - export VERSION=$(inv agent.version --url-safe)-1
?    -------
+   - VERSION="$(inv agent.version --url-safe)-1" || exit $?
?             +                                 ++++++++++++
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf
      "https://github.com/DataDog/"
    - go env -w GOPRIVATE="github.com/DataDog/*"
    - export PATH=$PATH:$(go env GOPATH)/bin
    - go install github.com/DataDog/datadog-packages/cmd/datadog-package@latest
    - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:${VERSION}
      ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar
    - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID}
      ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar
    stage: deploy_packages
    tags:
    - arch:amd64
    variables:
      MAJOR_VERSION: 7
.new-e2e_windows_a6_x86_64
  .new-e2e_windows_a6_x86_64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a6
    rules:
    - if: ($CI_COMMIT_BRANCH == "main"  || $DEPLOY_AGENT == "true" || $RUN_E2E_TESTS
        == "on" || $DDR_WORKFLOW_ID != null) && $RUN_E2E_TESTS != "off"
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e
    tags:
    - arch:amd64
    variables:
      AGENT_MAJOR_VERSION: 6
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_PARAMS: --run "$E2E_MSI_TEST$"
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/install-test
      TEAM: windows-agent
      WINDOWS_AGENT_ARCH: x86_64
.new-e2e_windows_a7_x86_64
  .new-e2e_windows_a7_x86_64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a7
    rules:
    - if: ($CI_COMMIT_BRANCH == "main"  || $DEPLOY_AGENT == "true" || $RUN_E2E_TESTS
        == "on" || $DDR_WORKFLOW_ID != null) && $RUN_E2E_TESTS != "off"
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e
    tags:
    - arch:amd64
    variables:
      AGENT_MAJOR_VERSION: 7
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_PARAMS: --run "$E2E_MSI_TEST$"
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/install-test
      TEAM: windows-agent
      WINDOWS_AGENT_ARCH: x86_64
.new-e2e_windows_domain_test
  .new-e2e_windows_domain_test:
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    variables:
      TARGETS: ./tests/windows/domain-test
      TEAM: windows-agent
.new-e2e_windows_msi
  .new-e2e_windows_msi:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e
    tags:
    - arch:amd64
    variables:
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_PARAMS: --run "$E2E_MSI_TEST$"
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/install-test
      TEAM: windows-agent
.package_oci
  .package_oci:
    artifacts:
      paths:
      - ${OMNIBUS_PACKAGE_DIR}
    before_script:
-   - export PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7)-1
?    -------
+   - PACKAGE_VERSION="$(inv agent.version --url-safe --major-version 7)-1" || exit
?                     +                                                   +++++++++
+     $?
    - export INSTALL_DIR=/opt/datadog-packages/${OCI_PRODUCT}/${PACKAGE_VERSION}
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - rm -f $OMNIBUS_PACKAGE_DIR/*-dbg-*.tar.xz
    - ls -l $OMNIBUS_PACKAGE_DIR
    - python3 -m pip install -r tasks/libs/requirements-github.txt
    - set +x
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf
      "https://github.com/DataDog/"
    - go env -w GOPRIVATE="github.com/DataDog/*"
    - ${CI_PROJECT_DIR}/tools/ci/retry.sh go install github.com/DataDog/datadog-packages/cmd/datadog-package@latest
    - OUTPUT_DIR="/tmp/oci_output"
    - mkdir -p ${OUTPUT_DIR}
    - ls $OMNIBUS_PACKAGE_DIR
    - "if [ $(ls $OMNIBUS_PACKAGE_DIR/*.oci.tar 2> /dev/null | wc -l) -ge 1 ]; then\n\
      \  echo \"Copying already built images to output dir\"\n  cp $OMNIBUS_PACKAGE_DIR/*.oci.tar\
      \ ${OUTPUT_DIR}\nfi\n"
    - "for ARCH in \"amd64\" \"arm64\"; do\n  INPUT_FILE=\"${OMNIBUS_PACKAGE_DIR}${OCI_PRODUCT}-*${ARCH}.tar.xz\"\
      \n  OUTPUT_FILE=\"$(basename -a -s .xz ${INPUT_FILE})\"\n  MERGED_FILE=$(basename\
      \ -a $OMNIBUS_PACKAGE_DIR/*.tar.xz | head -n 1 | sed \"s/-${ARCH}.tar.xz//\").oci.tar\n\
      \  export MERGED_FILE\n  INPUT_DIR=\"/tmp/input_${ARCH}\"\n  mkdir -p ${INPUT_DIR}\n\
      \  echo \"Generating OCI for $ARCH.\"\n  echo \"Extracting to temporary input\
      \ dir $INPUT_FILE -> $INPUT_DIR\"\n  tar xJf ${INPUT_FILE} -C ${INPUT_DIR}\n \
      \ echo \"Creating OCI layer -> ${OUTPUT_DIR}/${OUTPUT_FILE}\"\n  if [ \"${OCI_PRODUCT}\"\
      \ = \"datadog-agent\" ]; then\n    EXTRA_FLAGS=\"--configs ${INPUT_DIR}/etc/datadog-agent\"\
      \n  fi\n  datadog-package create \\\n    --version ${PACKAGE_VERSION} \\\n   \
      \ --package ${OCI_PRODUCT} \\\n    --os linux \\\n    --arch ${ARCH} \\\n    --archive\
      \ --archive-path \"${OUTPUT_DIR}/${OUTPUT_FILE}\" \\\n    ${EXTRA_FLAGS} \\\n\
      \    ${INPUT_DIR}/${INSTALL_DIR}/\n  rm -f ${INPUT_FILE}\ndone\n"
    - echo "Aggregating all layers into one package -> ${MERGED_FILE}"
    - ls -l ${OUTPUT_DIR}/
    - datadog-package merge ${OUTPUT_DIR}/*.tar
    - cp merged.tar ${OMNIBUS_PACKAGE_DIR}/${MERGED_FILE}
    - $S3_CP_CMD merged.tar $S3_ARTIFACTS_URI/${OCI_PRODUCT}_7_oci.tar
    stage: packaging
    tags:
    - arch:amd64
    variables:
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
agent_oci
  agent_oci:
    artifacts:
      paths:
      - ${OMNIBUS_PACKAGE_DIR}
    before_script:
-   - export PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7)-1
?    -------
+   - PACKAGE_VERSION="$(inv agent.version --url-safe --major-version 7)-1" || exit
?                     +                                                   +++++++++
+     $?
    - export INSTALL_DIR=/opt/datadog-packages/${OCI_PRODUCT}/${PACKAGE_VERSION}
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - datadog-agent-oci-x64-a7
    - datadog-agent-oci-arm64-a7
    - windows_msi_and_bosh_zip_x64-a7
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - rm -f $OMNIBUS_PACKAGE_DIR/*-dbg-*.tar.xz
    - ls -l $OMNIBUS_PACKAGE_DIR
    - python3 -m pip install -r tasks/libs/requirements-github.txt
    - set +x
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf
      "https://github.com/DataDog/"
    - go env -w GOPRIVATE="github.com/DataDog/*"
    - ${CI_PROJECT_DIR}/tools/ci/retry.sh go install github.com/DataDog/datadog-packages/cmd/datadog-package@latest
    - OUTPUT_DIR="/tmp/oci_output"
    - mkdir -p ${OUTPUT_DIR}
    - ls $OMNIBUS_PACKAGE_DIR
    - "if [ $(ls $OMNIBUS_PACKAGE_DIR/*.oci.tar 2> /dev/null | wc -l) -ge 1 ]; then\n\
      \  echo \"Copying already built images to output dir\"\n  cp $OMNIBUS_PACKAGE_DIR/*.oci.tar\
      \ ${OUTPUT_DIR}\nfi\n"
    - "for ARCH in \"amd64\" \"arm64\"; do\n  INPUT_FILE=\"${OMNIBUS_PACKAGE_DIR}${OCI_PRODUCT}-*${ARCH}.tar.xz\"\
      \n  OUTPUT_FILE=\"$(basename -a -s .xz ${INPUT_FILE})\"\n  MERGED_FILE=$(basename\
      \ -a $OMNIBUS_PACKAGE_DIR/*.tar.xz | head -n 1 | sed \"s/-${ARCH}.tar.xz//\").oci.tar\n\
      \  export MERGED_FILE\n  INPUT_DIR=\"/tmp/input_${ARCH}\"\n  mkdir -p ${INPUT_DIR}\n\
      \  echo \"Generating OCI for $ARCH.\"\n  echo \"Extracting to temporary input\
      \ dir $INPUT_FILE -> $INPUT_DIR\"\n  tar xJf ${INPUT_FILE} -C ${INPUT_DIR}\n \
      \ echo \"Creating OCI layer -> ${OUTPUT_DIR}/${OUTPUT_FILE}\"\n  if [ \"${OCI_PRODUCT}\"\
      \ = \"datadog-agent\" ]; then\n    EXTRA_FLAGS=\"--configs ${INPUT_DIR}/etc/datadog-agent\"\
      \n  fi\n  datadog-package create \\\n    --version ${PACKAGE_VERSION} \\\n   \
      \ --package ${OCI_PRODUCT} \\\n    --os linux \\\n    --arch ${ARCH} \\\n    --archive\
      \ --archive-path \"${OUTPUT_DIR}/${OUTPUT_FILE}\" \\\n    ${EXTRA_FLAGS} \\\n\
      \    ${INPUT_DIR}/${INSTALL_DIR}/\n  rm -f ${INPUT_FILE}\ndone\n"
    - echo "Aggregating all layers into one package -> ${MERGED_FILE}"
    - ls -l ${OUTPUT_DIR}/
    - datadog-package merge ${OUTPUT_DIR}/*.tar
    - cp merged.tar ${OMNIBUS_PACKAGE_DIR}/${MERGED_FILE}
    - $S3_CP_CMD merged.tar $S3_ARTIFACTS_URI/${OCI_PRODUCT}_7_oci.tar
    stage: packaging
    tags:
    - arch:amd64
    variables:
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
      OCI_PRODUCT: datadog-agent
cluster_agent_cloudfoundry-build_amd64
  cluster_agent_cloudfoundry-build_amd64:
    artifacts:
      expire_in: 2 weeks
      paths:
      - $OMNIBUS_PACKAGE_DIR
    before_script:
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.xz
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - go_mod_tidy_check
    - go_deps
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - inv check-go-version
    - inv -e cluster-agent-cloudfoundry.build
    - cd $CI_PROJECT_DIR/$CLUSTER_AGENT_CLOUDFOUNDRY_BINARIES_DIR
    - mkdir -p $OMNIBUS_PACKAGE_DIR
-   - export PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7)
?    -------
+   - PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7) || exit $?
?                                                                      +++++++++++
    - tar cf $OMNIBUS_PACKAGE_DIR/datadog-cluster-agent-cloudfoundry-$PACKAGE_VERSION-$ARCH.tar.xz
      datadog-cluster-agent-cloudfoundry
    stage: binary_build
    tags:
    - arch:amd64
    variables:
      ARCH: amd64
      KUBERNETES_CPU_REQUEST: 4
datadog-agent-oci-arm64-a7
  datadog-agent-oci-arm64-a7:
    artifacts:
      expire_in: 2 weeks
      paths:
      - $OMNIBUS_PACKAGE_DIR
    before_script:
    - export RELEASE_VERSION=$RELEASE_VERSION_7
    cache:
    - key:
        files:
        - omnibus/Gemfile
        - release.json
        prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION-$OMNIBUS_SOFTWARE
      paths:
      - omnibus/vendor/bundle
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/rpm_arm64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - go_mod_tidy_check
    - build_system-probe-arm64
    - go_deps
    - generate_minimized_btfs_arm64
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - echo "About to build for $RELEASE_VERSION"
+   - AGENT_VERSION="$(inv agent.version -u)-1" || exit $?
-   - export INSTALL_DIR=/opt/datadog-packages/datadog-agent/$(inv agent.version -u)-1
?                                                             ^^^^^^^^^^^^^^^^^^^^^^^^
+   - export INSTALL_DIR=/opt/datadog-packages/datadog-agent/"$AGENT_VERSION"
?                                                            + ^^^^^^^^^^^^^^
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.xz
    - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
    - rm -rf $OMNIBUS_PACKAGE_DIR/*
    - tar -xf $CI_PROJECT_DIR/sysprobe-build-outputs.tar.xz
    - mkdir -p /tmp/system-probe
    - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/clang-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/clang-bpf
    - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/llc-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/llc-bpf
    - cp $CI_PROJECT_DIR/minimized-btfs.tar.xz /tmp/system-probe/minimized-btfs.tar.xz
    - chmod 0744 /tmp/system-probe/clang-bpf /tmp/system-probe/llc-bpf
    - inv -e omnibus.build --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION"
      --python-runtimes "$PYTHON_RUNTIMES" --base-dir $OMNIBUS_BASE_DIR  ${USE_S3_CACHING}
      --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --system-probe-bin=/tmp/system-probe
      --host-distribution=ociru --install-directory="$INSTALL_DIR"
    - ls -la $OMNIBUS_PACKAGE_DIR
    - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
    stage: package_build
    tags:
    - arch:arm64
    variables:
      AGENT_MAJOR_VERSION: 7
      DESTINATION_OCI: datadog-agent-7-remote-updater-arm64.tar.xz
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
      PACKAGE_ARCH: arm64
      PYTHON_RUNTIMES: '3'
datadog-agent-oci-x64-a7
  datadog-agent-oci-x64-a7:
    artifacts:
      expire_in: 2 weeks
      paths:
      - $OMNIBUS_PACKAGE_DIR
    before_script:
    - export RELEASE_VERSION=$RELEASE_VERSION_7
    cache:
    - key:
        files:
        - omnibus/Gemfile
        - release.json
        prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION-$OMNIBUS_SOFTWARE
      paths:
      - omnibus/vendor/bundle
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/rpm_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - go_mod_tidy_check
    - build_system-probe-x64
    - go_deps
    - generate_minimized_btfs_x64
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - echo "About to build for $RELEASE_VERSION"
+   - AGENT_VERSION="$(inv agent.version -u)-1" || exit $?
-   - export INSTALL_DIR=/opt/datadog-packages/datadog-agent/$(inv agent.version -u)-1
?                                                             ^^^^^^^^^^^^^^^^^^^^^^^^
+   - export INSTALL_DIR=/opt/datadog-packages/datadog-agent/"$AGENT_VERSION"
?                                                            + ^^^^^^^^^^^^^^
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.xz
    - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
    - rm -rf $OMNIBUS_PACKAGE_DIR/*
    - tar -xf $CI_PROJECT_DIR/sysprobe-build-outputs.tar.xz
    - mkdir -p /tmp/system-probe
    - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/clang-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/clang-bpf
    - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/llc-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/llc-bpf
    - cp $CI_PROJECT_DIR/minimized-btfs.tar.xz /tmp/system-probe/minimized-btfs.tar.xz
    - chmod 0744 /tmp/system-probe/clang-bpf /tmp/system-probe/llc-bpf
    - inv -e omnibus.build --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION"
      --python-runtimes "$PYTHON_RUNTIMES" --base-dir $OMNIBUS_BASE_DIR  ${USE_S3_CACHING}
      --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --system-probe-bin=/tmp/system-probe
      --host-distribution=ociru --install-directory="$INSTALL_DIR"
    - ls -la $OMNIBUS_PACKAGE_DIR
    - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
    stage: package_build
    tags:
    - arch:amd64
    variables:
      AGENT_MAJOR_VERSION: 7
      DESTINATION_OCI: datadog-agent-7-remote-updater-amd64.tar.xz
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
      PACKAGE_ARCH: amd64
      PYTHON_RUNTIMES: '3'
deploy_agent_oci
  deploy_agent_oci:
    before_script:
    - ls $OMNIBUS_PACKAGE_DIR
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - agent_oci
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    - if: $DEPLOY_INSTALLER == "true" || $DDR_WORKFLOW_ID != null
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - .gitlab/**/*
        - omnibus/config/**/*
        - pkg/fleet/**/*
        - cmd/installer/**/*
        - test/new-e2e/tests/installer/**/*
        - tasks/installer.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - set +x
-   - export VERSION=$(inv agent.version --url-safe)-1
?    -------
+   - VERSION="$(inv agent.version --url-safe)-1" || exit $?
?             +                                 ++++++++++++
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf
      "https://github.com/DataDog/"
    - go env -w GOPRIVATE="github.com/DataDog/*"
    - export PATH=$PATH:$(go env GOPATH)/bin
    - go install github.com/DataDog/datadog-packages/cmd/datadog-package@latest
    - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:${VERSION}
      ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar
    - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID}
      ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar
    stage: deploy_packages
    tags:
    - arch:amd64
    variables:
      MAJOR_VERSION: 7
      OCI_PRODUCT: datadog-agent
deploy_containers-cws-instrumentation-final-versioned
  deploy_containers-cws-instrumentation-final-versioned:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CWS_INSTRUMENTATION_REPOSITORY" == "" ]]; then export CWS_INSTRUMENTATION_REPOSITORY="cws-instrumentation";
      fi
    - export IMG_BASE_SRC="${SRC_CWS_INSTRUMENTATION}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CWS_INSTRUMENTATION_REPOSITORY}:${VERSION}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta"
      when: never
    - allow_failure: true
      if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      variables:
        AGENT_REPOSITORY: agent-dev
        DSD_REPOSITORY: dogstatsd-dev
        IMG_REGISTRIES: dev
      when: manual
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_cws_instrumentation
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-cws-instrumentation-latest
  deploy_containers-cws-instrumentation-latest:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CWS_INSTRUMENTATION_REPOSITORY" == "" ]]; then export CWS_INSTRUMENTATION_REPOSITORY="cws-instrumentation";
      fi
    - export IMG_BASE_SRC="${SRC_CWS_INSTRUMENTATION}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CWS_INSTRUMENTATION_REPOSITORY}:${VERSION}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta"
      when: never
    - allow_failure: true
      if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      variables:
        AGENT_REPOSITORY: agent-dev
        DSD_REPOSITORY: dogstatsd-dev
        IMG_REGISTRIES: dev
      when: manual
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_cws_instrumentation
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: latest
deploy_containers-cws-instrumentation-rc-mutable
  deploy_containers-cws-instrumentation-rc-mutable:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CWS_INSTRUMENTATION_REPOSITORY" == "" ]]; then export CWS_INSTRUMENTATION_REPOSITORY="cws-instrumentation";
      fi
    - export IMG_BASE_SRC="${SRC_CWS_INSTRUMENTATION}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CWS_INSTRUMENTATION_REPOSITORY}:${VERSION}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_cws_instrumentation
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: rc
deploy_containers-cws-instrumentation-rc-versioned
  deploy_containers-cws-instrumentation-rc-versioned:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CWS_INSTRUMENTATION_REPOSITORY" == "" ]]; then export CWS_INSTRUMENTATION_REPOSITORY="cws-instrumentation";
      fi
    - export IMG_BASE_SRC="${SRC_CWS_INSTRUMENTATION}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CWS_INSTRUMENTATION_REPOSITORY}:${VERSION}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_cws_instrumentation
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-dca
  deploy_containers-dca:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - allow_failure: true
      if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      variables:
        AGENT_REPOSITORY: agent-dev
        DSD_REPOSITORY: dogstatsd-dev
        IMG_REGISTRIES: dev
      when: manual
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-dca-latest
  deploy_containers-dca-latest:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta"
      when: never
    - allow_failure: true
      if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      variables:
        AGENT_REPOSITORY: agent-dev
        DSD_REPOSITORY: dogstatsd-dev
        IMG_REGISTRIES: dev
      when: manual
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: latest
deploy_containers-dca-rc
  deploy_containers-dca-rc:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: rc
deploy_containers-dca_internal
  deploy_containers-dca_internal:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta"
      when: never
    - if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      when: never
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: ci/datadog-agent/agent-release
        CLUSTER_AGENT_REPOSITORY: ci/datadog-agent/cluster-agent-release
        DSD_REPOSITORY: ci/datadog-agent/dogstatsd-release
        IMG_REGISTRIES: internal-aws-ddbuild
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-dca_internal-latest
  deploy_containers-dca_internal-latest:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta"
      when: never
    - if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      when: never
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: ci/datadog-agent/agent-release
        CLUSTER_AGENT_REPOSITORY: ci/datadog-agent/cluster-agent-release
        DSD_REPOSITORY: ci/datadog-agent/dogstatsd-release
        IMG_REGISTRIES: internal-aws-ddbuild
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: latest
deploy_containers-dca_internal-rc
  deploy_containers-dca_internal-rc:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe)"; fi
?    --
+     --url-safe)" || exit $?; fi
?                 +++++++++++
    - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent";
      fi
    - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_SOURCES="${IMG_BASE_SRC}-amd64,${IMG_BASE_SRC}-arm64"
    - export IMG_DESTINATIONS="${CLUSTER_AGENT_REPOSITORY}:${VERSION}"
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - artifacts: false
      job: docker_build_cluster_agent_amd64
    - artifacts: false
      job: docker_build_cluster_agent_arm64
    rules:
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - if: ($DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null) && $BUCKET_BRANCH ==
        "beta" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: ci/datadog-agent/agent-release
        CLUSTER_AGENT_REPOSITORY: ci/datadog-agent/cluster-agent-release
        DSD_REPOSITORY: ci/datadog-agent/dogstatsd-release
        IMG_REGISTRIES: internal-aws-ddbuild
      when: on_success
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_dca
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: rc
deploy_installer_oci
  deploy_installer_oci:
    before_script:
    - ls $OMNIBUS_PACKAGE_DIR
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - installer_oci
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    - if: $DEPLOY_INSTALLER == "true" || $DDR_WORKFLOW_ID != null
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - .gitlab/**/*
        - omnibus/config/**/*
        - pkg/fleet/**/*
        - cmd/installer/**/*
        - test/new-e2e/tests/installer/**/*
        - tasks/installer.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - set +x
-   - export VERSION=$(inv agent.version --url-safe)-1
?    -------
+   - VERSION="$(inv agent.version --url-safe)-1" || exit $?
?             +                                 ++++++++++++
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf
      "https://github.com/DataDog/"
    - go env -w GOPRIVATE="github.com/DataDog/*"
    - export PATH=$PATH:$(go env GOPATH)/bin
    - go install github.com/DataDog/datadog-packages/cmd/datadog-package@latest
    - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:${VERSION}
      ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar
    - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID}
      ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar
    stage: deploy_packages
    tags:
    - arch:amd64
    variables:
      MAJOR_VERSION: 7
      OCI_PRODUCT: datadog-installer
deploy_staging_dsd
  deploy_staging_dsd:
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - build_dogstatsd-binary_x64
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    script:
    - $S3_CP_CMD $S3_ARTIFACTS_URI/dogstatsd/dogstatsd ./dogstatsd
-   - export PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7)
?    -------
+   - PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7) || exit $?
?                                                                      +++++++++++
    - $S3_CP_CMD ./dogstatsd $S3_DSD6_URI/linux/dogstatsd-$PACKAGE_VERSION --grants
      read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=id=3a6e02b08553fd157ae3fb918945dd1eaae5a1aa818940381ef07a430cf25732
    stage: deploy_packages
    tags:
    - arch:amd64
deploy_staging_iot_agent
  deploy_staging_iot_agent:
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - build_iot_agent-binary_x64
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    script:
    - $S3_CP_CMD $S3_ARTIFACTS_URI/iot/agent ./agent
-   - export PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7)
?    -------
+   - PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7) || exit $?
?                                                                      +++++++++++
    - $S3_CP_CMD ./agent $S3_DSD6_URI/linux/iot/agent-$PACKAGE_VERSION --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
      full=id=3a6e02b08553fd157ae3fb918945dd1eaae5a1aa818940381ef07a430cf25732
    stage: deploy_packages
    tags:
    - arch:amd64
installer-amd64-oci
  installer-amd64-oci:
    artifacts:
      expire_in: 2 weeks
      paths:
      - $OMNIBUS_PACKAGE_DIR
    before_script:
+   - AGENT_VERSION="$(inv agent.version -u)-1" || exit $?
-   - export INSTALL_DIR=/opt/datadog-packages/datadog-installer/$(inv agent.version
?                                                                 ^^^^^^^^^^^^^^^^^^
+   - export INSTALL_DIR=/opt/datadog-packages/datadog-installer/"$AGENT_VERSION"
?                                                                + ^^^^^^^^^^^^^^
-     -u)-1
    - export INSTALL_DIR_PARAM="--install-directory=$INSTALL_DIR"
    cache:
    - key:
        files:
        - omnibus/Gemfile
        - release.json
        prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION-$OMNIBUS_SOFTWARE
      paths:
      - omnibus/vendor/bundle
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - go_mod_tidy_check
    - go_deps
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.xz
    - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
    - echo "About to build for $RELEASE_VERSION"
    - rm -rf $OMNIBUS_PACKAGE_DIR/*
    - inv -e omnibus.build --release-version "$RELEASE_VERSION" --base-dir $OMNIBUS_BASE_DIR
      ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="installer"
      ${INSTALL_DIR_PARAM}
    - ls -la $OMNIBUS_PACKAGE_DIR
    - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
    stage: package_build
    tags:
    - arch:amd64
    variables:
      AGENT_MAJOR_VERSION: 7
      DESTINATION_FILE: datadog-updater_7-amd64-oci.tar.xz
      KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      PACKAGE_ARCH: amd64
      RELEASE_VERSION: $RELEASE_VERSION_7
installer-arm64-oci
  installer-arm64-oci:
    artifacts:
      expire_in: 2 weeks
      paths:
      - $OMNIBUS_PACKAGE_DIR
    before_script:
+   - AGENT_VERSION="$(inv agent.version -u)-1" || exit $?
-   - export INSTALL_DIR=/opt/datadog-packages/datadog-installer/$(inv agent.version
?                                                                 ^^^^^^^^^^^^^^^^^^
+   - export INSTALL_DIR=/opt/datadog-packages/datadog-installer/"$AGENT_VERSION"
?                                                                + ^^^^^^^^^^^^^^
-     -u)-1
    - export INSTALL_DIR_PARAM="--install-directory=$INSTALL_DIR"
    cache:
    - key:
        files:
        - omnibus/Gemfile
        - release.json
        prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION-$OMNIBUS_SOFTWARE
      paths:
      - omnibus/vendor/bundle
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64$DATADOG_AGENT_ARMBUILDIMAGES_SUFFIX:$DATADOG_AGENT_ARMBUILDIMAGES
    needs:
    - go_mod_tidy_check
    - go_deps
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache.tar.xz
    - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
    - echo "About to build for $RELEASE_VERSION"
    - rm -rf $OMNIBUS_PACKAGE_DIR/*
    - inv -e omnibus.build --release-version "$RELEASE_VERSION" --base-dir $OMNIBUS_BASE_DIR
      ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="installer"
      ${INSTALL_DIR_PARAM}
    - ls -la $OMNIBUS_PACKAGE_DIR
    - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
    stage: package_build
    tags:
    - arch:arm64
    variables:
      AGENT_MAJOR_VERSION: 7
      DESTINATION_FILE: datadog-updater_7-arm64-oci.tar.xz
      KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 16Gi
      PACKAGE_ARCH: arm64
      RELEASE_VERSION: $RELEASE_VERSION_7
installer_oci
  installer_oci:
    artifacts:
      paths:
      - ${OMNIBUS_PACKAGE_DIR}
    before_script:
-   - export PACKAGE_VERSION=$(inv agent.version --url-safe --major-version 7)-1
?    -------
+   - PACKAGE_VERSION="$(inv agent.version --url-safe --major-version 7)-1" || exit
?                     +                                                   +++++++++
+     $?
    - export INSTALL_DIR=/opt/datadog-packages/${OCI_PRODUCT}/${PACKAGE_VERSION}
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs:
    - installer-arm64-oci
    - installer-amd64-oci
    - windows-installer-amd64
    rules:
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - when: on_success
    script:
    - rm -f $OMNIBUS_PACKAGE_DIR/*-dbg-*.tar.xz
    - ls -l $OMNIBUS_PACKAGE_DIR
    - python3 -m pip install -r tasks/libs/requirements-github.txt
    - set +x
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf
      "https://github.com/DataDog/"
    - go env -w GOPRIVATE="github.com/DataDog/*"
    - ${CI_PROJECT_DIR}/tools/ci/retry.sh go install github.com/DataDog/datadog-packages/cmd/datadog-package@latest
    - OUTPUT_DIR="/tmp/oci_output"
    - mkdir -p ${OUTPUT_DIR}
    - ls $OMNIBUS_PACKAGE_DIR
    - "if [ $(ls $OMNIBUS_PACKAGE_DIR/*.oci.tar 2> /dev/null | wc -l) -ge 1 ]; then\n\
      \  echo \"Copying already built images to output dir\"\n  cp $OMNIBUS_PACKAGE_DIR/*.oci.tar\
      \ ${OUTPUT_DIR}\nfi\n"
    - "for ARCH in \"amd64\" \"arm64\"; do\n  INPUT_FILE=\"${OMNIBUS_PACKAGE_DIR}${OCI_PRODUCT}-*${ARCH}.tar.xz\"\
      \n  OUTPUT_FILE=\"$(basename -a -s .xz ${INPUT_FILE})\"\n  MERGED_FILE=$(basename\
      \ -a $OMNIBUS_PACKAGE_DIR/*.tar.xz | head -n 1 | sed \"s/-${ARCH}.tar.xz//\").oci.tar\n\
      \  export MERGED_FILE\n  INPUT_DIR=\"/tmp/input_${ARCH}\"\n  mkdir -p ${INPUT_DIR}\n\
      \  echo \"Generating OCI for $ARCH.\"\n  echo \"Extracting to temporary input\
      \ dir $INPUT_FILE -> $INPUT_DIR\"\n  tar xJf ${INPUT_FILE} -C ${INPUT_DIR}\n \
      \ echo \"Creating OCI layer -> ${OUTPUT_DIR}/${OUTPUT_FILE}\"\n  if [ \"${OCI_PRODUCT}\"\
      \ = \"datadog-agent\" ]; then\n    EXTRA_FLAGS=\"--configs ${INPUT_DIR}/etc/datadog-agent\"\
      \n  fi\n  datadog-package create \\\n    --version ${PACKAGE_VERSION} \\\n   \
      \ --package ${OCI_PRODUCT} \\\n    --os linux \\\n    --arch ${ARCH} \\\n    --archive\
      \ --archive-path \"${OUTPUT_DIR}/${OUTPUT_FILE}\" \\\n    ${EXTRA_FLAGS} \\\n\
      \    ${INPUT_DIR}/${INSTALL_DIR}/\n  rm -f ${INPUT_FILE}\ndone\n"
    - echo "Aggregating all layers into one package -> ${MERGED_FILE}"
    - ls -l ${OUTPUT_DIR}/
    - datadog-package merge ${OUTPUT_DIR}/*.tar
    - cp merged.tar ${OMNIBUS_PACKAGE_DIR}/${MERGED_FILE}
    - $S3_CP_CMD merged.tar $S3_ARTIFACTS_URI/${OCI_PRODUCT}_7_oci.tar
    stage: packaging
    tags:
    - arch:amd64
    variables:
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
      OCI_PRODUCT: datadog-installer
new-e2e-installer-windows
  new-e2e-installer-windows:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export CURRENT_AGENT_VERSION=$(invoke agent.version --major-version 7)
?    -------
+   - CURRENT_AGENT_VERSION=$(invoke agent.version --major-version 7) || exit $?; export
?                                                                    +++++++++++++++++++
+     CURRENT_AGENT_VERSION
    - export STABLE_AGENT_VERSION_PACKAGE=$(curl -sS https://hub.docker.com/v2/namespaces/datadog/repositories/agent-package/tags
      | jq -r '.results[] | .name' | sort | tail -n 2 | head -n 1)
    - export STABLE_INSTALLER_VERSION_PACKAGE=$(curl -sS https://hub.docker.com/v2/namespaces/datadog/repositories/installer-package/tags
      | jq -r '.results[] | .name' | sort | tail -n 2 | head -n 1)
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a7
    - qa_installer_oci
    - qa_agent_oci
    rules:
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - .gitlab/**/*
        - omnibus/config/**/*
        - pkg/fleet/**/*
        - cmd/installer/**/*
        - test/new-e2e/tests/installer/**/*
        - tasks/installer.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e
    tags:
    - arch:amd64
    variables:
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      FLEET_INSTALL_METHOD: windows
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/installer
      TEAM: fleet
new-e2e-windows-agent-domain-tests-a7-x86_64
  new-e2e-windows-agent-domain-tests-a7-x86_64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a7
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - tools/windows/DatadogAgentInstaller/**/*
        - .gitlab/e2e_install_packages/windows.yml
        - test/new-e2e/tests/windows/install-test/**/*
        - test/new-e2e/tests/windows/domain-test/**/*
        - tasks/msi.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e_install_packages
    tags:
    - arch:amd64
    timeout: 1h15
    variables:
      AGENT_MAJOR_VERSION: 7
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/domain-test
      TEAM: windows-agent
      WINDOWS_AGENT_ARCH: x86_64
new-e2e-windows-agent-msi-upgrade-windows-server-a7-x86_64
  new-e2e-windows-agent-msi-upgrade-windows-server-a7-x86_64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a7
    rules:
    - if: $CI_COMMIT_BRANCH == "main"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - changes:
        compare_to: main
        paths:
        - tools/windows/DatadogAgentInstaller/**/*
        - .gitlab/e2e_install_packages/windows.yml
        - test/new-e2e/tests/windows/install-test/**/*
        - test/new-e2e/tests/windows/domain-test/**/*
        - tasks/msi.py
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: ($CI_COMMIT_BRANCH == "main"  || $DEPLOY_AGENT == "true" || $RUN_E2E_TESTS
        == "on" || $DDR_WORKFLOW_ID != null) && $RUN_E2E_TESTS != "off"
    - if: $RUN_E2E_TESTS == "auto"
      variables:
        E2E_OSVERS: $E2E_BRANCH_OSVERS
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
      when: never
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e_install_packages
    tags:
    - arch:amd64
    variables:
      AGENT_MAJOR_VERSION: 7
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_MSI_TEST: TestUpgrade
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_PARAMS: --run "$E2E_MSI_TEST$"
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/install-test
      TEAM: windows-agent
      WINDOWS_AGENT_ARCH: x86_64
new-e2e-windows-agent-msi-windows-server-a6-x86_64
  new-e2e-windows-agent-msi-windows-server-a6-x86_64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a6
    parallel:
      matrix:
      - E2E_MSI_TEST: TestInstall
      - E2E_MSI_TEST: TestRepair
      - E2E_MSI_TEST: TestUpgrade
      - E2E_MSI_TEST: TestUpgradeRollback
      - E2E_MSI_TEST: TestUpgradeRollbackWithoutCWS
      - E2E_MSI_TEST: TestUpgradeChangeUser
      - E2E_MSI_TEST: TestUpgradeFromV5
      - E2E_MSI_TEST: TestAgentUser/user_only
      - E2E_MSI_TEST: TestAgentUser/dotslash_user
      - E2E_MSI_TEST: TestAgentUser/hostname_user
      - E2E_MSI_TEST: TestAgentUser/LocalSystem
      - E2E_MSI_TEST: TestAgentUser/SYSTEM
      - E2E_MSI_TEST: TestInstallOpts
      - E2E_MSI_TEST: TestSubServicesOpts/all-subservices
      - E2E_MSI_TEST: TestSubServicesOpts/no-subservices
      - E2E_MSI_TEST: TestInstallAltDir
      - E2E_MSI_TEST: TestInstallExistingAltDir
      - E2E_MSI_TEST: TestInstallAltDirAndCorruptForUninstall
      - E2E_MSI_TEST: TestInstallFail
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - tools/windows/DatadogAgentInstaller/**/*
        - .gitlab/e2e_install_packages/windows.yml
        - test/new-e2e/tests/windows/install-test/**/*
        - test/new-e2e/tests/windows/domain-test/**/*
        - tasks/msi.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e_install_packages
    tags:
    - arch:amd64
    variables:
      AGENT_MAJOR_VERSION: 6
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_PARAMS: --run "$E2E_MSI_TEST$"
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/install-test
      TEAM: windows-agent
      WINDOWS_AGENT_ARCH: x86_64
new-e2e-windows-agent-msi-windows-server-a7-x86_64
  new-e2e-windows-agent-msi-windows-server-a7-x86_64:
    after_script:
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
      - $E2E_OUTPUT_DIR
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
-   - export WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
?    -------
+   - WINDOWS_AGENT_VERSION=$(invoke agent.version --major-version $AGENT_MAJOR_VERSION)
+     || exit $?; export WINDOWS_AGENT_VERSION
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_PROFILE >> ~/.aws/config ||
      exit $?
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SSH_PUBLIC_KEY_RSA > $E2E_PUBLIC_KEY_PATH
      || exit $?
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
      $SSH_KEY_RSA > $E2E_PRIVATE_KEY_PATH || exit $?
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_ID)
      || exit $?; export ARM_CLIENT_ID
    - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_CLIENT_SECRET)
      || exit $?; export ARM_CLIENT_SECRET
    - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_TENANT_ID)
      || exit $?; export ARM_TENANT_ID
    - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_AZURE_SUBSCRIPTION_ID)
      || exit $?; export ARM_SUBSCRIPTION_ID
    - GOOGLE_CREDENTIALS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_GCP_CREDENTIALS)
      || exit $?; export GOOGLE_CREDENTIALS
    - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
    needs:
    - go_e2e_deps
    - deploy_windows_testing-a7
    parallel:
      matrix:
      - E2E_MSI_TEST: TestInstall
      - E2E_MSI_TEST: TestRepair
      - E2E_MSI_TEST: TestUpgrade
      - E2E_MSI_TEST: TestUpgradeRollback
      - E2E_MSI_TEST: TestUpgradeRollbackWithoutCWS
      - E2E_MSI_TEST: TestUpgradeChangeUser
      - E2E_MSI_TEST: TestUpgradeFromV5
      - E2E_MSI_TEST: TestAgentUser/user_only
      - E2E_MSI_TEST: TestAgentUser/dotslash_user
      - E2E_MSI_TEST: TestAgentUser/hostname_user
      - E2E_MSI_TEST: TestAgentUser/LocalSystem
      - E2E_MSI_TEST: TestAgentUser/SYSTEM
      - E2E_MSI_TEST: TestInstallOpts
      - E2E_MSI_TEST: TestSubServicesOpts/all-subservices
      - E2E_MSI_TEST: TestSubServicesOpts/no-subservices
      - E2E_MSI_TEST: TestInstallAltDir
      - E2E_MSI_TEST: TestInstallExistingAltDir
      - E2E_MSI_TEST: TestInstallAltDirAndCorruptForUninstall
      - E2E_MSI_TEST: TestInstallFail
      - E2E_MSI_TEST: TestNPMUpgradeToNPM
      - E2E_MSI_TEST: TestNPMUpgradeNPMToNPM
      - E2E_MSI_TEST: TestNPMInstallWithAddLocal
      - E2E_MSI_TEST: TestNPMUpgradeFromBeta
      - E2E_MSI_TEST: TestUpgradeFromV6
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    - if: $RUN_E2E_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - if: $RUN_E2E_TESTS == "on"
      when: on_success
    - if: $CI_COMMIT_BRANCH == "main"
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      when: on_success
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      when: on_success
    - changes:
        compare_to: main
        paths:
        - test/new-e2e/pkg/**/*
        - test/new-e2e/go.mod
    - changes:
        compare_to: main
        paths:
        - tools/windows/DatadogAgentInstaller/**/*
        - .gitlab/e2e_install_packages/windows.yml
        - test/new-e2e/tests/windows/install-test/**/*
        - test/new-e2e/tests/windows/domain-test/**/*
        - tasks/msi.py
      when: on_success
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
    - allow_failure: true
      when: manual
    script:
    - export LAST_STABLE_VERSION=$(invoke release.get-release-json-value "last_stable::$AGENT_MAJOR_VERSION")
    - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com
      -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password)
      --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    stage: e2e_install_packages
    tags:
    - arch:amd64
    timeout: 1h15m
    variables:
      AGENT_MAJOR_VERSION: 7
      E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
      E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
      E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
      E2E_PIPELINE_ID: $CI_PIPELINE_ID
      E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
      E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
      EXTRA_PARAMS: --run "$E2E_MSI_TEST$"
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/windows/install-test
      TEAM: windows-agent
      WINDOWS_AGENT_ARCH: x86_64
notify-slack
  notify-slack:
    image: registry.ddbuild.io/slack-notifier:v27936653-9a2a7db-sdm-gbi-jammy@sha256:c9d1145319d1904fa72ea97904a15200d3cb684324723f9e1700bc02cc85065c
    needs:
    - internal_kubernetes_deploy_experimental
    rules:
    - if: $FORCE_K8S_DEPLOYMENT == "true"
      when: always
    - if: $CI_COMMIT_BRANCH != "main"
      when: never
    - if: $DDR != "true"
      when: never
    - if: $APPS !~ "/^datadog-agent/"
      when: never
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    script:
    - export SDM_JWT=$(vault read -field=token identity/oidc/token/sdm)
    - python3 -m pip install -r tasks/requirements.txt
-   - inv pipeline.changelog ${CI_COMMIT_SHORT_SHA}
+   - inv pipeline.changelog ${CI_COMMIT_SHORT_SHA} || exit $?
?                                                  +++++++++++
    stage: internal_kubernetes_deploy
    tags:
    - arch:amd64
setup_agent_version
  setup_agent_version:
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    needs: []
    script:
-   - inv -e agent.version --cache-version
+   - inv -e agent.version --cache-version || exit $?
?                                         +++++++++++
    - $S3_CP_CMD $CI_PROJECT_DIR/agent-version.cache $S3_ARTIFACTS_URI/agent-version.cache
    stage: setup
    tags:
    - arch:amd64
trigger_auto_staging_release
  trigger_auto_staging_release:
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $DDR == "true"
      when: never
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    script:
-   - export RELEASE_VERSION=$(inv agent.version --major-version 7 --url-safe --omnibus-format)-1
?    -------
+   - RELEASE_VERSION="$(inv agent.version --major-version 7 --url-safe --omnibus-format)-1"
?                     +                                                                    +
+     || exit $?
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - inv pipeline.trigger-child-pipeline --project-name "DataDog/agent-release-management"
      --git-ref "main" --variable ACTION --variable AUTO_RELEASE --variable BUILD_PIPELINE_ID
      --variable RELEASE_PRODUCT --variable RELEASE_VERSION --variable TARGET_REPO --variable
      TARGET_REPO_BRANCH $NO_FOLLOW
    stage: trigger_release
    tags:
    - arch:amd64
    variables:
      ACTION: promote
      AUTO_RELEASE: 'true'
      BUILD_PIPELINE_ID: $CI_PIPELINE_ID
      RELEASE_PRODUCT: datadog-agent
      TARGET_REPO: staging
      TARGET_REPO_BRANCH: $BUCKET_BRANCH
trigger_manual_prod_release
  trigger_manual_prod_release:
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      when: never
    - if: $DEPLOY_AGENT != "true" && $DDR_WORKFLOW_ID == null
      when: never
    - allow_failure: true
      if: $BUCKET_BRANCH != "stable"
      when: manual
    - when: on_success
    script:
-   - export RELEASE_VERSION=$(inv agent.version --major-version 7 --url-safe --omnibus-format)-1
?    -------
+   - RELEASE_VERSION="$(inv agent.version --major-version 7 --url-safe --omnibus-format)-1"
?                     +                                                                    +
+     || exit $?
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - inv pipeline.trigger-child-pipeline --project-name "DataDog/agent-release-management"
      --git-ref "main" --variable ACTION --variable AUTO_RELEASE --variable BUILD_PIPELINE_ID
      --variable RELEASE_PRODUCT --variable RELEASE_VERSION --variable TARGET_REPO --variable
      TARGET_REPO_BRANCH $NO_FOLLOW
    stage: trigger_release
    tags:
    - arch:amd64
    variables:
      ACTION: promote
      AUTO_RELEASE: 'false'
      BUILD_PIPELINE_ID: $CI_PIPELINE_ID
      NO_FOLLOW: --no-follow
      RELEASE_PRODUCT: datadog-agent
      TARGET_REPO: prod
      TARGET_REPO_BRANCH: $BUCKET_BRANCH

Changes Summary

Removed Modified Added Renamed
0 40 0 0

Updated: .gitlab/deploy_containers/deploy_containers_a7.yml

Modified Jobs

.deploy_containers-a7-base
  .deploy_containers-a7-base:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7${JMX}-amd64,${IMG_BASE_SRC}-7${JMX}-arm64"
    - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7${JMX}-win1809${FLAVOR}-amd64,${IMG_BASE_SRC}-7${JMX}-winltsc2022${FLAVOR}-amd64"
    - if [[ "$FLAVOR" == "-linux" ]]; then export IMG_SOURCES="${IMG_LINUX_SOURCES}";
      elif [[ "$FLAVOR" == "-servercore" ]]; then export IMG_SOURCES="${IMG_WINDOWS_SOURCES}";
      else export IMG_SOURCES="${IMG_LINUX_SOURCES},${IMG_WINDOWS_SOURCES}"; fi
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${FLAVOR}${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
.deploy_containers-a7_external
  .deploy_containers-a7_external:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7${JMX}-amd64,${IMG_BASE_SRC}-7${JMX}-arm64"
    - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7${JMX}-win1809${FLAVOR}-amd64,${IMG_BASE_SRC}-7${JMX}-winltsc2022${FLAVOR}-amd64"
    - if [[ "$FLAVOR" == "-linux" ]]; then export IMG_SOURCES="${IMG_LINUX_SOURCES}";
      elif [[ "$FLAVOR" == "-servercore" ]]; then export IMG_SOURCES="${IMG_WINDOWS_SOURCES}";
      else export IMG_SOURCES="${IMG_LINUX_SOURCES},${IMG_WINDOWS_SOURCES}"; fi
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${FLAVOR}${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    parallel:
      matrix:
      - FLAVOR:
        - ''
        - -servercore
        - -linux
        JMX:
        - ''
        - -jmx
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-a7
  deploy_containers-a7:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7${JMX}-amd64,${IMG_BASE_SRC}-7${JMX}-arm64"
    - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7${JMX}-win1809${FLAVOR}-amd64,${IMG_BASE_SRC}-7${JMX}-winltsc2022${FLAVOR}-amd64"
    - if [[ "$FLAVOR" == "-linux" ]]; then export IMG_SOURCES="${IMG_LINUX_SOURCES}";
      elif [[ "$FLAVOR" == "-servercore" ]]; then export IMG_SOURCES="${IMG_WINDOWS_SOURCES}";
      else export IMG_SOURCES="${IMG_LINUX_SOURCES},${IMG_WINDOWS_SOURCES}"; fi
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${FLAVOR}${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    parallel:
      matrix:
      - FLAVOR:
        - ''
        - -servercore
        - -linux
        JMX:
        - ''
        - -jmx
    rules:
    - allow_failure: true
      if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      variables:
        AGENT_REPOSITORY: agent-dev
        DSD_REPOSITORY: dogstatsd-dev
        IMG_REGISTRIES: dev
      when: manual
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/ && $FORCE_MANUAL !=
        "true"
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    - allow_failure: true
      if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/ && $FORCE_MANUAL ==
        "true"
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-a7-rc
  deploy_containers-a7-rc:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7${JMX}-amd64,${IMG_BASE_SRC}-7${JMX}-arm64"
    - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7${JMX}-win1809${FLAVOR}-amd64,${IMG_BASE_SRC}-7${JMX}-winltsc2022${FLAVOR}-amd64"
    - if [[ "$FLAVOR" == "-linux" ]]; then export IMG_SOURCES="${IMG_LINUX_SOURCES}";
      elif [[ "$FLAVOR" == "-servercore" ]]; then export IMG_SOURCES="${IMG_WINDOWS_SOURCES}";
      else export IMG_SOURCES="${IMG_LINUX_SOURCES},${IMG_WINDOWS_SOURCES}"; fi
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${FLAVOR}${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    parallel:
      matrix:
      - FLAVOR:
        - ''
        - -servercore
        - -linux
        JMX:
        - ''
        - -jmx
    rules:
    - allow_failure: true
      if: $FORCE_MANUAL == "true" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: 7-rc
deploy_containers-a7_internal
  deploy_containers-a7_internal:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7${JMX}-amd64,${IMG_BASE_SRC}-7${JMX}-arm64"
    - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7${JMX}-win1809${FLAVOR}-amd64,${IMG_BASE_SRC}-7${JMX}-winltsc2022${FLAVOR}-amd64"
    - if [[ "$FLAVOR" == "-linux" ]]; then export IMG_SOURCES="${IMG_LINUX_SOURCES}";
      elif [[ "$FLAVOR" == "-servercore" ]]; then export IMG_SOURCES="${IMG_WINDOWS_SOURCES}";
      else export IMG_SOURCES="${IMG_LINUX_SOURCES},${IMG_WINDOWS_SOURCES}"; fi
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${FLAVOR}${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - if: $BUCKET_BRANCH == "beta"
      when: never
    - if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      when: never
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: ci/datadog-agent/agent-release
        CLUSTER_AGENT_REPOSITORY: ci/datadog-agent/cluster-agent-release
        CWS_INSTRUMENTATION_REPOSITORY: ci/datadog-agent/cws-instrumentation-release
        DSD_REPOSITORY: ci/datadog-agent/dogstatsd-release
        IMG_REGISTRIES: internal-aws-ddbuild
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      JMX: -jmx
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-a7_internal-rc
  deploy_containers-a7_internal-rc:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
    - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7${JMX}-amd64,${IMG_BASE_SRC}-7${JMX}-arm64"
    - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7${JMX}-win1809${FLAVOR}-amd64,${IMG_BASE_SRC}-7${JMX}-winltsc2022${FLAVOR}-amd64"
    - if [[ "$FLAVOR" == "-linux" ]]; then export IMG_SOURCES="${IMG_LINUX_SOURCES}";
      elif [[ "$FLAVOR" == "-servercore" ]]; then export IMG_SOURCES="${IMG_WINDOWS_SOURCES}";
      else export IMG_SOURCES="${IMG_LINUX_SOURCES},${IMG_WINDOWS_SOURCES}"; fi
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${FLAVOR}${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - allow_failure: true
      if: $FORCE_MANUAL == "true" && $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: ci/datadog-agent/agent-release
        CLUSTER_AGENT_REPOSITORY: ci/datadog-agent/cluster-agent-release
        CWS_INSTRUMENTATION_REPOSITORY: ci/datadog-agent/cws-instrumentation-release
        DSD_REPOSITORY: ci/datadog-agent/dogstatsd-release
        IMG_REGISTRIES: internal-aws-ddbuild
      when: manual
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
      variables:
        AGENT_REPOSITORY: ci/datadog-agent/agent-release
        CLUSTER_AGENT_REPOSITORY: ci/datadog-agent/cluster-agent-release
        CWS_INSTRUMENTATION_REPOSITORY: ci/datadog-agent/cws-instrumentation-release
        DSD_REPOSITORY: ci/datadog-agent/dogstatsd-release
        IMG_REGISTRIES: internal-aws-ddbuild
      when: on_success
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
      VERSION: 7-rc
deploy_containers-dogstatsd
  deploy_containers-dogstatsd:
    before_script:
-   - export VERSION="$(inv agent.version --major-version 7 --url-safe --pipeline-id
?    -------
+   - VERSION="$(inv agent.version --major-version 7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"
?                                                                            ++++++++++++++++++++++
-     $PARENT_PIPELINE_ID)"
+     || exit $?
    - 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}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    rules:
    - allow_failure: true
      if: $BUCKET_BRANCH != "beta" && $BUCKET_BRANCH != "stable"
      variables:
        AGENT_REPOSITORY: agent-dev
        DSD_REPOSITORY: dogstatsd-dev
        IMG_REGISTRIES: dev
      when: manual
    - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/ && $FORCE_MANUAL !=
        "true"
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: on_success
    - allow_failure: true
      if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/ && $FORCE_MANUAL ==
        "true"
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    - allow_failure: true
      variables:
        AGENT_REPOSITORY: agent
        DSD_REPOSITORY: dogstatsd
        IMG_REGISTRIES: public
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd
deploy_containers-ot
  deploy_containers-ot:
    before_script:
-   - if [[ "$VERSION" == "" ]]; then export VERSION="$(inv agent.version --major-version
?                                    -------
+   - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --major-version 7
?                                                                                 ++
-     7 --url-safe --pipeline-id $PARENT_PIPELINE_ID)"; fi
?    --
+     --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi
?                                                   +++++++++++
    - export IMG_SOURCES="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-ot-beta${JMX}-amd64,${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-ot-beta${JMX}-arm64"
    - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}-ot-beta${JMX}"
    dependencies: []
    image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
    parallel:
      matrix:
      - JMX:
        - ''
        - -jmx
    rules:
    - allow_failure: true
      when: manual
    script:
    - GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_SCHEDULER_TOKEN)
      || exit $?; export GITLAB_TOKEN
    - "if [[ \"$BUCKET_BRANCH\" == \"nightly\" && ( \"$IMG_SOURCES\" =~ \"$SRC_AGENT\"\
      \ || \"$IMG_SOURCES\" =~ \"$SRC_DCA\" || \"$IMG_SOURCES\" =~ \"$SRC_CWS_INSTRUMENTATION\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_AGENT\" || \"$IMG_VARIABLES\" =~ \"$SRC_DCA\"\
      \ || \"$IMG_VARIABLES\" =~ \"$SRC_CWS_INSTRUMENTATION\" ) ]]; then\n  export ECR_RELEASE_SUFFIX=\"\
      -nightly\"\nelse\n  export ECR_RELEASE_SUFFIX=\"${CI_COMMIT_TAG+-release}\"\n\
      fi\n"
    - IMG_VARIABLES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_VARIABLES")"
    - IMG_SOURCES="$(sed -E "s#(${SRC_AGENT}|${SRC_DSD}|${SRC_DCA}|${SRC_CWS_INSTRUMENTATION})#\1${ECR_RELEASE_SUFFIX}#g"
      <<<"$IMG_SOURCES")"
    - inv pipeline.trigger-child-pipeline --project-name DataDog/public-images --git-ref
      main --timeout 1800 --variable IMG_VARIABLES --variable IMG_REGISTRIES --variable
      IMG_SOURCES --variable IMG_DESTINATIONS --variable IMG_SIGNING --variable APPS
      --variable BAZEL_TARGET --variable DDR --variable DDR_WORKFLOW_ID --variable TARGET_ENV
      --variable DYNAMIC_BUILD_RENDER_TARGET_FORWARD_PARAMETERS
    stage: deploy_containers
    tags:
    - arch:amd64
    variables:
      AGENT_REPOSITORY: agent
      IMG_REGISTRIES: public
      IMG_SIGNING: ''
      IMG_VARIABLES: ''
      SRC_AGENT: registry.ddbuild.io/ci/datadog-agent/agent
      SRC_CWS_INSTRUMENTATION: registry.ddbuild.io/ci/datadog-agent/cws-instrumentation
      SRC_DCA: registry.ddbuild.io/ci/datadog-agent/cluster-agent
      SRC_DSD: registry.ddbuild.io/ci/datadog-agent/dogstatsd

Changes Summary

Removed Modified Added Renamed
0 8 0 0

ℹ️ Diff available in the job log.

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Sep 24, 2024

[Fast Unit Tests Report]

On pipeline 45107110 (CI Visibility). The following jobs did not run any unit tests:

Jobs:
  • tests_deb-arm64-py3
  • tests_deb-x64-py3
  • tests_flavor_dogstatsd_deb-x64
  • tests_flavor_heroku_deb-x64
  • tests_flavor_iot_deb-x64
  • tests_rpm-arm64-py3
  • tests_rpm-x64-py3
  • tests_windows-x64

If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-devx-help

@pr-commenter
Copy link

pr-commenter bot commented Sep 24, 2024

Regression Detector

Regression Detector Results

Run ID: 38d0d2be-eb46-4e51-825e-4ecd48247d4d Metrics dashboard Target profiles

Baseline: 42db7b3
Comparison: 493de91

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
pycheck_lots_of_tags % cpu utilization +0.69 [-1.89, +3.27] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.54 [+0.49, +0.59] 1 Logs
idle memory utilization +0.36 [+0.31, +0.41] 1 Logs
file_tree memory utilization +0.35 [+0.27, +0.44] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.11 [-0.64, +0.86] 1 Logs
otel_to_otel_logs ingress throughput +0.02 [-0.78, +0.83] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.02 [-0.09, +0.05] 1 Logs
basic_py_check % cpu utilization -0.11 [-2.90, +2.68] 1 Logs

Bounds Checks

perf experiment bounds_check_name replicates_passed
idle memory_usage 10/10

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Copy link
Member

@amenasria amenasria left a comment

Choose a reason for hiding this comment

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

LGTM!

@chouetz
Copy link
Member Author

chouetz commented Sep 26, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Sep 26, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 23m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 1dc0946 into main Sep 26, 2024
274 checks passed
@dd-mergequeue dd-mergequeue bot deleted the nschweitzer/aws_cp branch September 26, 2024 08:04
@github-actions github-actions bot added this to the 7.59.0 milestone Sep 26, 2024
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 Skip QA week as there is no code change in Agent code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants