Skip to content

Commit

Permalink
Merge branch 'main' into simont1/root-tag-e2e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
knusbaum authored Apr 12, 2024
2 parents 7d42883 + 89a3834 commit 657e8c0
Show file tree
Hide file tree
Showing 228 changed files with 3,047 additions and 2,640 deletions.
1 change: 1 addition & 0 deletions .copyright-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ github.com/GoogleCloudPlatform/docker-credential-gcr: Copyright 2016 Google, Inc
github.com/aws/aws-lambda-go: Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
github.com/aws/aws-sdk-go: ["Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.", "Copyright 2014-2015 Stripe, Inc."]
github.com/aws/aws-sdk-go-v2: ["Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.", "Copyright 2014-2015 Stripe, Inc."]
github.com/awslabs/amazon-ecr-credential-helper/*: "Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved."
github.com/containerd/*: Copyright 2012-2015 Docker, Inc.
github.com/coreos/*: Copyright 2017 CoreOS, Inc
github.com/docker/*: Copyright 2012-2017 Docker, Inc.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Python dependencies
run: pip install -r tasks/requirements.txt
run: pip install -r requirements.txt -r tasks/requirements.txt
- name: Auto assign team label
run: inv -e github.assign-team-label --pr-id='${{ github.event.pull_request.number }}'
fetch-labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/serverless-binary-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
### Steps below only run if size diff > SIZE_ALLOWANCE ###

- name: Install graphviz
uses: ts-graphviz/setup-graphviz@v1
uses: ts-graphviz/setup-graphviz@v2
if: steps.compare.outputs.diff > env.SIZE_ALLOWANCE

- name: Install digraph
Expand Down
62 changes: 45 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ stages:
- pkg_metrics
- packaging
- kitchen_deploy
- e2e_pre_test
- kitchen_testing
- container_build
- container_scan
Expand All @@ -92,6 +91,7 @@ stages:
- choco_deploy
- internal_image_deploy
- install_script_testing
- e2e_pre_test
- e2e
- kitchen_cleanup
- functional_test
Expand Down Expand Up @@ -359,6 +359,15 @@ variables:
.if_mergequeue: &if_mergequeue
if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/

.fakeintake_changes: &fakeintake_changes
changes:
paths:
- "test/fakeintake/**/*"
- .gitlab/binary_build/fakeintake.yml
- .gitlab/container_build/fakeintake.yml
- .gitlab/dev_container_deploy/fakeintake.yml
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916

#
# Workflow rules
# Rules used to define whether a pipeline should run, and with which variables
Expand Down Expand Up @@ -764,6 +773,23 @@ workflow:

# New E2E related rules

.on_e2e_or_fakeintake_changes_or_manual:
- <<: *if_main_branch
- !reference [.except_mergequeue]
- <<: *fakeintake_changes
variables:
FAKEINTAKE_IMAGE_OVERRIDE: "public.ecr.aws/datadog/fakeintake:v$CI_COMMIT_SHORT_SHA"
when: on_success
- changes:
paths:
- test/new-e2e/pkg/**/*
- test/new-e2e/test-infra-definition/*
- test/new-e2e/go.mod
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916
when: on_success
- when: manual
allow_failure: true


.on_e2e_main_release_or_rc: # This rule is used as a base for all new-e2e rules
- <<: *if_disable_e2e_tests
Expand Down Expand Up @@ -994,23 +1020,12 @@ workflow:
- .go-version
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916

.on_fakeintake_changes: &on_fakeintake_changes
changes:
- "test/fakeintake/**/*"
- .gitlab/binary_build/fakeintake.yml
- .gitlab/container_build/fakeintake.yml
- .gitlab/dev_container_deploy/fakeintake.yml

.on_fakeintake_changes_on_main_or_manual:
- <<: *on_fakeintake_changes
if: $CI_COMMIT_BRANCH == "main"
- <<: *on_fakeintake_changes
when: manual
allow_failure: true
.on_fakeintake_changes:
- <<: *fakeintake_changes

.on_fakeintake_changes_on_main:
- <<: *on_fakeintake_changes
if: $CI_COMMIT_BRANCH == "main"
- <<: *fakeintake_changes
<<: *if_main_branch

.fast_on_dev_branch_only:
- <<: *if_main_branch
Expand Down Expand Up @@ -1038,4 +1053,17 @@ workflow:
- .gitlab-ci.yml
- .gitlab/**/*
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916


.on_invoke_tasks_changes:
- <<: *if_main_branch
- changes:
paths:
- tasks/**/*
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916

.on_kitchen_invoke_tasks_changes:
- <<: *if_main_branch
- changes:
paths:
- test/kitchen/tasks/**/*
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916
2 changes: 1 addition & 1 deletion .gitlab/common/test_infra_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ variables:
# and check the job creating the image to make sure you have the right SHA prefix
TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: ""
# Make sure to update test-infra-definitions version in go.mod as well
TEST_INFRA_DEFINITIONS_BUILDIMAGES: e2e7d263e05c
TEST_INFRA_DEFINITIONS_BUILDIMAGES: 4ebac6561266
4 changes: 2 additions & 2 deletions .gitlab/dev_container_deploy/fakeintake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_fakeintake:
stage: dev_container_deploy
rules:
- !reference [.except_mergequeue]
- !reference [.on_fakeintake_changes_on_main_or_manual]
- !reference [.on_fakeintake_changes]
needs:
- job: docker_build_fakeintake
optional: false
Expand All @@ -27,4 +27,4 @@ publish_fakeintake_latest:
IMG_SOURCES: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent/fakeintake:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
IMG_DESTINATIONS: fakeintake:latest
IMG_REGISTRIES: public
IMG_SIGNING: "false"
IMG_SIGNING: "false"
6 changes: 4 additions & 2 deletions .gitlab/e2e_pre_test/e2e_pre_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# Contains jobs which runs e2e tests to validate the new-e2e framework.
e2e_pre_test:
rules:
- !reference [.on_e2e_changes_or_manual]
- !reference [.on_e2e_or_fakeintake_changes_or_manual]
stage: e2e_pre_test
extends: .new_e2e_template
needs: []
needs:
- job: publish_fakeintake
optional: true
script:
- inv -e new-e2e-tests.run --targets ./test-infra-definition --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS}
after_script:
Expand Down
12 changes: 6 additions & 6 deletions .gitlab/package_build/deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- $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 agent.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 ${FLAVOR:+--flavor $FLAVOR}
- 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 ${FLAVOR:+--flavor $FLAVOR}
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog${FLAVOR:+-$FLAVOR}-agent_*_${PACKAGE_ARCH}.deb $S3_ARTIFACTS_URI/$DESTINATION_DEB
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog${FLAVOR:+-$FLAVOR}-agent-dbg_*_${PACKAGE_ARCH}.deb $S3_ARTIFACTS_URI/$DESTINATION_DBG_DEB
Expand Down Expand Up @@ -144,7 +144,7 @@ agent_deb-arm64-a7:
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- !reference [.setup_deb_signing_key]
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agent.omnibus-build --flavor iot --log-level debug --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --flavor iot --log-level debug --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog-iot-agent*_${PACKAGE_ARCH}.deb $S3_ARTIFACTS_URI/$DESTINATION_DEB
- !reference [.upload_sbom_artifacts]
Expand Down Expand Up @@ -218,7 +218,7 @@ dogstatsd_deb-x64:
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- !reference [.setup_deb_signing_key]
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e dogstatsd.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="dogstatsd"
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog-dogstatsd*_amd64.deb $S3_ARTIFACTS_URI/datadog-dogstatsd_amd64.deb
- !reference [.upload_sbom_artifacts]
Expand Down Expand Up @@ -247,7 +247,7 @@ dogstatsd_deb-arm64:
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- !reference [.setup_deb_signing_key]
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e dogstatsd.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="dogstatsd"
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog-dogstatsd*_arm64.deb $S3_ARTIFACTS_URI/datadog-dogstatsd_arm64.deb
- !reference [.upload_sbom_artifacts]
Expand Down Expand Up @@ -275,7 +275,7 @@ agentless_scanner_deb-x64:
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- !reference [.setup_deb_signing_key]
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agentless-scanner.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="agentless-scanner"
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog-agentless-scanner*_amd64.deb $S3_ARTIFACTS_URI/datadog-agentless-scanner_amd64.deb
- !reference [.upload_sbom_artifacts]
Expand All @@ -302,7 +302,7 @@ agentless_scanner_deb-arm64:
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- !reference [.setup_deb_signing_key]
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agentless-scanner.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="agentless-scanner"
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog-agentless-scanner*_arm64.deb $S3_ARTIFACTS_URI/datadog-agentless-scanner_arm64.deb
- !reference [.upload_sbom_artifacts]
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/package_build/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- chmod 0744 /tmp/system-probe/clang-bpf /tmp/system-probe/llc-bpf
# NOTE: for now, we consider "ociru" to be a "redhat_target" in omnibus/lib/ostools.rb
# if we ever start building on a different platform, that might need to change
- inv -e agent.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
- 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
- ls -la $OMNIBUS_PACKAGE_DIR
- !reference [.upload_sbom_artifacts]
variables:
Expand Down Expand Up @@ -94,7 +94,7 @@ datadog-agent-oci-arm64-a7:
- rm -rf $OMNIBUS_PACKAGE_DIR/*
# Artifacts and cache must live within project directory but we run omnibus in a neutral directory.
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- inv -e installer.omnibus-build --release-version "$RELEASE_VERSION" --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- 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"
- ls -la $OMNIBUS_PACKAGE_DIR
- $S3_CP_CMD $OMNIBUS_PACKAGE_DIR/datadog-installer-*-${PACKAGE_ARCH}.tar.xz $S3_ARTIFACTS_URI/$DESTINATION_FILE
- !reference [.upload_sbom_artifacts]
Expand Down
10 changes: 5 additions & 5 deletions .gitlab/package_build/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- $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 agent.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
- 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
- ls -la $OMNIBUS_PACKAGE_DIR
- !reference [.upload_sbom_artifacts]
variables:
Expand Down Expand Up @@ -146,7 +146,7 @@ agent_rpm-arm64-a7:
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $RPM_SIGNING_PASSPHRASE_SSM_NAME)
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agent.omnibus-build --flavor iot --log-level debug --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --flavor iot --log-level debug --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- ls -la $OMNIBUS_PACKAGE_DIR
- !reference [.upload_sbom_artifacts]
variables:
Expand Down Expand Up @@ -216,7 +216,7 @@ dogstatsd_rpm-x64:
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $RPM_SIGNING_PASSPHRASE_SSM_NAME)
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e dogstatsd.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="dogstatsd"
- ls -la $OMNIBUS_PACKAGE_DIR
- !reference [.upload_sbom_artifacts]
artifacts:
Expand Down Expand Up @@ -247,7 +247,7 @@ agentless_scanner_rpm-x64:
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name $RPM_SIGNING_PASSPHRASE_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agentless-scanner.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="agentless-scanner"
- ls -la $OMNIBUS_PACKAGE_DIR
- !reference [.upload_sbom_artifacts]
artifacts:
Expand Down Expand Up @@ -278,7 +278,7 @@ agentless_scanner_rpm-arm64:
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name $RPM_SIGNING_PASSPHRASE_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agentless-scanner.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod"
- inv -e omnibus.build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project="agentless-scanner"
- ls -la $OMNIBUS_PACKAGE_DIR
- !reference [.upload_sbom_artifacts]
artifacts:
Expand Down
Loading

0 comments on commit 657e8c0

Please sign in to comment.