Skip to content

[ABLD-28] Add macOS build for AArch64/ARM64 #37676

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rdesgroppes
Copy link

@rdesgroppes rdesgroppes commented Jun 5, 2025

What does this PR do?

Motivation

Describe how you validated your changes

Possible Drawbacks / Trade-offs

Additional Notes

@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch 4 times, most recently from 65be186 to ec66bb6 Compare June 5, 2025 08:58
@rdesgroppes rdesgroppes changed the title Add macOS build for AArch64/AMD64 Add macOS build for AArch64/ARM64 Jun 5, 2025
@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch from ec66bb6 to de8c275 Compare June 5, 2025 10:01
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jun 5, 2025

Gitlab CI Configuration Changes

Modified Jobs

.lint_macos_gitlab
  .lint_macos_gitlab:
    before_script:
    - export VAULT_ADDR=https://vault.us1.ddbuild.io
    - vault login -method=aws -no-print
    - export AWS_RETRY_MODE=standard
    - export AWS_RETRY_MAX_ATTEMPTS=5
    - 'eval $(gimme $(cat .go-version))
  
      export GOPATH=$GOROOT
  
      '
    - 'export PATH="$(pyenv root)/shims:$PATH"
  
      eval "$(pyenv init -)"
  
      eval "$(pyenv virtualenv-init -)"
  
      '
    - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
      \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
      \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
      \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
      \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
      \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
      \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
      \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
      \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
      Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
      \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
      \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
      \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
      \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
      \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
      fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
      \n"
    - echo "Using Python $PYTHON_VERSION..."
    - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
      \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
      \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
      \ already exists. Skipping creation.\"\nfi\n"
    - pyenv activate $VENV_NAME
    - python3 -m pip install "git+https://github.com/DataDog/datadog-agent-dev.git@v$(cat
      .dda/version)" --break-system-packages
    - pyenv rehash
    - python3 -m dda self dep sync -f legacy-tasks
    - pyenv rehash
    - DD_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2"
      token)" || exit $?; export DD_API_KEY
    - DD_APP_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_APP_KEY_ORG2"
      token)" || exit $?; export DD_APP_KEY
    - "if [ \"$CI_COMMIT_BRANCH\" = \"main\" ] || [[ \"$CI_COMMIT_BRANCH\" =~ ^[0-9]+\\\
      .[0-9]+\\.(x|[0-9]+)$ ]]; then\n  dda inv -- -e macos.report-versions -l all ||\
      \ true\nfi\n"
    - "if [ \"$((RANDOM%20))\" -eq 0 ]; then\n  echo Trying to remove inactive versions\n\
      \  dda inv -- -e macos.remove-inactive-versions -l python -t \"$PYTHON_VERSION\"\
      \ || true\n  dda inv -- -e macos.remove-inactive-versions -l go -t \"$(cat .go-version)\"\
      \ || true\nfi\n"
    - dda inv -- -e rtloader.make
    - dda inv -- -e rtloader.install
    - dda inv -- -e install-tools
    needs:
    - go_deps
    - go_tools_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
      || exit 101
    - rm -f modcache.tar.xz
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_tools.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache_tools.tar.xz
    - dda inv -- -e linter.go --cpus 12 --debug --timeout 60
    stage: lint
.tests_macos_gitlab
  .tests_macos_gitlab:
+   after_script:
+   - export VAULT_ADDR=https://vault.us1.ddbuild.io
+   - vault login -method=aws -no-print
+   - 'export PATH="$(pyenv root)/shims:$PATH"
+ 
+     eval "$(pyenv init -)"
+ 
+     eval "$(pyenv virtualenv-init -)"
+ 
+     '
+   - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
+     \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
+     \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
+     \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
+     \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
+     \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
+     \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
+     \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
+     \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
+     \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
+     Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
+     \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
+     \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
+     \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
+     \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
+     \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
+     \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
+     fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
+     \n"
+   - echo "Using Python $PYTHON_VERSION..."
+   - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
+     \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
+     \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
+     \ already exists. Skipping creation.\"\nfi\n"
+   - pyenv activate $VENV_NAME
+   - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
+   - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
+     $?; export CODECOV_TOKEN
+   - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
    artifacts:
      expire_in: 2 weeks
      paths:
      - $TEST_OUTPUT_FILE
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit: '**/junit-out-*.xml'
      when: always
    before_script:
    - export VAULT_ADDR=https://vault.us1.ddbuild.io
    - vault login -method=aws -no-print
    - export AWS_RETRY_MODE=standard
    - export AWS_RETRY_MAX_ATTEMPTS=5
    - 'eval $(gimme $(cat .go-version))
  
      export GOPATH=$GOROOT
  
      '
    - 'export PATH="$(pyenv root)/shims:$PATH"
  
      eval "$(pyenv init -)"
  
      eval "$(pyenv virtualenv-init -)"
  
      '
    - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
      \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
      \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
      \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
      \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
      \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
      \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
      \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
      \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
      Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
      \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
      \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
      \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
      \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
      \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
      fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
      \n"
    - echo "Using Python $PYTHON_VERSION..."
    - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
      \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
      \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
      \ already exists. Skipping creation.\"\nfi\n"
    - pyenv activate $VENV_NAME
    - python3 -m pip install "git+https://github.com/DataDog/datadog-agent-dev.git@v$(cat
      .dda/version)" --break-system-packages
    - pyenv rehash
    - python3 -m dda self dep sync -f legacy-tasks
    - pyenv rehash
    - DD_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2"
      token)" || exit $?; export DD_API_KEY
    - DD_APP_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_APP_KEY_ORG2"
      token)" || exit $?; export DD_APP_KEY
    - "if [ \"$CI_COMMIT_BRANCH\" = \"main\" ] || [[ \"$CI_COMMIT_BRANCH\" =~ ^[0-9]+\\\
      .[0-9]+\\.(x|[0-9]+)$ ]]; then\n  dda inv -- -e macos.report-versions -l all ||\
      \ true\nfi\n"
    - "if [ \"$((RANDOM%20))\" -eq 0 ]; then\n  echo Trying to remove inactive versions\n\
      \  dda inv -- -e macos.remove-inactive-versions -l python -t \"$PYTHON_VERSION\"\
      \ || true\n  dda inv -- -e macos.remove-inactive-versions -l go -t \"$(cat .go-version)\"\
      \ || true\nfi\n"
    - dda inv -- -e rtloader.make
    - dda inv -- -e rtloader.install
    - dda inv -- -e install-tools
    needs:
    - go_deps
    - go_tools_deps
    rules:
    - if: $RUN_UNIT_TESTS == "off"
      when: never
    - if: $CI_COMMIT_BRANCH == "main"
      variables:
        COVERAGE_CACHE_FLAG: --push-coverage-cache
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_COMMIT_TAG != null
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - if: $RUN_UNIT_TESTS == "on"
      variables:
        COVERAGE_CACHE_FLAG: ''
        FAST_TESTS: 'false'
    - variables:
        COVERAGE_CACHE_FLAG: --pull-coverage-cache
        FAST_TESTS: 'true'
    script:
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache.tar.xz
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_tools.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache_tools.tar.xz
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
    - dda inv -- -e test --rerun-fails=2 --race --profile --cpus 12 --result-json $TEST_OUTPUT_FILE
      --junit-tar "junit-${CI_JOB_NAME}.tgz" $FAST_TESTS_FLAG --test-washer --coverage
    - dda inv -- -e invoke-unit-tests
    stage: source_test
    variables:
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      TEST_OUTPUT_FILE: test_output.json
deploy_packages_dmg-x64-a7
  deploy_packages_dmg-x64-a7:
    before_script:
    - ls $OMNIBUS_PACKAGE_DIR
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$CI_IMAGE_GITLAB_AGENT_DEPLOY_SUFFIX:$CI_IMAGE_GITLAB_AGENT_DEPLOY
    needs:
    - agent_dmg-x64-a7
    rules:
    - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
    script:
    - $S3_CP_CMD --recursive --exclude "*" --include "datadog-agent-7*.dmg" $OMNIBUS_PACKAGE_DIR
-     $S3_RELEASE_ARTIFACTS_URI/dmg/x86_64/
?                                   ^^^ ^^
+     $S3_RELEASE_ARTIFACTS_URI/dmg/$PACKAGE_ARCH/
?                                   ^^^^^^^^ ^^^^
    stage: deploy_packages
    tags:
    - arch:amd64
+   variables:
+     PACKAGE_ARCH: x86_64
lint_macos_gitlab_arm64
  lint_macos_gitlab_arm64:
    before_script:
    - export VAULT_ADDR=https://vault.us1.ddbuild.io
    - vault login -method=aws -no-print
    - export AWS_RETRY_MODE=standard
    - export AWS_RETRY_MAX_ATTEMPTS=5
    - 'eval $(gimme $(cat .go-version))
  
      export GOPATH=$GOROOT
  
      '
    - 'export PATH="$(pyenv root)/shims:$PATH"
  
      eval "$(pyenv init -)"
  
      eval "$(pyenv virtualenv-init -)"
  
      '
    - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
      \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
      \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
      \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
      \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
      \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
      \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
      \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
      \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
      Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
      \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
      \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
      \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
      \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
      \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
      fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
      \n"
    - echo "Using Python $PYTHON_VERSION..."
    - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
      \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
      \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
      \ already exists. Skipping creation.\"\nfi\n"
    - pyenv activate $VENV_NAME
    - python3 -m pip install "git+https://github.com/DataDog/datadog-agent-dev.git@v$(cat
      .dda/version)" --break-system-packages
    - pyenv rehash
    - python3 -m dda self dep sync -f legacy-tasks
    - pyenv rehash
    - DD_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2"
      token)" || exit $?; export DD_API_KEY
    - DD_APP_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_APP_KEY_ORG2"
      token)" || exit $?; export DD_APP_KEY
    - "if [ \"$CI_COMMIT_BRANCH\" = \"main\" ] || [[ \"$CI_COMMIT_BRANCH\" =~ ^[0-9]+\\\
      .[0-9]+\\.(x|[0-9]+)$ ]]; then\n  dda inv -- -e macos.report-versions -l all ||\
      \ true\nfi\n"
    - "if [ \"$((RANDOM%20))\" -eq 0 ]; then\n  echo Trying to remove inactive versions\n\
      \  dda inv -- -e macos.remove-inactive-versions -l python -t \"$PYTHON_VERSION\"\
      \ || true\n  dda inv -- -e macos.remove-inactive-versions -l go -t \"$(cat .go-version)\"\
      \ || true\nfi\n"
    - dda inv -- -e rtloader.make
    - dda inv -- -e rtloader.install
    - dda inv -- -e install-tools
    needs:
    - go_deps
    - go_tools_deps
    rules:
-   - if: $CI_COMMIT_BRANCH == "main"
    - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
      when: never
+   - when: on_success
-   - allow_failure: true
-     when: manual
    script:
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache.tar.xz
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_tools.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache_tools.tar.xz
    - dda inv -- -e linter.go --cpus 12 --debug --timeout 60
    stage: lint
    tags:
    - macos:ventura-arm64
    - specific:true
tests_macos_gitlab_arm64
  tests_macos_gitlab_arm64:
    after_script:
    - export VAULT_ADDR=https://vault.us1.ddbuild.io
    - vault login -method=aws -no-print
    - 'export PATH="$(pyenv root)/shims:$PATH"
  
      eval "$(pyenv init -)"
  
      eval "$(pyenv virtualenv-init -)"
  
      '
    - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
      \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
      \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
      \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
      \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
      \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
      \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
      \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
      \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
      Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
      \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
      \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
      \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
      \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
      \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
      fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
      \n"
    - echo "Using Python $PYTHON_VERSION..."
    - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
      \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
      \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
      \ already exists. Skipping creation.\"\nfi\n"
    - pyenv activate $VENV_NAME
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
      $?; export CODECOV_TOKEN
    - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
    artifacts:
      expire_in: 2 weeks
      paths:
      - $TEST_OUTPUT_FILE
      - junit-*.tgz
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
        junit:
        - '**/junit-out-*.xml'
      when: always
    before_script:
    - export VAULT_ADDR=https://vault.us1.ddbuild.io
    - vault login -method=aws -no-print
    - export AWS_RETRY_MODE=standard
    - export AWS_RETRY_MAX_ATTEMPTS=5
    - 'eval $(gimme $(cat .go-version))
  
      export GOPATH=$GOROOT
  
      '
    - 'export PATH="$(pyenv root)/shims:$PATH"
  
      eval "$(pyenv init -)"
  
      eval "$(pyenv virtualenv-init -)"
  
      '
    - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
      \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
      \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
      \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
      \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
      \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
      \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
      \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
      \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
      Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
      \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
      \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
      \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
      \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
      \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
      \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
      fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
      \n"
    - echo "Using Python $PYTHON_VERSION..."
    - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
      \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
      \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
      \ already exists. Skipping creation.\"\nfi\n"
    - pyenv activate $VENV_NAME
    - python3 -m pip install "git+https://github.com/DataDog/datadog-agent-dev.git@v$(cat
      .dda/version)" --break-system-packages
    - pyenv rehash
    - python3 -m dda self dep sync -f legacy-tasks
    - pyenv rehash
    - DD_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2"
      token)" || exit $?; export DD_API_KEY
    - DD_APP_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_APP_KEY_ORG2"
      token)" || exit $?; export DD_APP_KEY
    - "if [ \"$CI_COMMIT_BRANCH\" = \"main\" ] || [[ \"$CI_COMMIT_BRANCH\" =~ ^[0-9]+\\\
      .[0-9]+\\.(x|[0-9]+)$ ]]; then\n  dda inv -- -e macos.report-versions -l all ||\
      \ true\nfi\n"
    - "if [ \"$((RANDOM%20))\" -eq 0 ]; then\n  echo Trying to remove inactive versions\n\
      \  dda inv -- -e macos.remove-inactive-versions -l python -t \"$PYTHON_VERSION\"\
      \ || true\n  dda inv -- -e macos.remove-inactive-versions -l go -t \"$(cat .go-version)\"\
      \ || true\nfi\n"
    - dda inv -- -e rtloader.make
    - dda inv -- -e rtloader.install
    - dda inv -- -e install-tools
    needs:
    - go_deps
    - go_tools_deps
    rules:
-   - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
+   - if: $RUN_UNIT_TESTS == "off"
      when: never
-   - allow_failure: true
-     when: manual
+   - if: $CI_COMMIT_BRANCH == "main"
+     variables:
+       COVERAGE_CACHE_FLAG: --push-coverage-cache
+       FAST_TESTS: 'false'
+   - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
+     variables:
+       COVERAGE_CACHE_FLAG: ''
+       FAST_TESTS: 'false'
+   - if: $CI_COMMIT_TAG != null
+     variables:
+       COVERAGE_CACHE_FLAG: ''
+       FAST_TESTS: 'false'
+   - if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
+     variables:
+       COVERAGE_CACHE_FLAG: ''
+       FAST_TESTS: 'false'
+   - if: $RUN_UNIT_TESTS == "on"
+     variables:
+       COVERAGE_CACHE_FLAG: ''
+       FAST_TESTS: 'false'
+   - variables:
+       COVERAGE_CACHE_FLAG: --pull-coverage-cache
+       FAST_TESTS: 'true'
    script:
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache.tar.xz
    - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_tools.tar.xz -C $GOPATH/pkg/mod/cache
      || exit 101
    - rm -f modcache_tools.tar.xz
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - FAST_TESTS_FLAG=""
    - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
      fi
    - dda inv -- -e test --rerun-fails=2 --race --profile --cpus 12 --result-json $TEST_OUTPUT_FILE
      --junit-tar "junit-${CI_JOB_NAME}.tgz" $FAST_TESTS_FLAG --test-washer --coverage
    - dda inv -- -e invoke-unit-tests
    stage: source_test
    tags:
    - macos:ventura-arm64
    - specific:true
    variables:
      FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
      TEST_OUTPUT_FILE: test_output.json

Added Jobs

.agent_dmg
.agent_dmg:
  after_script:
  - "if [ \"$SIGN\" = true ]; then\n  security delete-keychain \"build.keychain\"\
    \ || true\nfi\n"
  - sudo umount /Volumes/Agent || true
  artifacts:
    expire_in: 2 weeks
    paths:
    - omnibus/pkg/*.dmg
    - omnibus/pkg/version-manifest.json
  before_script:
  - sudo umount /Volumes/Agent || true
  - rm -rf "$OMNIBUS_GIT_CACHE_DIR" || true
  cache:
  - key:
      files:
      - omnibus/Gemfile
      - release.json
      prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION
    paths:
    - omnibus/vendor/bundle
  needs:
  - go_mod_tidy_check
  rules:
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - changes:
      compare_to: $COMPARE_TO_BRANCH
      paths:
      - comp/core/gui/guiimpl/systray/**/*
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - changes:
      compare_to: $COMPARE_TO_BRANCH
      paths:
      - omnibus/**/*
      - .gitlab-ci.yml
      - release.json
      - .gitlab/package_build/**/*
  - if: $CI_COMMIT_BRANCH == "main"
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
  - if: $CI_COMMIT_BRANCH == "main" || $DEPLOY_AGENT == "true" || $RUN_ALL_BUILDS
      == "true" || $DDR_WORKFLOW_ID != null
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - allow_failure: true
    when: manual
  script:
  - set -eo pipefail
  - export VAULT_ADDR=https://vault.us1.ddbuild.io
  - vault login -method=aws -no-print
  - 'export PATH="$(pyenv root)/shims:$PATH"

    eval "$(pyenv init -)"

    eval "$(pyenv virtualenv-init -)"

    '
  - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
    \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
    \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
    \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
    \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
    \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
    \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
    \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
    \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
    \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
    Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
    \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
    \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
    \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
    \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
    \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
    \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
    fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
    \n"
  - echo "Using Python $PYTHON_VERSION..."
  - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
    \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
    \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
    \ already exists. Skipping creation.\"\nfi\n"
  - pyenv activate $VENV_NAME
  - python3 -m pip install "git+https://github.com/DataDog/datadog-agent-dev.git@v$(cat
    .dda/version)" --break-system-packages
  - pyenv rehash
  - python3 -m dda self dep sync -f legacy-tasks
  - pyenv rehash
  - echo Setting up Go
  - mkdir -p ~/go
  - export GO_VERSION="$(cat .go-version)"
  - eval "$(gimme $GO_VERSION)"
  - export PATH="$PATH:$GOROOT/bin"
  - echo Go version should be $GO_VERSION
  - go version
  - dda inv check-go-version
  - DD_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2"
    token)" || exit $?; export DD_API_KEY
  - DD_APP_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_APP_KEY_ORG2"
    token)" || exit $?; export DD_APP_KEY
  - "if [ \"$CI_COMMIT_BRANCH\" = \"main\" ] || [[ \"$CI_COMMIT_BRANCH\" =~ ^[0-9]+\\\
    .[0-9]+\\.(x|[0-9]+)$ ]]; then\n  dda inv -- -e macos.report-versions -l all ||\
    \ true\nfi\n"
  - "if [ \"$((RANDOM%20))\" -eq 0 ]; then\n  echo Trying to remove inactive versions\n\
    \  dda inv -- -e macos.remove-inactive-versions -l python -t \"$PYTHON_VERSION\"\
    \ || true\n  dda inv -- -e macos.remove-inactive-versions -l go -t \"$(cat .go-version)\"\
    \ || true\nfi\n"
  - sudo bash -c "rm -rf /var/cache/omnibus/src/*" || true
  - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
  - 'export GOMODCACHE=~/gomodcache

    mkdir -p $GOMODCACHE

    '
  - bash .gitlab/package_build/build_agent_dmg.sh
  - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
  stage: package_build
  timeout: 2h
  variables:
    INTEGRATION_WHEELS_CACHE_BUCKET: dd-agent-omnibus
    INTEGRATION_WHEELS_SKIP_CACHE_UPLOAD: true
    KEYCHAIN_NAME: build.keychain
    NOTARIZATION_ATTEMPTS: 3
    NOTARIZATION_TIMEOUT: 15m
    NOTARIZATION_WAIT_TIME: 15s
    S3_OMNIBUS_CACHE_BUCKET: dd-ci-datadog-agent-omnibus-cache-build-stable
    SIGN: true
.deploy_packages_dmg
.deploy_packages_dmg:
  before_script:
  - ls $OMNIBUS_PACKAGE_DIR
  image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$CI_IMAGE_GITLAB_AGENT_DEPLOY_SUFFIX:$CI_IMAGE_GITLAB_AGENT_DEPLOY
  rules:
  - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
  script:
  - $S3_CP_CMD --recursive --exclude "*" --include "datadog-agent-7*.dmg" $OMNIBUS_PACKAGE_DIR
    $S3_RELEASE_ARTIFACTS_URI/dmg/$PACKAGE_ARCH/
  stage: deploy_packages
agent_dmg-arm64-a7
agent_dmg-arm64-a7:
  after_script:
  - "if [ \"$SIGN\" = true ]; then\n  security delete-keychain \"build.keychain\"\
    \ || true\nfi\n"
  - sudo umount /Volumes/Agent || true
  artifacts:
    expire_in: 2 weeks
    paths:
    - omnibus/pkg/*.dmg
    - omnibus/pkg/version-manifest.json
  before_script:
  - sudo umount /Volumes/Agent || true
  - rm -rf "$OMNIBUS_GIT_CACHE_DIR" || true
  cache:
  - key:
      files:
      - omnibus/Gemfile
      - release.json
      prefix: omnibus-deps-$CI_JOB_NAME-$OMNIBUS_RUBY_VERSION
    paths:
    - omnibus/vendor/bundle
  needs:
  - go_mod_tidy_check
  rules:
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - changes:
      compare_to: $COMPARE_TO_BRANCH
      paths:
      - comp/core/gui/guiimpl/systray/**/*
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - changes:
      compare_to: $COMPARE_TO_BRANCH
      paths:
      - omnibus/**/*
      - .gitlab-ci.yml
      - release.json
      - .gitlab/package_build/**/*
  - if: $CI_COMMIT_BRANCH == "main"
  - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
  - if: $CI_COMMIT_BRANCH == "main" || $DEPLOY_AGENT == "true" || $RUN_ALL_BUILDS
      == "true" || $DDR_WORKFLOW_ID != null
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - allow_failure: true
    when: manual
  script:
  - set -eo pipefail
  - export VAULT_ADDR=https://vault.us1.ddbuild.io
  - vault login -method=aws -no-print
  - 'export PATH="$(pyenv root)/shims:$PATH"

    eval "$(pyenv init -)"

    eval "$(pyenv virtualenv-init -)"

    '
  - "if [ -n \"$PYTHON_VERSION\" ]; then\n  # 1. Use PYTHON_VERSION if set\n  if !\
    \ [[ \"$PYTHON_VERSION\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n    echo \"Invalid\
    \ Python version format (should be X.Y.Z): $PYTHON_VERSION\" >& 2\n    exit 1\n\
    \  fi\n  if ! [ -d \"$(pyenv root)/versions/$PYTHON_VERSION\" ]; then\n    echo\
    \ \"Python version $PYTHON_VERSION not found. Installing...\"\n    pyenv install\
    \ \"$PYTHON_VERSION\"\n  fi\nelse\n  # 2. Find appropriate python version from\
    \ major version\n  PYTHON_VERSION=\"$(cat .python-version)\"\n  echo \"Find python\
    \ version matching $PYTHON_VERSION\"\n  PYTHON_VERSION_ESCAPED=\"${PYTHON_VERSION//./\\\
    \\.}\"\n  versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
    \\.[0-9]+$\")\"\n  if [ -n \"$versionmatches\" ]; then\n    # 2.a.\n    echo \"\
    Found already existing python version for $PYTHON_VERSION\"\n  else\n    # 2.b.\n\
    \    echo \"Installing Python $PYTHON_VERSION...\"\n    pyenv install \"$PYTHON_VERSION\"\
    \n    versionmatches=\"$(ls \"$(pyenv root)/versions\" | grep -E \"^${PYTHON_VERSION_ESCAPED}\\\
    \\.[0-9]+$\")\"\n    if [ -z \"$versionmatches\" ]; then\n      echo \"No matching\
    \ Python version found for $PYTHON_VERSION even after installation.\" >& 2\n \
    \     exit 1\n    fi\n  fi\n  # If there are multiple matches, select the latest\
    \ one\n  PYTHON_VERSION=\"$(echo \"$versionmatches\" | sort -V | tail -n 1)\"\n\
    fi\nVENV_NAME=\"datadog-agent-python-$PYTHON_VERSION\"\nVENV_PATH=\"$(pyenv root)/versions/$VENV_NAME\"\
    \n"
  - echo "Using Python $PYTHON_VERSION..."
  - "# Check if the virtual environment directory exists\nif [ ! -d \"$VENV_PATH\"\
    \ ]; then\n  echo \"Creating virtual environment '$VENV_NAME'...\"\n  pyenv virtualenv\
    \ \"$PYTHON_VERSION\" \"$VENV_NAME\"\nelse\n  echo \"Virtual environment '$VENV_NAME'\
    \ already exists. Skipping creation.\"\nfi\n"
  - pyenv activate $VENV_NAME
  - python3 -m pip install "git+https://github.com/DataDog/datadog-agent-dev.git@v$(cat
    .dda/version)" --break-system-packages
  - pyenv rehash
  - python3 -m dda self dep sync -f legacy-tasks
  - pyenv rehash
  - echo Setting up Go
  - mkdir -p ~/go
  - export GO_VERSION="$(cat .go-version)"
  - eval "$(gimme $GO_VERSION)"
  - export PATH="$PATH:$GOROOT/bin"
  - echo Go version should be $GO_VERSION
  - go version
  - dda inv check-go-version
  - DD_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2"
    token)" || exit $?; export DD_API_KEY
  - DD_APP_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_APP_KEY_ORG2"
    token)" || exit $?; export DD_APP_KEY
  - "if [ \"$CI_COMMIT_BRANCH\" = \"main\" ] || [[ \"$CI_COMMIT_BRANCH\" =~ ^[0-9]+\\\
    .[0-9]+\\.(x|[0-9]+)$ ]]; then\n  dda inv -- -e macos.report-versions -l all ||\
    \ true\nfi\n"
  - "if [ \"$((RANDOM%20))\" -eq 0 ]; then\n  echo Trying to remove inactive versions\n\
    \  dda inv -- -e macos.remove-inactive-versions -l python -t \"$PYTHON_VERSION\"\
    \ || true\n  dda inv -- -e macos.remove-inactive-versions -l go -t \"$(cat .go-version)\"\
    \ || true\nfi\n"
  - sudo bash -c "rm -rf /var/cache/omnibus/src/*" || true
  - pushd omnibus && bundle config set --local path 'vendor/bundle' && popd
  - 'export GOMODCACHE=~/gomodcache

    mkdir -p $GOMODCACHE

    '
  - bash .gitlab/package_build/build_agent_dmg.sh
  - $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/version-manifest.json $S3_SBOM_STORAGE_URI/$CI_JOB_NAME/version-manifest.json
  stage: package_build
  tags:
  - macos:ventura-arm64
  - specific:true
  timeout: 2h
  variables:
    INTEGRATION_WHEELS_CACHE_BUCKET: dd-agent-omnibus
    INTEGRATION_WHEELS_SKIP_CACHE_UPLOAD: true
    KEYCHAIN_NAME: build.keychain
    NOTARIZATION_ATTEMPTS: 3
    NOTARIZATION_TIMEOUT: 15m
    NOTARIZATION_WAIT_TIME: 15s
    S3_OMNIBUS_CACHE_BUCKET: dd-ci-datadog-agent-omnibus-cache-build-stable
    SIGN: true
deploy_packages_dmg-arm64-a7
deploy_packages_dmg-arm64-a7:
  before_script:
  - ls $OMNIBUS_PACKAGE_DIR
  image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$CI_IMAGE_GITLAB_AGENT_DEPLOY_SUFFIX:$CI_IMAGE_GITLAB_AGENT_DEPLOY
  needs:
  - agent_dmg-arm64-a7
  rules:
  - if: $DEPLOY_AGENT == "true" || $DDR_WORKFLOW_ID != null
  script:
  - $S3_CP_CMD --recursive --exclude "*" --include "datadog-agent-7*.dmg" $OMNIBUS_PACKAGE_DIR
    $S3_RELEASE_ARTIFACTS_URI/dmg/$PACKAGE_ARCH/
  stage: deploy_packages
  tags:
  - arch:arm64
  variables:
    PACKAGE_ARCH: aarch64

Changes Summary

Removed Modified Added Renamed
0 5 4 0

ℹ️ Diff available in the job log.

@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch 2 times, most recently from be58a55 to f351c7c Compare June 5, 2025 10:24
@rdesgroppes rdesgroppes added the qa/rc-required Only for a PR that requires validation on the Release Candidate label Jun 5, 2025
@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch 2 times, most recently from 54df5a3 to c0e59af Compare June 5, 2025 11:18
@rdesgroppes rdesgroppes changed the title Add macOS build for AArch64/ARM64 [ABLD-28] Add macOS build for AArch64/ARM64 Jun 5, 2025
@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch from c0e59af to 6525223 Compare June 5, 2025 11:59
@github-actions github-actions bot added long review PR is complex, plan time to review it and removed medium review PR review might take time labels Jun 5, 2025
@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch from 6525223 to 6842a0a Compare June 5, 2025 13:29
Copy link

cit-pr-commenter bot commented Jun 5, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 5842b6db-6e51-454d-ae94-f166ce7e1884

Baseline: 1680c19
Comparison: 3c768bb
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
ddot_logs memory utilization +0.26 [+0.14, +0.38] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.05 [-0.57, +0.68] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.05 [-0.57, +0.67] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.03 [-0.55, +0.61] 1 Logs
file_to_blackhole_300ms_latency egress throughput +0.01 [-0.64, +0.66] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.01 [-0.57, +0.58] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.02, +0.02] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.30, +0.29] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.02 [-0.25, +0.22] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.04 [-0.59, +0.52] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.04 [-0.64, +0.56] 1 Logs
otlp_ingest_logs memory utilization -0.09 [-0.22, +0.03] 1 Logs
file_tree memory utilization -0.10 [-0.31, +0.12] 1 Logs
quality_gate_idle memory utilization -0.20 [-0.26, -0.14] 1 Logs bounds checks dashboard
docker_containers_memory memory utilization -0.31 [-0.37, -0.25] 1 Logs
tcp_syslog_to_blackhole ingress throughput -0.34 [-0.40, -0.28] 1 Logs
otlp_ingest_metrics memory utilization -0.44 [-0.61, -0.27] 1 Logs
ddot_metrics memory utilization -0.45 [-0.57, -0.33] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization -0.46 [-1.29, +0.37] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization -0.54 [-0.58, -0.49] 1 Logs
quality_gate_logs % cpu utilization -0.85 [-3.62, +1.93] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization -2.06 [-2.16, -1.96] 1 Logs bounds checks dashboard
docker_containers_cpu % cpu utilization -2.70 [-5.69, +0.30] 1 Logs

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
quality_gate_logs memory_usage 9/10 bounds checks dashboard
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard

Explanation

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

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

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".

CI Pass/Fail Decision

Failed. Some Quality Gates were violated.

  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 9/10 replicas passed. Failed 1 which is > 0. Gate FAILED.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.

@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch from 6842a0a to 6c0838f Compare June 5, 2025 15:03
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jun 5, 2025

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 1680c19

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0.05}$$ $${697.08}$$ < $${697.37}$$ $${+0.02}$$ $${176.1}$$ < $${177.03}$$
agent_deb_amd64_fips $${+0.05}$$ $${695.37}$$ < $${695.59}$$ $${-0.07}$$ $${175.53}$$ < $${176.51}$$
agent_heroku_amd64 $${+0.05}$$ $${358.73}$$ < $${359.67}$$ $${-0.01}$$ $${96.52}$$ < $${97.47}$$
agent_msi $${+0.05}$$ $${958.9}$$ < $${959.86}$$ $${+0.02}$$ $${146.3}$$ < $${147.27}$$
agent_rpm_amd64 $${+0.05}$$ $${697.06}$$ < $${697.36}$$ $${-0.01}$$ $${177.68}$$ < $${178.56}$$
agent_rpm_amd64_fips $${+0.05}$$ $${695.36}$$ < $${695.58}$$ $${-0.02}$$ $${177.53}$$ < $${178.43}$$
agent_rpm_arm64 $${+0.05}$$ $${687.08}$$ < $${687.37}$$ $${-0.02}$$ $${161.1}$$ < $${161.99}$$
agent_rpm_arm64_fips $${+0.05}$$ $${685.49}$$ < $${685.72}$$ $${+0.01}$$ $${160.28}$$ < $${161.11}$$
agent_suse_amd64 $${+0.05}$$ $${697.06}$$ < $${697.36}$$ $${-0.01}$$ $${177.68}$$ < $${178.56}$$
agent_suse_amd64_fips $${+0.05}$$ $${695.36}$$ < $${695.58}$$ $${-0.02}$$ $${177.53}$$ < $${178.43}$$
agent_suse_arm64 $${+0.05}$$ $${687.08}$$ < $${687.37}$$ $${-0.02}$$ $${161.1}$$ < $${161.99}$$
agent_suse_arm64_fips $${+0.05}$$ $${685.49}$$ < $${685.72}$$ $${+0.01}$$ $${160.28}$$ < $${161.11}$$
docker_agent_amd64 $${+0.05}$$ $${780.86}$$ < $${781.16}$$ $${+0.03}$$ $${268.81}$$ < $${269.63}$$
docker_agent_arm64 $${+0.05}$$ $${794.34}$$ < $${794.62}$$ $${-0.01}$$ $${256.13}$$ < $${257.0}$$
docker_agent_jmx_amd64 $${+0.05}$$ $${972.06}$$ < $${972.35}$$ $${+0.02}$$ $${337.78}$$ < $${338.6}$$
docker_agent_jmx_arm64 $${+0.05}$$ $${974.13}$$ < $${974.41}$$ $${+0.03}$$ $${321.1}$$ < $${321.97}$$
docker_agent_windows1809 $${+0.02}$$ $${1486.95}$$ < $${1488.0}$$ $${-0.01}$$ $${488.02}$$ < $${488.95}$$
docker_agent_windows1809_core $${+0.08}$$ $${6217.03}$$ < $${6218.0}$$ $${0}$$ $${2048.0}$$ < $${2049.0}$$
docker_agent_windows1809_core_jmx $${+0.21}$$ $${6338.73}$$ < $${6361.0}$$ $${0}$$ $${2048.0}$$ < $${2049.0}$$
docker_agent_windows1809_jmx $${+0.08}$$ $${1608.7}$$ < $${1609.5}$$ $${-0.09}$$ $${530.32}$$ < $${531.32}$$
docker_agent_windows2022 $${+0.12}$$ $${1506.36}$$ < $${1507.0}$$ $${+0}$$ $${500.75}$$ < $${501.7}$$
docker_agent_windows2022_core $${+0.06}$$ $${6190.36}$$ < $${6311.0}$$ $${0}$$ $${2048.0}$$ < $${2049.0}$$
docker_agent_windows2022_core_jmx $${-0.47}$$ $${6311.51}$$ < $${6313.0}$$ $${0}$$ $${2048.0}$$ < $${2049.0}$$
docker_agent_windows2022_jmx $${-0.05}$$ $${1627.96}$$ < $${1628.16}$$ $${-0.03}$$ $${543.03}$$ < $${543.98}$$
docker_cluster_agent_amd64 $${+0}$$ $${212.85}$$ < $${213.79}$$ $${+0}$$ $${72.38}$$ < $${73.33}$$
docker_cluster_agent_arm64 $${+0}$$ $${228.68}$$ < $${229.64}$$ $${+0}$$ $${68.64}$$ < $${69.6}$$
docker_cws_instrumentation_amd64 $${-0}$$ $${7.08}$$ < $${7.12}$$ $${-0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${-0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${-0}$$ $${39.22}$$ < $${39.57}$$ $${-0}$$ $${15.12}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${-0}$$ $${37.88}$$ < $${38.2}$$ $${-0}$$ $${14.53}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${30.45}$$ < $${31.4}$$ $${-0}$$ $${8.0}$$ < $${8.95}$$
dogstatsd_deb_arm64 $${0}$$ $${29.02}$$ < $${29.97}$$ $${-0}$$ $${6.94}$$ < $${7.89}$$
dogstatsd_rpm_amd64 $${0}$$ $${30.45}$$ < $${31.4}$$ $${-0}$$ $${8.01}$$ < $${8.96}$$
dogstatsd_suse_amd64 $${0}$$ $${30.45}$$ < $${31.4}$$ $${-0}$$ $${8.01}$$ < $${8.96}$$
iot_agent_deb_amd64 $${0}$$ $${50.44}$$ < $${51.38}$$ $${-0}$$ $${12.84}$$ < $${13.79}$$
iot_agent_deb_arm64 $${0}$$ $${47.91}$$ < $${48.85}$$ $${+0}$$ $${11.14}$$ < $${12.09}$$
iot_agent_deb_armhf $${0}$$ $${47.48}$$ < $${48.42}$$ $${-0}$$ $${11.2}$$ < $${12.16}$$
iot_agent_rpm_amd64 $${0}$$ $${50.44}$$ < $${51.38}$$ $${+0}$$ $${12.86}$$ < $${13.81}$$
iot_agent_rpm_arm64 $${0}$$ $${47.91}$$ < $${48.85}$$ $${+0}$$ $${11.16}$$ < $${12.11}$$
iot_agent_suse_amd64 $${0}$$ $${50.44}$$ < $${51.38}$$ $${+0}$$ $${12.86}$$ < $${13.81}$$

@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch 2 times, most recently from d868f69 to 27250f8 Compare June 6, 2025 10:26
@@ -13,7 +13,7 @@
"WINDOWS_DDPROCMON_DRIVER": "release-signed",
"WINDOWS_DDPROCMON_VERSION": "1.2.0",
"WINDOWS_DDPROCMON_SHASUM": "e5525959521254ba8218f64f644ad19cdeb720aa48ee83eb5e402a8d1643e32e",
"INTEGRATIONS_CORE_VERSION": "700e8b093d891d2a4b45ab653bfa9a1d16f2bea2"
"INTEGRATIONS_CORE_VERSION": "regis.desgroppes/macos-aarch64"
Copy link
Author

Choose a reason for hiding this comment

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

to be removed

@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch 4 times, most recently from 1705f74 to ad25fb5 Compare June 17, 2025 07:21
@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch from ad25fb5 to a59e27c Compare June 17, 2025 14:32
@rdesgroppes rdesgroppes force-pushed the regis.desgroppes/macos-aarch64 branch from a59e27c to 3c768bb Compare June 17, 2025 16:17
Copy link
Contributor

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between 1680c19 and b684b23.

tl;dr

Use these benchmarks as an insight tool during development.

  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type.

How do I interpret these charts?

The charts below comes from benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

I need more help

First off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development.

If you would like a hand interpreting the results come chat with us in #serverless-agent in the internal DataDog slack or in #serverless in the public DataDog slack. We're happy to help!

Benchmark stats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
long review PR is complex, plan time to review it qa/rc-required Only for a PR that requires validation on the Release Candidate team/agent-delivery team/agent-devx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant