Skip to content

Update NGINX Plus in Integration Tests #1212

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

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bb872d2
update nginx plus in workflow
spencerugbo Aug 13, 2025
da8471c
update protoc version
spencerugbo Aug 13, 2025
67dae8e
fix docker registry login
spencerugbo Aug 13, 2025
cd249ff
fix plus version in container matrix
spencerugbo Aug 13, 2025
699e839
test plus version as variable
spencerugbo Aug 14, 2025
84a7f0f
fix for setting plus version
spencerugbo Aug 14, 2025
8a1a3c1
use JWT for authentication
spencerugbo Aug 15, 2025
d06ec39
add jwt as env variable
spencerugbo Aug 15, 2025
2bec6fc
cleanup
spencerugbo Aug 15, 2025
e4bc9b9
cleanup
spencerugbo Aug 15, 2025
b580981
fix jwt env name
spencerugbo Aug 15, 2025
ee1d346
add jwt license to container
spencerugbo Aug 15, 2025
147eb9d
properly pass variable from host to container
spencerugbo Aug 15, 2025
1973846
small change to run command
spencerugbo Aug 18, 2025
3ad88a5
cleanup
spencerugbo Aug 18, 2025
7e87c98
added jwt variable to makefile command
spencerugbo Aug 18, 2025
681116e
add environment variable definition to workflow
spencerugbo Aug 18, 2025
5c3749f
add jwt to directory in container
spencerugbo Aug 18, 2025
44dcb36
add debug log
spencerugbo Aug 18, 2025
bdc601c
test other plus versions
spencerugbo Aug 18, 2025
f8c0180
test plus r34
spencerugbo Aug 18, 2025
b4db722
add debug log
spencerugbo Aug 19, 2025
c4b6d77
cleanup
spencerugbo Aug 19, 2025
3c9d395
add jwt definition to makefile
spencerugbo Aug 19, 2025
ef08b53
cleanup
spencerugbo Aug 19, 2025
488cef2
fix container matrix
spencerugbo Aug 19, 2025
ece3333
Merge branch 'main' into update-nginx-plus-in-integration-tests
spencerugbo Aug 19, 2025
2e626e9
Update ci.yml
spencerugbo Aug 19, 2025
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
22 changes: 5 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ permissions:
env:
NFPM_VERSION: 'v2.35.3'
GOPROXY: "direct"
NGINX_LICENSE_JWT: ${{ secrets.NGINX_LICENSE_JWT }}

jobs:
proxy-sanity-check:
Expand Down Expand Up @@ -179,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:
Expand All @@ -190,25 +192,10 @@ jobs:
matrix:
container:
- image: "alpine"
version: "3.20"
plus: "r32"
version: "3.21"
plus: "r34"
release: "alpine"
path: "/nginx-plus/agent"
- image: "alpine"
version: "3.19"
plus: "r31"
release: "alpine"
path: "/nginx-plus/agent"
- image: "debian"
version: "bookworm"
plus: "r32"
release: "debian"
path: "/nginx-plus/agent"
- image: "debian"
version: "bookworm"
plus: "r31"
release: "debian"
path: "/nginx-plus/agent"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
Expand All @@ -232,6 +219,7 @@ jobs:
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:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -169,6 +170,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:
Expand Down
2 changes: 1 addition & 1 deletion api/grpc/mpi/v1/command.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/grpc/mpi/v1/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/grpc/mpi/v1/files.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions test/helpers/test_containers_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package helpers
import (
"context"
"io"
"os"
"path/filepath"
"testing"

"github.com/docker/docker/api/types"
Expand Down Expand Up @@ -86,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,
},
},
}

Expand Down
16 changes: 16 additions & 0 deletions test/integration/utils/grpc_management_plane_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"net"
"net/http"
"os"
"path/filepath"
"slices"
"sort"
"testing"
Expand Down Expand Up @@ -175,6 +176,21 @@ 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"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we can remove this log line. It won't be needed and it won't show the contents of the jwt since it's a github secret.

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)
Expand Down
Loading