From bb872d228273969819fa38d60ad23149aecaa23c Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Wed, 13 Aug 2025 13:13:22 +0100 Subject: [PATCH 01/27] update nginx plus in workflow --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaee9f553..8d74e858e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,22 +191,22 @@ jobs: container: - image: "alpine" version: "3.20" - plus: "r32" + plus: "r33" release: "alpine" path: "/nginx-plus/agent" - image: "alpine" version: "3.19" - plus: "r31" + plus: "r33" release: "alpine" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r32" + plus: "r33" release: "debian" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r31" + plus: "r33" release: "debian" path: "/nginx-plus/agent" steps: @@ -224,8 +224,8 @@ jobs: uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: registry: ${{ secrets.REGISTRY_URL }} - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} + username: ${{ secrets.NGINX_LICENSE_JWT }} + password: "none" - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} From da8471c38ffebfe095bcebb88f81578ab0072ef7 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Wed, 13 Aug 2025 13:22:43 +0100 Subject: [PATCH 02/27] update protoc version --- api/grpc/mpi/v1/command.pb.go | 2 +- api/grpc/mpi/v1/common.pb.go | 2 +- api/grpc/mpi/v1/files.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/grpc/mpi/v1/command.pb.go b/api/grpc/mpi/v1/command.pb.go index 7c137c5e9..1c4fa9b0c 100644 --- a/api/grpc/mpi/v1/command.pb.go +++ b/api/grpc/mpi/v1/command.pb.go @@ -8,7 +8,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.7 // protoc (unknown) // source: mpi/v1/command.proto diff --git a/api/grpc/mpi/v1/common.pb.go b/api/grpc/mpi/v1/common.pb.go index 9ba42f536..26b95bf14 100644 --- a/api/grpc/mpi/v1/common.pb.go +++ b/api/grpc/mpi/v1/common.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.7 // protoc (unknown) // source: mpi/v1/common.proto diff --git a/api/grpc/mpi/v1/files.pb.go b/api/grpc/mpi/v1/files.pb.go index 9ebb60f91..c68585426 100644 --- a/api/grpc/mpi/v1/files.pb.go +++ b/api/grpc/mpi/v1/files.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.7 // protoc (unknown) // source: mpi/v1/files.proto From 67dae8eb0ef166fe183447367cf1cb16a0883521 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Wed, 13 Aug 2025 13:48:34 +0100 Subject: [PATCH 03/27] fix docker registry login --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d74e858e..cce167e2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,8 +224,8 @@ jobs: uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: registry: ${{ secrets.REGISTRY_URL }} - username: ${{ secrets.NGINX_LICENSE_JWT }} - password: "none" + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} From cd249ff94336b4c95e3a5c362c080bb97b22afd7 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Wed, 13 Aug 2025 15:21:47 +0100 Subject: [PATCH 04/27] fix plus version in container matrix --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cce167e2b..858785719 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: path: "/nginx-plus/agent" - image: "alpine" version: "3.19" - plus: "r33" + plus: "r32" release: "alpine" path: "/nginx-plus/agent" - image: "debian" @@ -206,7 +206,7 @@ jobs: path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r33" + plus: "r32" release: "debian" path: "/nginx-plus/agent" steps: From 699e839d9e5192c40726d47571ea0cb6bff07b14 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Thu, 14 Aug 2025 13:47:20 +0100 Subject: [PATCH 05/27] test plus version as variable --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 858785719..6a15a9a8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ permissions: env: NFPM_VERSION: 'v2.35.3' GOPROXY: "direct" + PLUS_VERSION: "r33" jobs: proxy-sanity-check: @@ -191,12 +192,12 @@ jobs: container: - image: "alpine" version: "3.20" - plus: "r33" + plus: ${{ env.PLUS_VERSION }} release: "alpine" path: "/nginx-plus/agent" - image: "alpine" version: "3.19" - plus: "r32" + plus: "r$((${{ env.PLUS_VERSION#r }} - 1 ))" release: "alpine" path: "/nginx-plus/agent" - image: "debian" @@ -206,7 +207,7 @@ jobs: path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r32" + plus: "r$((${{ env.PLUS_VERSION#r }} - 1 ))" release: "debian" path: "/nginx-plus/agent" steps: From 84a7f0f4a23106f504337648d8786089e354d44b Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Thu, 14 Aug 2025 14:44:34 +0100 Subject: [PATCH 06/27] fix for setting plus version --- .github/workflows/ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a15a9a8d..51ef20bd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ permissions: env: NFPM_VERSION: 'v2.35.3' GOPROXY: "direct" - PLUS_VERSION: "r33" jobs: proxy-sanity-check: @@ -187,6 +186,8 @@ jobs: needs: build-unsigned-snapshot if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }} runs-on: ubuntu-22.04 + env: + PLUS_VERSION: "r33" strategy: matrix: container: @@ -197,17 +198,17 @@ jobs: path: "/nginx-plus/agent" - image: "alpine" version: "3.19" - plus: "r$((${{ env.PLUS_VERSION#r }} - 1 ))" + plus: ${{ steps.set_plus_versions.outputs.PREV_PLUS_VERSION }} release: "alpine" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r33" + plus: ${{ env.PLUS_VERSION }} release: "debian" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r$((${{ env.PLUS_VERSION#r }} - 1 ))" + plus: ${{ steps.set_plus_versions.outputs.PREV_PLUS_VERSION }} release: "debian" path: "/nginx-plus/agent" steps: @@ -221,6 +222,11 @@ jobs: with: name: nginx-agent-unsigned-snapshots path: build + - name: Set Plus Versions + id : set_plus_versions + run: | + latest = ${ env.PLUS_VERSION#r } + echo "PREV_PLUS_VERSION = r$((latest - 1))" >> $GITHUB_OUTPUT - name: Login to Docker Registry uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: From 8a1a3c168f7d5585ef489f88e1853de7924434c2 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 12:20:34 +0100 Subject: [PATCH 07/27] use JWT for authentication --- .github/workflows/ci.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51ef20bd1..ac29ab9da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,29 +186,27 @@ jobs: needs: build-unsigned-snapshot if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }} runs-on: ubuntu-22.04 - env: - PLUS_VERSION: "r33" strategy: matrix: container: - image: "alpine" version: "3.20" - plus: ${{ env.PLUS_VERSION }} + plus: "r33" release: "alpine" path: "/nginx-plus/agent" - image: "alpine" version: "3.19" - plus: ${{ steps.set_plus_versions.outputs.PREV_PLUS_VERSION }} + plus: "r32" release: "alpine" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: ${{ env.PLUS_VERSION }} + plus: "r33" release: "debian" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: ${{ steps.set_plus_versions.outputs.PREV_PLUS_VERSION }} + plus: "r32" release: "debian" path: "/nginx-plus/agent" steps: @@ -222,11 +220,9 @@ jobs: with: name: nginx-agent-unsigned-snapshots path: build - - name: Set Plus Versions - id : set_plus_versions + - name: Set JWT run: | - latest = ${ env.PLUS_VERSION#r } - echo "PREV_PLUS_VERSION = r$((latest - 1))" >> $GITHUB_OUTPUT + echo "${{ secrets.NGINX_JWT }}" > /etc/nginx/license.jwt - name: Login to Docker Registry uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: From d06ec39c01c55be34092c9a44a0298ab7fdc7252 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 12:53:58 +0100 Subject: [PATCH 08/27] add jwt as env variable --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac29ab9da..c95293e1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,6 +186,8 @@ jobs: needs: build-unsigned-snapshot if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }} runs-on: ubuntu-22.04 + env: + NGINX_LICENSE_JWT: ${{ secrets.NGINX_JWT }} strategy: matrix: container: @@ -236,6 +238,7 @@ jobs: TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \ make official-image-integration-test + with: performance-tests: name: Performance Tests From 2bec6fc352e142da06ff8ed49dd13f30dc28abe4 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 12:59:30 +0100 Subject: [PATCH 09/27] cleanup --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c95293e1b..04b556452 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,9 +222,6 @@ jobs: with: name: nginx-agent-unsigned-snapshots path: build - - name: Set JWT - run: | - echo "${{ secrets.NGINX_JWT }}" > /etc/nginx/license.jwt - name: Login to Docker Registry uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: From e4bc9b98960beb911f2e012434fe388f315031d2 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 13:40:49 +0100 Subject: [PATCH 10/27] cleanup --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b556452..eeafbc0f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,7 +235,6 @@ jobs: TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \ make official-image-integration-test - with: performance-tests: name: Performance Tests From b5809811bbe3cbea15deffcf897f6a0d9cd53c90 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 14:18:59 +0100 Subject: [PATCH 11/27] fix jwt env name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eeafbc0f8..95b5ebc44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,7 +187,7 @@ jobs: if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }} runs-on: ubuntu-22.04 env: - NGINX_LICENSE_JWT: ${{ secrets.NGINX_JWT }} + NGINX_LICENSE_JWT: ${{ secrets.NGINX_LICENSE_JWT }} strategy: matrix: container: From ee1d346439d1dc3a53b0e9d0e51b08b74d23ae71 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 15:50:52 +0100 Subject: [PATCH 12/27] add jwt license to container --- .github/workflows/ci.yml | 1 + test/helpers/test_containers_utils.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95b5ebc44..b597f4c68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ permissions: env: NFPM_VERSION: 'v2.35.3' GOPROXY: "direct" + NGINX_LICENSE_JWT: ${{ secrets.NGINX_LICENSE_JWT }} jobs: proxy-sanity-check: diff --git a/test/helpers/test_containers_utils.go b/test/helpers/test_containers_utils.go index baee47d40..9024de25e 100644 --- a/test/helpers/test_containers_utils.go +++ b/test/helpers/test_containers_utils.go @@ -43,6 +43,7 @@ func StartContainer( containerRegistry := Env(tb, "CONTAINER_NGINX_IMAGE_REGISTRY") tag := Env(tb, "TAG") imagePath := Env(tb, "IMAGE_PATH") + nginxJWTLicense := Env(tb, "NGINX_LICENSE_JWT") req := testcontainers.ContainerRequest{ FromDockerfile: testcontainers.FromDockerfile{ @@ -60,6 +61,7 @@ func StartContainer( "CONTAINER_NGINX_IMAGE_REGISTRY": ToPtr(containerRegistry), "IMAGE_PATH": ToPtr(imagePath), "TAG": ToPtr(tag), + "NGINX_LICENSE_JWT": ToPtr(nginxJWTLicense), }, BuildOptionsModifier: func(buildOptions *types.ImageBuildOptions) { buildOptions.Target = buildTarget From 147eb9db04cd3c337bc440ecdeff3175a55f292a Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Fri, 15 Aug 2025 17:06:27 +0100 Subject: [PATCH 13/27] properly pass variable from host to container --- test/helpers/test_containers_utils.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/helpers/test_containers_utils.go b/test/helpers/test_containers_utils.go index 9024de25e..c45f74c91 100644 --- a/test/helpers/test_containers_utils.go +++ b/test/helpers/test_containers_utils.go @@ -43,7 +43,6 @@ func StartContainer( containerRegistry := Env(tb, "CONTAINER_NGINX_IMAGE_REGISTRY") tag := Env(tb, "TAG") imagePath := Env(tb, "IMAGE_PATH") - nginxJWTLicense := Env(tb, "NGINX_LICENSE_JWT") req := testcontainers.ContainerRequest{ FromDockerfile: testcontainers.FromDockerfile{ @@ -61,12 +60,14 @@ func StartContainer( "CONTAINER_NGINX_IMAGE_REGISTRY": ToPtr(containerRegistry), "IMAGE_PATH": ToPtr(imagePath), "TAG": ToPtr(tag), - "NGINX_LICENSE_JWT": ToPtr(nginxJWTLicense), }, BuildOptionsModifier: func(buildOptions *types.ImageBuildOptions) { buildOptions.Target = buildTarget }, }, + Env: map[string]string{ + "NGINX_LICENSE_JWT": Env(tb, "NGINX_LICENSE_JWT"), + }, ExposedPorts: []string{"9091/tcp"}, WaitingFor: wait.ForLog(parameters.LogMessage), Networks: []string{ From 19738461b46a6caec54b595b8818ab2728c5151d Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 14:30:58 +0100 Subject: [PATCH 14/27] small change to run command --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b597f4c68..1b0e5f9fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,8 +187,6 @@ jobs: needs: build-unsigned-snapshot if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }} runs-on: ubuntu-22.04 - env: - NGINX_LICENSE_JWT: ${{ secrets.NGINX_LICENSE_JWT }} strategy: matrix: container: @@ -232,7 +230,7 @@ jobs: - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} - CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" \ + CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}"\ TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \ make official-image-integration-test From 3ad88a5b84dbcadb742c2feef867f969734210f5 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 14:45:53 +0100 Subject: [PATCH 15/27] cleanup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b0e5f9fd..4e96484a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,7 +230,7 @@ jobs: - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} - CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}"\ + CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" \ TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \ make official-image-integration-test From 7e87c98fff17d543b748a0335a19bde68c57ee44 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 15:04:47 +0100 Subject: [PATCH 16/27] added jwt variable to makefile command --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 19467116d..c38ff25ab 100644 --- a/Makefile +++ b/Makefile @@ -169,6 +169,7 @@ official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \ PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \ OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \ + NGINX_LICENSE_JWT=$(NGINX_LICENSE_JWT) \ go test -v ./test/integration/managementplane ./test/integration/auxiliarycommandserver performance-test: From 681116ece50bca7f67b7bea9665af53375e476e0 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 15:08:15 +0100 Subject: [PATCH 17/27] add environment variable definition to workflow --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e96484a0..6768f521d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,6 +180,7 @@ jobs: CONTAINER_NGINX_IMAGE_REGISTRY="docker-registry.nginx.com" \ TAG="${{ matrix.container.version }}-${{ matrix.container.image }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" \ + NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" make official-image-integration-test official-plus-image-integration-tests: @@ -230,9 +231,10 @@ jobs: - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} - CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" \ + CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" \ TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \ + NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" \ make official-image-integration-test performance-tests: From 5c3749f407cda5a445f313449ac15078ab9035c1 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 16:08:28 +0100 Subject: [PATCH 18/27] add jwt to directory in container --- .github/workflows/ci.yml | 2 +- test/helpers/test_containers_utils.go | 10 +++++++--- .../utils/grpc_management_plane_utils.go | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6768f521d..328e74960 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,7 +180,7 @@ jobs: CONTAINER_NGINX_IMAGE_REGISTRY="docker-registry.nginx.com" \ TAG="${{ matrix.container.version }}-${{ matrix.container.image }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" \ - NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" + NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" \ make official-image-integration-test official-plus-image-integration-tests: diff --git a/test/helpers/test_containers_utils.go b/test/helpers/test_containers_utils.go index c45f74c91..e973b1f1f 100644 --- a/test/helpers/test_containers_utils.go +++ b/test/helpers/test_containers_utils.go @@ -8,6 +8,8 @@ package helpers import ( "context" "io" + "os" + "path/filepath" "testing" "github.com/docker/docker/api/types" @@ -65,9 +67,6 @@ func StartContainer( buildOptions.Target = buildTarget }, }, - Env: map[string]string{ - "NGINX_LICENSE_JWT": Env(tb, "NGINX_LICENSE_JWT"), - }, ExposedPorts: []string{"9091/tcp"}, WaitingFor: wait.ForLog(parameters.LogMessage), Networks: []string{ @@ -89,6 +88,11 @@ func StartContainer( ContainerFilePath: "/etc/nginx/nginx.conf", FileMode: configFilePermissions, }, + { + HostFilePath: filepath.Join(os.TempDir(), "license.jwt"), + ContainerFilePath: "/etc/nginx/license.jwt", + FileMode: configFilePermissions, + }, }, } diff --git a/test/integration/utils/grpc_management_plane_utils.go b/test/integration/utils/grpc_management_plane_utils.go index b79ef5de2..e5df892f2 100644 --- a/test/integration/utils/grpc_management_plane_utils.go +++ b/test/integration/utils/grpc_management_plane_utils.go @@ -12,6 +12,7 @@ import ( "net" "net/http" "os" + "path/filepath" "slices" "sort" "testing" @@ -175,6 +176,19 @@ func setupNginxContainer( if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { nginxConfPath = "../../config/nginx/nginx-plus.conf" } + if os.Getenv("NGINX_LICENSE_JWT") != "" { + licensePath := filepath.Join(os.TempDir(), "license.jwt") + license, err := os.Create(licensePath) + if err != nil { + tb.Fatalf("Failed to create license file: %v", err) + } + defer license.Close() + + _, err = license.WriteString((os.Getenv("NGINX_LICENSE"))) + if err != nil { + tb.Fatalf("Failed to write license to file: %v", err) + } + } params.NginxConfigPath = nginxConfPath Container = helpers.StartContainer(ctx, tb, containerNetwork, params) From 44dcb3614f06854fff0aa9cbcc0c7ebc1809ebdb Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 16:53:04 +0100 Subject: [PATCH 19/27] add debug log --- test/integration/utils/grpc_management_plane_utils.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/utils/grpc_management_plane_utils.go b/test/integration/utils/grpc_management_plane_utils.go index e5df892f2..9519ab32d 100644 --- a/test/integration/utils/grpc_management_plane_utils.go +++ b/test/integration/utils/grpc_management_plane_utils.go @@ -177,6 +177,7 @@ func setupNginxContainer( nginxConfPath = "../../config/nginx/nginx-plus.conf" } if os.Getenv("NGINX_LICENSE_JWT") != "" { + tb.Log("Using NGINX license JWT from environment variable") licensePath := filepath.Join(os.TempDir(), "license.jwt") license, err := os.Create(licensePath) if err != nil { From bdc601cefc4a5242824625c4ec2e3f8671dadec9 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 17:44:41 +0100 Subject: [PATCH 20/27] test other plus versions --- .github/workflows/ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 328e74960..9d1ba336a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,19 +197,14 @@ jobs: release: "alpine" path: "/nginx-plus/agent" - image: "alpine" - version: "3.19" - plus: "r32" + version: "3.21" + plus: "r34" release: "alpine" path: "/nginx-plus/agent" - - image: "debian" - version: "bookworm" - plus: "r33" - release: "debian" - path: "/nginx-plus/agent" - - image: "debian" - version: "bookworm" - plus: "r32" - release: "debian" + - image: "alpine" + version: "3.22" + plus: "r35" + release: "alpine" path: "/nginx-plus/agent" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From f8c0180838d1c17ad352b41d3a7c0d1840c99855 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Mon, 18 Aug 2025 17:54:43 +0100 Subject: [PATCH 21/27] test plus r34 --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d1ba336a..43f78fb11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,21 +191,11 @@ jobs: strategy: matrix: container: - - image: "alpine" - version: "3.20" - plus: "r33" - release: "alpine" - path: "/nginx-plus/agent" - image: "alpine" version: "3.21" plus: "r34" release: "alpine" path: "/nginx-plus/agent" - - image: "alpine" - version: "3.22" - plus: "r35" - release: "alpine" - path: "/nginx-plus/agent" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 From b4db7229eef44545fdf1979078d81ebd26150d35 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Tue, 19 Aug 2025 10:08:45 +0100 Subject: [PATCH 22/27] add debug log --- test/integration/utils/grpc_management_plane_utils.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/utils/grpc_management_plane_utils.go b/test/integration/utils/grpc_management_plane_utils.go index 9519ab32d..fda3d9989 100644 --- a/test/integration/utils/grpc_management_plane_utils.go +++ b/test/integration/utils/grpc_management_plane_utils.go @@ -178,6 +178,7 @@ func setupNginxContainer( } if os.Getenv("NGINX_LICENSE_JWT") != "" { tb.Log("Using NGINX license JWT from environment variable") + tb.Log("jwt contents: %s", os.Getenv("NGINX_LICENSE_JWT")) licensePath := filepath.Join(os.TempDir(), "license.jwt") license, err := os.Create(licensePath) if err != nil { From c4b6d777e31c9176dad75e8f63af01b07e834711 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Tue, 19 Aug 2025 10:10:40 +0100 Subject: [PATCH 23/27] cleanup --- test/integration/utils/grpc_management_plane_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/utils/grpc_management_plane_utils.go b/test/integration/utils/grpc_management_plane_utils.go index fda3d9989..557da0600 100644 --- a/test/integration/utils/grpc_management_plane_utils.go +++ b/test/integration/utils/grpc_management_plane_utils.go @@ -178,7 +178,7 @@ func setupNginxContainer( } if os.Getenv("NGINX_LICENSE_JWT") != "" { tb.Log("Using NGINX license JWT from environment variable") - tb.Log("jwt contents: %s", os.Getenv("NGINX_LICENSE_JWT")) + tb.Logf("jwt contents: %s", os.Getenv("NGINX_LICENSE_JWT")) licensePath := filepath.Join(os.TempDir(), "license.jwt") license, err := os.Create(licensePath) if err != nil { From 3c9d3956d2b7b54663b0ef5fa1dadbcd856168ed Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Tue, 19 Aug 2025 11:53:48 +0100 Subject: [PATCH 24/27] add jwt definition to makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index c38ff25ab..0b0e2d11d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ DOCKERFILE_PATH = "./test/docker/nginx-oss/$(CONTAINER_OS_TYPE)/Dockerfile" OFFICIAL_IMAGE_DOCKERFILE_PATH = "./test/docker/nginx-official-image/$(CONTAINER_OS_TYPE)/Dockerfile" IMAGE_PATH ?= "/nginx/agent" TAG ?= "" +NGINX_LICENSE_JWT ?= "" BUILD_DIR := build TEST_BUILD_DIR := build/test From ef08b537877fb473acea9c86ee40e66286dc3493 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Tue, 19 Aug 2025 16:43:12 +0100 Subject: [PATCH 25/27] cleanup --- .github/workflows/ci.yml | 16 +++++++++++++++- Makefile | 2 -- test/helpers/test_containers_utils.go | 15 +++++++++------ .../utils/grpc_management_plane_utils.go | 16 ---------------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43f78fb11..a57fae707 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ permissions: env: NFPM_VERSION: 'v2.35.3' GOPROXY: "direct" - NGINX_LICENSE_JWT: ${{ secrets.NGINX_LICENSE_JWT }} jobs: proxy-sanity-check: @@ -191,11 +190,26 @@ jobs: strategy: matrix: container: + - image: "alpine" + version: "3.22" + plus: "r35" + release: "alpine" + path: "/nginx-plus/agent" - image: "alpine" version: "3.21" plus: "r34" release: "alpine" path: "/nginx-plus/agent" + - image: "debian" + version: "3.21" + plus: "r35" + release: "bookworm" + path: "/nginx-plus/agent" + - image: "debian" + version: "3.21" + plus: "r34" + release: "bookworm" + path: "/nginx-plus/agent" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 diff --git a/Makefile b/Makefile index 0b0e2d11d..19467116d 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,6 @@ DOCKERFILE_PATH = "./test/docker/nginx-oss/$(CONTAINER_OS_TYPE)/Dockerfile" OFFICIAL_IMAGE_DOCKERFILE_PATH = "./test/docker/nginx-official-image/$(CONTAINER_OS_TYPE)/Dockerfile" IMAGE_PATH ?= "/nginx/agent" TAG ?= "" -NGINX_LICENSE_JWT ?= "" BUILD_DIR := build TEST_BUILD_DIR := build/test @@ -170,7 +169,6 @@ official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \ PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \ OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \ - NGINX_LICENSE_JWT=$(NGINX_LICENSE_JWT) \ go test -v ./test/integration/managementplane ./test/integration/auxiliarycommandserver performance-test: diff --git a/test/helpers/test_containers_utils.go b/test/helpers/test_containers_utils.go index e973b1f1f..99c27332d 100644 --- a/test/helpers/test_containers_utils.go +++ b/test/helpers/test_containers_utils.go @@ -9,7 +9,6 @@ import ( "context" "io" "os" - "path/filepath" "testing" "github.com/docker/docker/api/types" @@ -46,6 +45,14 @@ func StartContainer( tag := Env(tb, "TAG") imagePath := Env(tb, "IMAGE_PATH") + var env map[string]string + if os.Getenv("NGINX_LICENSE_JWT") != "" { + nginxLicenseJwt := os.Getenv("NGINX_LICENSE_JWT") + env = map[string]string{ + "NGINX_LICENSE_JWT": nginxLicenseJwt, + } + } + req := testcontainers.ContainerRequest{ FromDockerfile: testcontainers.FromDockerfile{ Context: "../../../", @@ -88,12 +95,8 @@ func StartContainer( ContainerFilePath: "/etc/nginx/nginx.conf", FileMode: configFilePermissions, }, - { - HostFilePath: filepath.Join(os.TempDir(), "license.jwt"), - ContainerFilePath: "/etc/nginx/license.jwt", - FileMode: configFilePermissions, - }, }, + Env: env, } container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ diff --git a/test/integration/utils/grpc_management_plane_utils.go b/test/integration/utils/grpc_management_plane_utils.go index 557da0600..b79ef5de2 100644 --- a/test/integration/utils/grpc_management_plane_utils.go +++ b/test/integration/utils/grpc_management_plane_utils.go @@ -12,7 +12,6 @@ import ( "net" "net/http" "os" - "path/filepath" "slices" "sort" "testing" @@ -176,21 +175,6 @@ func setupNginxContainer( if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" { nginxConfPath = "../../config/nginx/nginx-plus.conf" } - if os.Getenv("NGINX_LICENSE_JWT") != "" { - tb.Log("Using NGINX license JWT from environment variable") - tb.Logf("jwt contents: %s", os.Getenv("NGINX_LICENSE_JWT")) - licensePath := filepath.Join(os.TempDir(), "license.jwt") - license, err := os.Create(licensePath) - if err != nil { - tb.Fatalf("Failed to create license file: %v", err) - } - defer license.Close() - - _, err = license.WriteString((os.Getenv("NGINX_LICENSE"))) - if err != nil { - tb.Fatalf("Failed to write license to file: %v", err) - } - } params.NginxConfigPath = nginxConfPath Container = helpers.StartContainer(ctx, tb, containerNetwork, params) From 488cef253bf6ae3d33958c2a067756a9bec7b804 Mon Sep 17 00:00:00 2001 From: Spencer Ugbo Date: Tue, 19 Aug 2025 17:00:24 +0100 Subject: [PATCH 26/27] fix container matrix --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a57fae707..6929996fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,14 +201,14 @@ jobs: release: "alpine" path: "/nginx-plus/agent" - image: "debian" - version: "3.21" + version: "bookworm" plus: "r35" - release: "bookworm" + release: "debian" path: "/nginx-plus/agent" - image: "debian" - version: "3.21" + version: "bookworm" plus: "r34" - release: "bookworm" + release: "debian" path: "/nginx-plus/agent" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 2e626e90869549cb8ec65a0d8f8f039029ae0562 Mon Sep 17 00:00:00 2001 From: spencerugbo <102359791+spencerugbo@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:22:15 +0100 Subject: [PATCH 27/27] Update ci.yml --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 961d0d1b2..afa811732 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,16 +200,6 @@ jobs: plus: "r34" release: "alpine" path: "/nginx-plus/agent" - - image: "debian" - version: "bookworm" - plus: "r35" - release: "debian" - path: "/nginx-plus/agent" - - image: "debian" - version: "bookworm" - plus: "r34" - release: "debian" - path: "/nginx-plus/agent" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0