Skip to content

Commit 2dcaa53

Browse files
[BARX-661] remove --use-release-entries and release_version from everywhere (#36143)
(cherry picked from commit 59cb01a)
1 parent c997e81 commit 2dcaa53

File tree

15 files changed

+47
-165
lines changed

15 files changed

+47
-165
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ variables:
148148
BTFHUB_ARCHIVE_BRANCH: main
149149
GENERAL_ARTIFACTS_CACHE_BUCKET_URL: https://dd-agent-omnibus.s3.amazonaws.com
150150
S3_DSD6_URI: s3://dsd6-staging
151-
RELEASE_VERSION: nightly
152151

153152
# Build images versions
154153
# To use images from datadog-agent-buildimages dev branches, set the corresponding

.gitlab/binary_build/cluster_agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
needs: ["go_mod_tidy_check"]
55
script:
66
- inv check-go-version
7-
- inv -e cluster-agent.build --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION"
7+
- inv -e cluster-agent.build
88
- $S3_CP_CMD $CI_PROJECT_DIR/$CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent $S3_ARTIFACTS_URI/datadog-cluster-agent.$ARCH
99
- $S3_CP_CMD $CI_PROJECT_DIR/Dockerfiles/cluster-agent/datadog-cluster.yaml $S3_ARTIFACTS_URI/datadog-cluster.yaml
1010
- $S3_CP_CMD $CI_PROJECT_DIR/Dockerfiles/cluster-agent/security-agent-policies $S3_ARTIFACTS_URI/security-agent-policies --recursive

.gitlab/notify/notify.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,3 @@ send_pipeline_stats:
5454
- export DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $API_KEY_ORG2_SSM_NAME)
5555
- !reference [.setup_python_mirror_linux]
5656
- invoke -e notify.send-stats
57-
58-
notify_github:
59-
stage: notify
60-
image: registry.ddbuild.io/ci/datadog-agent-buildimages/docker_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
61-
tags: ["runner:docker"]
62-
rules:
63-
- !reference [.except_mergequeue]
64-
- !reference [.except_main_or_release_branch]
65-
- !reference [.except_no_tests_no_deploy]
66-
- if: $RELEASE_VERSION != ""
67-
changes:
68-
paths:
69-
- '**/*.go'
70-
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916
71-
when: on_success
72-
- when: never
73-
needs:
74-
- job: "deploy_deb_testing-a6_x64"
75-
optional: true
76-
dependencies: []
77-
allow_failure: true
78-
script:
79-
- !reference [.install_pr_commenter]
80-
- messagefile="$(mktemp)"
81-
- echo "Use this command from [test-infra-definitions](https://github.com/DataDog/test-infra-definitions) to manually test this PR changes on a VM:" >> "$messagefile"
82-
- echo '```sh' >> "$messagefile"
83-
- echo "inv create-vm --pipeline-id=$CI_PIPELINE_ID --os-family=ubuntu" >> "$messagefile"
84-
- echo '```' >> "$messagefile"
85-
- cat "$messagefile" | /usr/local/bin/pr-commenter --for-pr="$CI_COMMIT_REF_NAME" --header="Test changes on VM"
86-
- rm "$messagefile"

.gitlab/package_build/windows.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
-e CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
2323
-e OMNIBUS_TARGET=${OMNIBUS_TARGET}
2424
-e WINDOWS_BUILDER=true
25-
-e RELEASE_VERSION="$RELEASE_VERSION"
2625
-e MAJOR_VERSION="$AGENT_MAJOR_VERSION"
2726
-e PY_RUNTIMES="$PYTHON_RUNTIMES"
2827
-e INTEGRATIONS_CORE_VERSION="$INTEGRATIONS_CORE_VERSION"
@@ -107,7 +106,6 @@ windows_zip_agent_binaries_x64-a6:
107106
-e CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
108107
-e OMNIBUS_TARGET=${OMNIBUS_TARGET}
109108
-e WINDOWS_BUILDER=true
110-
-e RELEASE_VERSION="$RELEASE_VERSION"
111109
-e MAJOR_VERSION="$AGENT_MAJOR_VERSION"
112110
-e INTEGRATIONS_CORE_VERSION="$INTEGRATIONS_CORE_VERSION"
113111
-e PY_RUNTIMES="$PYTHON_RUNTIMES"

Dockerfiles/agent/windows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ How to build the Agent docker image
66
From the root of the repository, run the following command:
77

88
```
9-
docker run --rm -it -v "${pwd}:c:\mnt" -e OMNIBUS_TARGET=main -e MAJOR_VERSION=7 -e RELEASE_VERSION=nightly -e PY_RUNTIMES=3 datadog/agent-buildimages-windows_x64:1809 c:\mnt\tasks\winbuildscripts\buildwin.bat
9+
docker run --rm -it -v "${pwd}:c:\mnt" -e OMNIBUS_TARGET=main -e MAJOR_VERSION=7 -e PY_RUNTIMES=3 datadog/agent-buildimages-windows_x64:1809 c:\mnt\tasks\winbuildscripts\buildwin.bat
1010
```
1111

1212
The above will build the Agent 7 nightly. To build the Agent 6, use the following variables:

docs/dev/agent_omnibus.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ To build on Windows, [Docker Desktop](https://docs.docker.com/docker-for-windows
8787

8888
Start a Powershell prompt and navigate to your local clone of the `datadog-agent` repo.
8989

90-
Run the following command:
91-
90+
Run the following command:
91+
9292
```powershell
93-
docker run -v "$(Get-Location):c:\mnt" -e OMNIBUS_TARGET=main -e RELEASE_VERSION=nightly -e MAJOR_VERSION=7 -e PY_RUNTIMES=3 -e TARGET_ARCH=x64 datadog/agent-buildimages-windows_x64:1809 c:\mnt\tasks\winbuildscripts\buildwin.bat
93+
docker run -v "$(Get-Location):c:\mnt" -e OMNIBUS_TARGET=main -e MAJOR_VERSION=7 -e PY_RUNTIMES=3 -e TARGET_ARCH=x64 datadog/agent-buildimages-windows_x64:1809 c:\mnt\tasks\winbuildscripts\buildwin.bat
9494
```
9595

9696
Downloading the Docker image may take some time in the first run.
@@ -100,7 +100,6 @@ Alternatively here's a small Powershell script to facilitate using the docker im
100100
param (
101101
[int]$MAJOR_VERSION=7,
102102
$TARGET_ARCH="x64",
103-
$RELEASE_VERSION="nightly",
104103
[bool]$RM_CONTAINER=$true,
105104
[bool]$DEBUG=$false
106105
)
@@ -114,7 +113,7 @@ $cmd = "docker run"
114113
if ($RM_CONTAINER) {
115114
$cmd += " --rm "
116115
}
117-
$opts = "-e OMNIBUS_TARGET=main -e RELEASE_VERSION=$RELEASE_VERSION -e MAJOR_VERSION=$MAJOR_VERSION -e PY_RUNTIMES=$PY_RUNTIMES -e TARGET_ARCH=$TARGET_ARCH"
116+
$opts = "-e OMNIBUS_TARGET=main -e MAJOR_VERSION=$MAJOR_VERSION -e PY_RUNTIMES=$PY_RUNTIMES -e TARGET_ARCH=$TARGET_ARCH"
118117
if ($DEBUG) {
119118
$opts += " -e DEBUG_CUSTOMACTION=yes "
120119
}

release.json

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
{
22
"base_branch": "6.53.x",
33
"current_milestone": "6.53.0",
4-
"last_stable": {
5-
"6": "6.52.0",
6-
"7": "7.52.0"
7-
},
8-
"nightly": {
9-
"INTEGRATIONS_CORE_VERSION": "7.53.x",
10-
"OMNIBUS_RUBY_VERSION": "6.53.x",
11-
"JMXFETCH_VERSION": "0.49.0",
12-
"JMXFETCH_HASH": "b5c2c3ff27603f469bb11961d559f1154887963e02b9d70d5f1fc7efa527a486",
13-
"MACOS_BUILD_VERSION": "nschweitzer/master",
14-
"WINDOWS_DDNPM_DRIVER": "release-signed",
15-
"WINDOWS_DDNPM_VERSION": "2.6.0",
16-
"WINDOWS_DDNPM_SHASUM": "b1611ad4ceb8366c88767aeb638abefb226081efbf546b8b886952dd1b18ec05",
17-
"SECURITY_AGENT_POLICIES_VERSION": "master",
18-
"WINDOWS_DDPROCMON_DRIVER": "release-signed",
19-
"WINDOWS_DDPROCMON_VERSION": "1.0.1",
20-
"WINDOWS_DDPROCMON_SHASUM": "7c13ba75f7a30704a6a4082e4cffc819c846fd6061c53372c8b9908fee11d621",
21-
"WINDOWS_APMINJECT_COMMENT": "The WINDOWS_APMINJECT entries below should NOT be added to the release targets",
22-
"WINDOWS_APMINJECT_MODULE": "release-signed",
23-
"WINDOWS_APMINJECT_VERSION": "1.1.1",
24-
"WINDOWS_APMINJECT_SHASUM": "c5c228f6030ce2e19b8bfb28bd054dc246c7f1c799431e73018e6cb46ee59d2f"
25-
},
26-
"release": {
4+
"dependencies": {
275
"INTEGRATIONS_CORE_VERSION": "7.53.0",
286
"OMNIBUS_RUBY_VERSION": "6.53.0",
297
"JMXFETCH_VERSION": "0.49.0",
@@ -37,34 +15,8 @@
3715
"WINDOWS_DDPROCMON_VERSION": "1.0.1",
3816
"WINDOWS_DDPROCMON_SHASUM": "7c13ba75f7a30704a6a4082e4cffc819c846fd6061c53372c8b9908fee11d621"
3917
},
40-
"dca-1.17.0": {
41-
"SECURITY_AGENT_POLICIES_VERSION": "v0.18.6"
42-
},
43-
"dca-1.16.0": {
44-
"SECURITY_AGENT_POLICIES_VERSION": "v0.17"
45-
},
46-
"dca-1.15.0": {
47-
"SECURITY_AGENT_POLICIES_VERSION": "v0.16"
48-
},
49-
"dca-1.14.0": {
50-
"SECURITY_AGENT_POLICIES_VERSION": "v0.15"
51-
},
52-
"dca-1.13.1": {
53-
"SECURITY_AGENT_POLICIES_VERSION": "v0.12"
54-
},
55-
"dca-1.13.0": {
56-
"SECURITY_AGENT_POLICIES_VERSION": "v0.10"
57-
},
58-
"dca-1.12.0": {
59-
"SECURITY_AGENT_POLICIES_VERSION": "v0.9"
60-
},
61-
"dca-1.10.0": {
62-
"SECURITY_AGENT_POLICIES_VERSION": "v0.5"
63-
},
64-
"dca-1.9.1": {
65-
"SECURITY_AGENT_POLICIES_VERSION": "v0.3"
66-
},
67-
"dca-1.9.0": {
68-
"SECURITY_AGENT_POLICIES_VERSION": "v0.3"
18+
"last_stable": {
19+
"6": "6.52.0",
20+
"7": "7.52.0"
6921
}
7022
}

tasks/cluster_agent.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from tasks.build_tags import get_build_tags, get_default_build_tags
1616
from tasks.cluster_agent_helpers import build_common, clean_common, refresh_assets_common, version_common
1717
from tasks.go import deps
18-
from tasks.libs.common.utils import load_release_versions
18+
from tasks.libs.common.utils import load_dependencies
1919

2020
# constants
2121
BIN_PATH = os.path.join(".", "bin", "datadog-cluster-agent")
@@ -34,8 +34,6 @@ def build(
3434
development=True,
3535
skip_assets=False,
3636
policies_version=None,
37-
release_version="nightly",
38-
major_version='7',
3937
):
4038
"""
4139
Build Cluster Agent
@@ -58,11 +56,11 @@ def build(
5856
)
5957

6058
if policies_version is None:
61-
print(f"Loading release versions for {release_version}")
62-
env = load_release_versions(ctx, release_version)
59+
print("Loading dependencies from release.json")
60+
env = load_dependencies(ctx)
6361
if "SECURITY_AGENT_POLICIES_VERSION" in env:
6462
policies_version = env["SECURITY_AGENT_POLICIES_VERSION"]
65-
print(f"Security Agent polices for {release_version}: {policies_version}")
63+
print(f"Security Agent polices: {policies_version}")
6664

6765
build_context = "Dockerfiles/cluster-agent"
6866
policies_path = f"{build_context}/security-agent-policies"

tasks/github_tasks.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from invoke import Exit, task
99

10-
from tasks.libs.common.utils import DEFAULT_BRANCH, DEFAULT_INTEGRATIONS_CORE_BRANCH, get_git_pretty_ref
10+
from tasks.libs.common.utils import DEFAULT_BRANCH, DEFAULT_INTEGRATIONS_CORE_BRANCH, RELEASE_JSON_DEPENDENCIES, get_git_pretty_ref
1111
from tasks.libs.datadog_api import create_count, send_metrics
1212
from tasks.libs.github_actions_tools import (
1313
download_artifacts,
@@ -33,8 +33,8 @@ def concurrency_key():
3333
return current_ref
3434

3535

36-
def _trigger_macos_workflow(release, destination=None, retry_download=0, retry_interval=0, **kwargs):
37-
github_action_ref = _get_release_json_value(f'{release}::MACOS_BUILD_VERSION')
36+
def _trigger_macos_workflow(destination=None, retry_download=0, retry_interval=0, **kwargs):
37+
github_action_ref = _get_release_json_value(f'{RELEASE_JSON_DEPENDENCIES}::MACOS_BUILD_VERSION')
3838

3939
run = trigger_macos_workflow(
4040
github_action_ref=github_action_ref,
@@ -60,7 +60,6 @@ def trigger_macos(
6060
_,
6161
workflow_type="build",
6262
datadog_agent_ref=DEFAULT_BRANCH,
63-
release_version="nightly",
6463
major_version="7",
6564
python_runtimes="3",
6665
destination=".",
@@ -72,16 +71,11 @@ def trigger_macos(
7271
):
7372
if workflow_type == "build":
7473
conclusion = _trigger_macos_workflow(
75-
# Provide the release version to be able to fetch the associated
76-
# macos-build branch from release.json for all workflows...
77-
release_version,
7874
destination,
7975
retry_download,
8076
retry_interval,
8177
workflow_name="macos.yaml",
8278
datadog_agent_ref=datadog_agent_ref,
83-
# ... And provide the release version as a workflow input when needed
84-
release_version=release_version,
8579
major_version=major_version,
8680
python_runtimes=python_runtimes,
8781
# Send pipeline id and bucket branch so that the package version

tasks/libs/common/utils.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
RTLOADER_LIB_NAME = "libdatadog-agent-rtloader.so"
3535
RTLOADER_HEADER_NAME = "datadog_agent_rtloader.h"
3636
AGENT_VERSION_CACHE_NAME = "agent-version.cache"
37+
RELEASE_JSON_DEPENDENCIES = "dependencies"
3738

3839

3940
def get_all_allowed_repo_branches():
@@ -556,14 +557,14 @@ def get_version_numeric_only(ctx, major_version='7'):
556557
return version
557558

558559

559-
def load_release_versions(_, target_version):
560+
def load_dependencies(_):
560561
with open("release.json", "r") as f:
561562
versions = json.load(f)
562-
if target_version in versions:
563-
# windows runners don't accepts anything else than strings in the
564-
# environment when running a subprocess.
565-
return {str(k): str(v) for k, v in versions[target_version].items()}
566-
raise Exception(f"Could not find '{target_version}' version in release.json")
563+
if RELEASE_JSON_DEPENDENCIES not in versions:
564+
raise Exception(f"Could not find '{RELEASE_JSON_DEPENDENCIES}' in release.json")
565+
# windows runners don't accepts anything else than strings in the
566+
# environment when running a subprocess.
567+
return {str(k): str(v) for k, v in versions[RELEASE_JSON_DEPENDENCIES].items()}
567568

568569

569570
##

tasks/libs/github_actions_tools.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def trigger_macos_workflow(
1818
workflow_name="macos.yaml",
1919
github_action_ref="master",
2020
datadog_agent_ref=DEFAULT_BRANCH,
21-
release_version=None,
2221
major_version=None,
2322
python_runtimes="3",
2423
gitlab_pipeline_id=None,
@@ -36,9 +35,6 @@ def trigger_macos_workflow(
3635
if datadog_agent_ref is not None:
3736
inputs["datadog_agent_ref"] = datadog_agent_ref
3837

39-
if release_version is not None:
40-
inputs["release_version"] = release_version
41-
4238
if major_version is not None:
4339
inputs["agent_major_version"] = major_version
4440

tasks/libs/pipeline_tools.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def gracefully_cancel_pipeline(gitlab, pipeline, force_cancel_stages):
8282
def trigger_agent_pipeline(
8383
gitlab,
8484
ref=DEFAULT_BRANCH,
85-
release_version="nightly",
8685
branch="nightly",
8786
deploy=False,
8887
all_builds=False,
@@ -116,8 +115,6 @@ def trigger_agent_pipeline(
116115
else:
117116
args["RUN_E2E_TESTS"] = "off"
118117

119-
args["RELEASE_VERSION"] = release_version
120-
121118
if branch is not None:
122119
args["BUCKET_BRANCH"] = branch
123120

tasks/msi.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from invoke import task
1313
from invoke.exceptions import Exit, UnexpectedExit
1414

15-
from tasks.libs.common.utils import get_version, load_release_versions, timed
15+
from tasks.libs.common.utils import get_version, load_dependencies, timed
1616

1717
# Windows only import
1818
try:
@@ -51,8 +51,8 @@ def _get_vs_build_command(cmd, vstudio_root=None):
5151
return cmd
5252

5353

54-
def _get_env(ctx, major_version='7', python_runtimes='3', release_version='nightly'):
55-
env = load_release_versions(ctx, release_version)
54+
def _get_env(ctx, major_version='7', python_runtimes='3'):
55+
env = load_dependencies(ctx)
5656

5757
env['PACKAGE_VERSION'] = get_version(
5858
ctx, include_git=True, url_safe=True, major_version=major_version, include_pipeline_id=True
@@ -246,12 +246,12 @@ def _build_msi(ctx, env, outdir, name):
246246

247247
@task
248248
def build(
249-
ctx, vstudio_root=None, arch="x64", major_version='7', python_runtimes='3', release_version='nightly', debug=False
249+
ctx, vstudio_root=None, arch="x64", major_version='7', python_runtimes='3', debug=False
250250
):
251251
"""
252252
Build the MSI installer for the agent
253253
"""
254-
env = _get_env(ctx, major_version, python_runtimes, release_version)
254+
env = _get_env(ctx, major_version, python_runtimes)
255255
configuration = _msbuild_configuration(debug=debug)
256256
build_outdir = build_out_dir(arch, configuration)
257257

@@ -303,12 +303,12 @@ def build(
303303

304304
@task
305305
def test(
306-
ctx, vstudio_root=None, arch="x64", major_version='7', python_runtimes='3', release_version='nightly', debug=False
306+
ctx, vstudio_root=None, arch="x64", major_version='7', python_runtimes='3', debug=False
307307
):
308308
"""
309309
Run the unit test for the MSI installer for the agent
310310
"""
311-
env = _get_env(ctx, major_version, python_runtimes, release_version)
311+
env = _get_env(ctx, major_version, python_runtimes)
312312
configuration = _msbuild_configuration(debug=debug)
313313
build_outdir = build_out_dir(arch, configuration)
314314

0 commit comments

Comments
 (0)