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

[FA] Split installer gitlab jobs #28654

Merged
merged 4 commits into from
Aug 23, 2024
Merged

[FA] Split installer gitlab jobs #28654

merged 4 commits into from
Aug 23, 2024

Conversation

coignetp
Copy link
Contributor

What does this PR do?

Split the e2e installer jobs depending on the install method

Motivation

We're hitting the limits of all those e2e tests in a single job

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

@coignetp coignetp added qa/no-code-change Skip QA week as there is no code change in Agent code team/fleet-automation changelog/no-changelog labels Aug 22, 2024
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Aug 22, 2024

[Fast Unit Tests Report]

On pipeline 42671883 (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 Aug 22, 2024

Gitlab CI Configuration Changes

Modified Jobs

new-e2e-installer
  new-e2e-installer:
    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)
    - 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 && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod
    - rm -f modcache_e2e.tar.xz
    - mkdir -p ~/.aws
    - $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $AGENT_QA_PROFILE_SSM_NAME >>
      ~/.aws/config
    - export AWS_PROFILE=agent-qa-ci
    - $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $SSH_PUBLIC_KEY_RSA_SSM_NAME >
      $E2E_PUBLIC_KEY_PATH
    - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh
      $SSH_KEY_RSA_SSM_NAME > $E2E_PRIVATE_KEY_PATH
    - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
    - 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_deb_testing-a7_arm64
    - deploy_deb_testing-a7_x64
    - deploy_rpm_testing-a7_arm64
    - deploy_rpm_testing-a7_x64
    - deploy_suse_rpm_testing_arm64-a7
    - deploy_suse_rpm_testing_x64-a7
    - 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: install_script
      KUBERNETES_CPU_REQUEST: 6
      KUBERNETES_MEMORY_LIMIT: 16Gi
      KUBERNETES_MEMORY_REQUEST: 12Gi
      SHOULD_RUN_IN_FLAKES_FINDER: 'true'
      TARGETS: ./tests/installer
      TEAM: fleet

Added Jobs

new-e2e-installer-ansible
new-e2e-installer-ansible:
  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)
  - 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 && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod
  - rm -f modcache_e2e.tar.xz
  - mkdir -p ~/.aws
  - $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $AGENT_QA_PROFILE_SSM_NAME >>
    ~/.aws/config
  - export AWS_PROFILE=agent-qa-ci
  - $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $SSH_PUBLIC_KEY_RSA_SSM_NAME >
    $E2E_PUBLIC_KEY_PATH
  - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh
    $SSH_KEY_RSA_SSM_NAME > $E2E_PRIVATE_KEY_PATH
  - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
  - 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
  - new-e2e-installer
  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: ansible
    KUBERNETES_CPU_REQUEST: 6
    KUBERNETES_MEMORY_LIMIT: 16Gi
    KUBERNETES_MEMORY_REQUEST: 12Gi
    SHOULD_RUN_IN_FLAKES_FINDER: 'true'
    TARGETS: ./tests/installer
    TEAM: fleet

Changes Summary

Removed Modified Added Renamed
0 1 1 0

@pr-commenter
Copy link

pr-commenter bot commented Aug 22, 2024

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv create-vm --pipeline-id=42671883 --os-family=ubuntu

Note: This applies to commit 0afeb84

@pr-commenter
Copy link

pr-commenter bot commented Aug 22, 2024

Regression Detector

Regression Detector Results

Run ID: 2abfdd72-ecf8-46b5-a4f2-bf79627a08ca Metrics dashboard Target profiles

Baseline: c693867
Comparison: 0afeb84

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 links
tcp_syslog_to_blackhole ingress throughput +4.55 [-8.50, +17.60] Logs
basic_py_check % cpu utilization +0.43 [-2.19, +3.06] Logs
otel_to_otel_logs ingress throughput +0.16 [-0.65, +0.97] Logs
idle memory utilization +0.08 [+0.05, +0.11] Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.00, +0.00] Logs
uds_dogstatsd_to_api_cpu % cpu utilization -0.13 [-0.93, +0.67] Logs
file_tree memory utilization -0.27 [-0.34, -0.21] Logs
pycheck_lots_of_tags % cpu utilization -1.04 [-3.54, +1.46] 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".

@coignetp coignetp marked this pull request as ready for review August 22, 2024 15:22
@coignetp coignetp requested review from a team as code owners August 22, 2024 15:22
@coignetp coignetp changed the title [FA] Split gitlab jobs [FA] Split installer gitlab jobs Aug 22, 2024
Copy link
Contributor

@KevinFairise2 KevinFairise2 left a comment

Choose a reason for hiding this comment

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

Small comment but LGTM!

test/new-e2e/tests/installer/all_packages_test.go Outdated Show resolved Hide resolved
@coignetp
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 23, 2024

🚂 MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 23, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 22m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 871c079 into main Aug 23, 2024
206 of 218 checks passed
@dd-mergequeue dd-mergequeue bot deleted the paul/fa-split-jobs branch August 23, 2024 12:39
@github-actions github-actions bot added this to the 7.58.0 milestone Aug 23, 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 team/fleet-automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants