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

Migrate CI to deva #33587

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ jobs:
- run:
name: check go version
command: |
inv -e check-go-version
deva inv -e check-go-version
- run:
name: grab go deps
command: |
inv -e deps
deva inv -e deps
- run:
name: install go tooling
command: |
inv -e install-tools
deva inv -e install-tools
- save_cache:
<<: *save_deps
paths:
Expand All @@ -87,7 +87,7 @@ jobs:
- setup_remote_docker
- run:
name: run integration tests
command: inv -e integration-tests --race --remote-docker
command: deva inv -e integration-tests --race --remote-docker

docker_tests:
<<: *job_template
Expand All @@ -97,10 +97,10 @@ jobs:
- setup_remote_docker
- run:
name: run docker image tests
command: inv -e docker.test
command: deva inv -e docker.test
- run:
name: run docker image integration tests
command: inv -e docker.integration-tests
command: deva inv -e docker.integration-tests

workflows:
version: 2
Expand Down
4 changes: 2 additions & 2 deletions .copyright-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ go.opentelemetry.io/otel/semconv/internal: Copyright The OpenTelemetry Authors
go.opentelemetry.io/otel/semconv/v1.12.0: Copyright The OpenTelemetry Authors
golang.org/x/crypto/chacha20poly1305: Copyright (c) 2009 The Go Authors. All rights reserved

# Not added by inv generate-licenses but spotted by inv-e lint-licenses
# Not added by `deva inv generate-licenses` but spotted by `deva inv -e lint-licenses`
github.com/AdaLogics/go-fuzz-headers: AdamKorcz <[email protected]>|AdamKorcz <[email protected]>|Sebastiaan van Stijn <[email protected]>|AdaLogics <[email protected]>|Kazuyoshi Kato <[email protected]>
github.com/AdamKorcz/go-118-fuzz-build/testing: AdamKorcz <[email protected]>|AdamKorcz <[email protected]>|John Howard <[email protected]>|Kazuyoshi Kato <[email protected]>|Khaled Yakdan <[email protected]>|AdamKorcz <[email protected]>|Sebastiaan van Stijn <[email protected]>
github.com/Microsoft/go-winio/pkg/bindfilter: Copyright (c) 2015 Microsoft
Expand Down Expand Up @@ -389,4 +389,4 @@ github.com/transparency-dev/merkle/proof:
- Copyright 2022 Google LLC. All Rights Reserved.
github.com/transparency-dev/merkle/rfc6962: Copyright 2016 Google LLC. All Rights Reserved.

gopkg.in/go-jose/go-jose.v2: Copyright 2014 Square Inc.
gopkg.in/go-jose/go-jose.v2: Copyright 2014 Square Inc.
1 change: 1 addition & 0 deletions .deva/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.4.3
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
/omnibus/config/software/snmp-traps.rb @DataDog/ndm-core
/omnibus/resources/*/msi/ @DataDog/windows-agent

# The following is managed by `inv lint-components` -- DO NOT EDIT
# The following is managed by `deva inv lint-components` -- DO NOT EDIT
# BEGIN COMPONENTS
/comp @DataDog/agent-runtimes
/comp/agent @DataDog/agent-runtimes
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/install-deva/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Install deva
description: Installs the defined version of deva
inputs:
version:
description: The version of deva to install
required: false
default: ""
features:
description: A space-separated list of features to install
required: false
default: ""

runs:
using: composite
steps:
- name: Set version
id: set-version
run: echo "version=$(cat .deva/version)" >> $GITHUB_OUTPUT
shell: bash

- name: Install deva
uses: DataDog/datadog-agent-dev@5ba7488629dc306a7002cda678ea46db39e54a17
with:
version: ${{ inputs.version || steps.set-version.outputs.version }}
features: ${{ inputs.features }}
4 changes: 2 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ updates:
- dependency-name: github.com/DataDog/datadog-agent/*
# Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly
- dependency-name: golang.org/x/*
# OpenTelemetry collector packages need to be updated with inv rather than dependabot
# OpenTelemetry collector packages need to be updated with `deva inv` rather than dependabot
- dependency-name: go.opentelemetry.io/collector/*
- dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/*
schedule:
Expand Down Expand Up @@ -53,7 +53,7 @@ updates:
- dependency-name: github.com/mailru/easyjson
# Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly
- dependency-name: golang.org/x/*
# OpenTelemetry collector packages need to be updated with inv rather than dependabot
# OpenTelemetry collector packages need to be updated with `deva inv` rather than dependabot
- dependency-name: go.opentelemetry.io/collector/*
- dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/*
schedule:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/assess_permissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ jobs:
python-version-file: .python-version
cache: "pip"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tasks/libs/requirements-github.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks legacy-github

- name: Assess Repository Permissions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_DATADOG_AGENT_BOT_TOKEN: ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }}
run: inv -e github.check-permissions --repo ${{ matrix.value }}
run: deva inv -e github.check-permissions --repo ${{ matrix.value }}
8 changes: 5 additions & 3 deletions .github/workflows/assign_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
auto_assign_issue:
runs-on: ubuntu-latest
container:
container:
image: ghcr.io/datadog/agent-issue-auto-assign:latest
credentials:
username: ${{ github.actor }}
Expand All @@ -22,10 +22,12 @@ jobs:
- name: Install dependencies
# Dependencies are installed at runtime. Otherwise it would create a huge image see https://hub.docker.com/r/pytorch/pytorch/tags
run: |
pip install --upgrade pip && pip install --no-compile --no-cache-dir torch transformers invoke codeowners slack-sdk PyGithub python-gitlab semver
pip install --upgrade pip
pip install --no-compile --no-cache-dir torch transformers datadog-agent-dev=="$(cat .deva/version)"
deva self dep sync -f legacy-tasks
- name: Assign issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_DATADOG_AGENT_BOT_TOKEN : ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }}
run: |
inv -e issue.assign-owner -i ${{ github.event.issue.number }}
deva inv -e issue.assign-owner -i ${{ github.event.issue.number }}
17 changes: 9 additions & 8 deletions .github/workflows/buildimages-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,20 @@ jobs:
# in case it's a Go update PR
go-version: ${{ inputs.go_version }}

- name: Install python dependencies
run: |
python3 -m pip install -r requirements.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks

- name: Get current Go version
id: current_go_version
run: |
echo "GO_VERSION=$(inv go-version)" >> $GITHUB_OUTPUT
echo "GO_VERSION=$(deva inv go-version)" >> $GITHUB_OUTPUT

- name: Get current buildimage tag
id: current_buildimage_tag
run: |
echo "BUILDIMAGE_TAG=$(inv buildimages.get-tag)" >> $GITHUB_OUTPUT
echo "BUILDIMAGE_TAG=$(deva inv buildimages.get-tag)" >> $GITHUB_OUTPUT

- name: Update buildimages IDs and Go version
id: update_build_images
Expand All @@ -96,10 +97,10 @@ jobs:
IMAGES_ID: ${{ inputs.images_id }}
run: |
if [ "$CURRENT_GO_VERSION" = "$INPUT_GO_VERSION" ]; then
inv -e buildimages.update --tag "$IMAGES_ID" "$TEST_VERSION_FLAG"
deva inv -e buildimages.update --tag "$IMAGES_ID" "$TEST_VERSION_FLAG"
echo "MESSAGE=Update buildimages ID to $IMAGES_ID" >> $GITHUB_OUTPUT
else
inv -e update-go --image-tag "$IMAGES_ID" "$TEST_VERSION_FLAG" $INCLUDE_OTEL_MODULES -v "$INPUT_GO_VERSION"
deva inv -e update-go --image-tag "$IMAGES_ID" "$TEST_VERSION_FLAG" $INCLUDE_OTEL_MODULES -v "$INPUT_GO_VERSION"
echo "MESSAGE=Update Go version to $INPUT_GO_VERSION" >> $GITHUB_OUTPUT
fi

Expand Down Expand Up @@ -151,7 +152,7 @@ jobs:
GITHUB_REF: ${{ github.ref }}
run: |
# Generate the PR description
inv -e buildimages.generate-pr-body \
deva inv -e buildimages.generate-pr-body \
"$CURRENT_BUILDIMAGE_TAG" \
"$IMAGES_ID" \
"$CURRENT_GO_VERSION" \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/chase_release_managers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
with:
python-version-file: .python-version
cache: "pip"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r tasks/libs/requirements-github.txt -r tasks/requirements_release_tasks.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks
- name: Chase release managers
env:
ATLASSIAN_USERNAME : ${{ secrets.ATLASSIAN_USERNAME }}
ATLASSIAN_PASSWORD : ${{ secrets.ATLASSIAN_PASSWORD }}
SLACK_DATADOG_AGENT_BOT_TOKEN : ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
run: |
inv -e release.chase-release-managers --version "$VERSION"
deva inv -e release.chase-release-managers --version "$VERSION"
10 changes: 6 additions & 4 deletions .github/workflows/code_review_complexity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ jobs:
with:
python-version-file: .python-version
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: pip install -r requirements.txt -r tasks/requirements.txt
cache-dependency-path: '.deva/version'
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks
- name: Check code review complexity
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: inv -e github.assign-codereview-label --pr-id="$PR_NUMBER"
run: deva inv -e github.assign-codereview-label --pr-id="$PR_NUMBER"
18 changes: 9 additions & 9 deletions .github/workflows/collector-generate-and-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ jobs:
with:
go-version-file: .go-version

- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks

- name: Run Collector Update Script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
inv -e install-tools
inv -e collector.update
inv -e collector.generate
inv -e generate-licenses
inv -e collector.pull-request
deva inv -e install-tools
deva inv -e collector.update
deva inv -e collector.generate
deva inv -e generate-licenses
deva inv -e collector.pull-request
32 changes: 14 additions & 18 deletions .github/workflows/create_rc_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ jobs:
python-version-file: .python-version
cache: "pip"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tasks/libs/requirements-github.txt
pip install -r tasks/requirements_release_tasks.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks

- name: Check previous agent 6 RC status
if: ${{ env.IS_AGENT6_RELEASE == 'true' }}
Expand All @@ -47,15 +45,15 @@ jobs:
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
SLACK_DATADOG_AGENT_CI_WEBHOOK: ${{ secrets.SLACK_DATADOG_AGENT_CI_WEBHOOK }}
run: |
inv -e release.check-previous-agent6-rc
deva inv -e release.check-previous-agent6-rc

- name: Determine the release active branches
id: branches
run: |
if ${{ env.IS_AGENT6_RELEASE == 'true' }}; then
echo "value=[\"$AGENT6_RELEASE_BRANCH\"]" >> $GITHUB_OUTPUT
else
echo "value=$(inv release.get-unreleased-release-branches)" >> $GITHUB_OUTPUT
echo "value=$(deva inv release.get-unreleased-release-branches)" >> $GITHUB_OUTPUT
fi

- name: Set the warning option
Expand Down Expand Up @@ -86,12 +84,10 @@ jobs:
python-version-file: .python-version
cache: "pip"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tasks/libs/requirements-github.txt
pip install -r tasks/requirements_release_tasks.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks

- name: Check for changes since last RC
id: check_for_changes
Expand All @@ -103,9 +99,9 @@ jobs:
WARNING: ${{ needs.find_release_branches.outputs.warning }}
run: |
if [ -n "${{ needs.find_release_branches.outputs.warning }}" ]; then
echo "CHANGES=$(inv -e release.check-for-changes -r "$MATRIX" "$WARNING")" >> $GITHUB_OUTPUT
echo "CHANGES=$(deva inv -e release.check-for-changes -r "$MATRIX" "$WARNING")" >> $GITHUB_OUTPUT
else
echo "CHANGES=$(inv -e release.check-for-changes -r "$MATRIX")" >> $GITHUB_OUTPUT
echo "CHANGES=$(deva inv -e release.check-for-changes -r "$MATRIX")" >> $GITHUB_OUTPUT
fi

- name: Check if agent 6 is in qualification phase
Expand All @@ -123,7 +119,7 @@ jobs:
MATRIX: ${{ matrix.value }}
run: |
if ${{ env.IS_AGENT6_RELEASE == 'true' }}; then
inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT6_RELEASE_SLACK_WEBHOOK }} --patch-version
deva inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT6_RELEASE_SLACK_WEBHOOK }} --patch-version
else
inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }}
deva inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }}
fi
10 changes: 5 additions & 5 deletions .github/workflows/create_release_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
with:
python-version-file: .python-version
cache: "pip"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r tasks/libs/requirements-github.txt -r tasks/requirements_release_tasks.txt
- name: Install deva
uses: ./.github/actions/install-deva
with:
features: legacy-tasks
- name: Create release schedule
env:
ATLASSIAN_USERNAME : ${{ secrets.ATLASSIAN_USERNAME }}
ATLASSIAN_PASSWORD : ${{ secrets.ATLASSIAN_PASSWORD }}
INPUT_VERSION: ${{ github.event.inputs.version }}
CUTOFF_DATE: ${{ github.event.inputs.cutoff_date }}
run: |
inv -e release.create-schedule --version "$INPUT_VERSION" --cutoff-date "$CUTOFF_DATE"
deva inv -e release.create-schedule --version "$INPUT_VERSION" --cutoff-date "$CUTOFF_DATE"
Loading