Skip to content

Commit 4e94d09

Browse files
authored
chore: remove installer (#192)
The installer has been relocated for some time now. This PR removes all remaining code, scripts, and CI configurations related to the installer.
1 parent 137ab2c commit 4e94d09

34 files changed

+985
-3505
lines changed

.circleci/config.yml

+979-19
Large diffs are not rendered by default.

.circleci/continue_config.yml

-1,068
This file was deleted.

.circleci/src/@common.yml

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ parameters:
77
build_all:
88
type: boolean
99
default: false
10-
run-installer-workflow:
11-
type: boolean
12-
default: false
1310

1411
executors:
1512
docker-amd64:

.circleci/src/@jobs.yml

+2-58
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ jobs:
283283
entrypoint: "/bin/sh"
284284
steps:
285285
- checkout
286-
- run: find bin/ test/ example/ installer/ -type f -executable | xargs shellcheck --exclude
286+
- run: find bin/ test/ example/ -type f -executable | xargs shellcheck --exclude
287287
SC1071,SC1091,SC2317
288288
check-ci-definition:
289289
docker:
@@ -294,63 +294,7 @@ jobs:
294294
name: Verify
295295
command: |
296296
CIRCLE_CFG=generated-config.yml make circleci-config
297-
diff .circleci/continue_config.yml generated-config.yml
298-
build_installer_arm64:
299-
steps:
300-
- checkout
301-
- run: go test -C ./installer/configurator -v
302-
- run: CGO_ENABLED=0 go -C ./installer/configurator build -o nginx-configurator
303-
- store_artifacts:
304-
path: "./installer/configurator/nginx-configurator"
305-
destination: nginx-configurator
306-
machine:
307-
image: ubuntu-2204:current
308-
resource_class: arm.medium
309-
build_installer_amd64:
310-
steps:
311-
- checkout
312-
- run: CGO_ENABLED=0 go -C ./installer/configurator build -o nginx-configurator
313-
- persist_to_workspace:
314-
root: "./installer/configurator"
315-
paths:
316-
- "nginx-configurator"
317-
- store_artifacts:
318-
path: "./installer/configurator/nginx-configurator"
319-
destination: nginx-configurator
320-
machine:
321-
image: ubuntu-2204:current
322-
resource_class: medium
323-
installer_test:
324-
parameters:
325-
base-dockerfile:
326-
type: string
327-
machine:
328-
image: ubuntu-2204:current
329-
steps:
330-
- checkout
331-
- attach_workspace:
332-
at: "/tmp/workspace"
333-
- run:
334-
name: Move the configurator go binary to the installer directory
335-
working_directory: ./installer
336-
command: cp /tmp/workspace/nginx-configurator .
337-
- run:
338-
name: Run installer tests
339-
command: docker compose -f installer/test/docker-compose.yml up --build --exit-code-from nginx
340-
environment:
341-
DD_API_KEY: fakekey
342-
NGINX_DOCKERFILE: << parameters.base-dockerfile >>
343-
installer_download_test:
344-
machine:
345-
image: ubuntu-2204:current
346-
steps:
347-
- checkout
348-
- run:
349-
name: Run installer download tests
350-
command: docker compose -f installer/test/docker-compose-download.yml up --build --exit-code-from nginx
351-
environment:
352-
DD_API_KEY: fakekey
353-
NGINX_DOCKERFILE: bookworm.Dockerfile
297+
diff .circleci/config.yml generated-config.yml
354298
build_ingress_nginx_module:
355299
executor:
356300
name: ubuntu-<< parameters.arch >>

.circleci/src/workflows/build-and-test-installer.yml

-27
This file was deleted.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ARCH ?= $(shell arch)
1212
COVERAGE ?= OFF
1313
BUILD_TESTING ?= ON
1414
DOCKER_REPOS ?= public.ecr.aws/b1o7r7e0/nginx_musl_toolchain
15-
CIRCLE_CFG ?= .circleci/continue_config.yml
15+
CIRCLE_CFG ?= .circleci/config.yml
1616
ifneq ($(PCRE2_PATH),)
1717
CMAKE_PCRE_OPTIONS := -DCMAKE_C_FLAGS=-I$(PCRE2_PATH)/include/ -DCMAKE_CXX_FLAGS=-I$(PCRE2_PATH)/include/ -DCMAKE_LDFLAGS=-L$(PCRE2_PATH)/lib
1818
endif

bin/release.py

+3-93
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
"""
3-
This script automates the release process for the nginx-dataadog module,
4-
ingress-nginx init container and the installer.
3+
This script automates the release process for the nginx-dataadog module and
4+
ingress-nginx init container..
55
66
Usage:
77
======
@@ -10,9 +10,6 @@
1010
1111
To release ingress-nginx docker init containers:
1212
./release.py --ci-token <CI_TOKEN> --version-tag v1.3.1 --workflow-id <CI_RELEASE_WORKFLOW_ID> ingres-nginx
13-
14-
To release the installer:
15-
./release.py --ci-token <CI_TOKEN> --version-tag v0.3.3 --workflow-id <CI_RELEASE_WORKFLOW_ID> installer
1613
"""
1714

1815
import re
@@ -172,29 +169,6 @@ def sign_package(package_path: str) -> None:
172169
run(command, check=True)
173170

174171

175-
def prepare_installer_release_artifact(work_dir, build_job_number, arch):
176-
artifacts = send_ci_request_paged(
177-
f"/project/gh/DataDog/nginx-datadog/{build_job_number}/artifacts")
178-
module_url = None
179-
for artifact in artifacts:
180-
name = artifact["path"]
181-
if name == "nginx-configurator":
182-
module_url = artifact["url"]
183-
184-
if module_url is None:
185-
raise Exception(
186-
f"Job number {build_job_number} doesn't have an 'nginx-configurator' build artifact."
187-
)
188-
189-
module_path = work_dir / "nginx-configurator"
190-
download_file(module_url, module_path)
191-
192-
# Package and sign
193-
tarball_path = work_dir / f"nginx-configurator-{arch}.tgz"
194-
package(module_path, out=tarball_path)
195-
sign_package(tarball_path)
196-
197-
198172
def prepare_release_artifact(work_dir, build_job_number, flavor, version, arch,
199173
waf):
200174
flavor_prefix = f"{flavor}-"
@@ -242,61 +216,6 @@ def prepare_release_artifact(work_dir, build_job_number, flavor, version, arch,
242216
sign_package(debug_tarball_path)
243217

244218

245-
def release_installer(args) -> int:
246-
"""
247-
This subcommand function downloads installer artifacts from the release workflow
248-
and publishes them to a GitHub release.
249-
250-
Requirements:
251-
- You must be logged into the GitHub CLI (gh) to authenticate and publish the release.
252-
"""
253-
jobs = get_workflow_jobs(args.workflow_id)
254-
if not jobs:
255-
return 1
256-
257-
with tempfile.TemporaryDirectory() as work_dir:
258-
for job in jobs:
259-
if job["name"].startswith("build installer "):
260-
# name should be something like "build installer on arm64"
261-
match = re.match(r"build installer on (amd64|arm64)",
262-
job["name"])
263-
if match is None:
264-
raise Exception(
265-
f'Job name does not match regex "{re}": {job}')
266-
arch = match.groups()[0]
267-
prepare_installer_release_artifact(work_dir, job["job_number"],
268-
arch)
269-
270-
pubkey_file = os.path.join(work_dir, "pubkey.gpg")
271-
run([gpg_exe, "--output", pubkey_file, "--armor", "--export"],
272-
check=True)
273-
274-
# We've tgz'd and signed all of our release modules.
275-
# Now let's send them to GitHub in a release via `gh release create`.
276-
release_files = itertools.chain(
277-
Path(work_dir).glob("*.tgz"),
278-
Path(work_dir).glob("*.tgz.asc"),
279-
(pubkey_file, ),
280-
)
281-
282-
command = [
283-
gh_exe,
284-
"release",
285-
"create",
286-
options.version_tag,
287-
"--prerelease",
288-
"--draft",
289-
"--generate-notes",
290-
"--verify-tag",
291-
"--repo",
292-
"DataDog/nginx-datadog",
293-
*release_files,
294-
]
295-
run(command, check=True)
296-
297-
return 0
298-
299-
300219
def release_ingress_nginx(args: typing.Any) -> int:
301220
"""
302221
This subcommand function retrieves the modules from the CI workflow, builds the ingress-nginx init container,
@@ -351,6 +270,7 @@ def release_ingress_nginx(args: typing.Any) -> int:
351270
collected_images[image_no_arch].append(args.image_name)
352271
collected_images[f"{args.registry}:{version}"].append(
353272
args.image_name)
273+
print(collected_images)
354274

355275
create_multiarch_images(collected_images)
356276

@@ -444,16 +364,6 @@ def release_module(args) -> int:
444364
"nginx-module", help="Release the NGINX module")
445365
nginx_module_parser.set_defaults(func=release_module)
446366

447-
# installer subcommand
448-
installer_parser = subparsers.add_parser(
449-
"installer", help="Release the NGINX installer")
450-
installer_parser.set_defaults(func=release_installer)
451-
installer_parser.add_argument(
452-
"--installer",
453-
help="Release the NGINX installer",
454-
action=argparse.BooleanOptionalAction,
455-
)
456-
457367
# ingress-nginx subcommand
458368
ingress_nginx_parser = subparsers.add_parser(
459369
"ingress-nginx", help="Release ingress-nginx init containers")

installer/README.md

-40
This file was deleted.

0 commit comments

Comments
 (0)