Skip to content

Commit 37c7ea4

Browse files
committed
Fix typos, update docs, and remove image builds unless plus
1 parent b026903 commit 37c7ea4

File tree

6 files changed

+39
-46
lines changed

6 files changed

+39
-46
lines changed

.github/workflows/nfr.yml

+25-40
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
test_label:
7-
description: NFR test to run. Choose between performance, upgrade or all.
7+
description: NFR test to run. Choose between performance, upgrade, or all
88
required: true
99
default: all
1010
type: choice
@@ -13,7 +13,11 @@ on:
1313
description: Version of NGF under test
1414
required: true
1515
default: edge
16-
nginx-plus:
16+
image_tag:
17+
description: Tag of the NGF and NGINX Docker images
18+
required: true
19+
default: edge
20+
nginx_plus:
1721
description: Run tests with NGINX Plus
1822
required: false
1923
default: false
@@ -51,31 +55,18 @@ jobs:
5155
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
5256

5357
- name: Docker Buildx
58+
if: ${{ inputs.nginx_plus == true }}
5459
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
5560

56-
- name: NGF Docker meta
57-
id: ngf-meta
58-
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
59-
with:
60-
images: |
61-
name=gcr.io/${{ secrets.GCP_PROJECT_ID }}/ngf-nfr/nginx-gateway-fabric
62-
tags: |
63-
type=raw,value=${{ inputs.version }}-${{ github.run_id }}
64-
6561
- name: NGINX Docker meta
6662
id: nginx-meta
63+
if: ${{ inputs.nginx_plus == true }}
6764
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
6865
with:
6966
images: |
70-
name=gcr.io/${{ secrets.GCP_PROJECT_ID }}/ngf-nfr/nginx-gateway-fabric/${{ inputs.nginx-plus == true && 'nginx-plus' || 'nginx' }}
67+
name=gcr.io/${{ secrets.GCP_PROJECT_ID }}/ngf-nfr/nginx-gateway-fabric/nginx-plus
7168
tags: |
72-
type=raw,value=${{ inputs.version }}-${{ github.run_id }}
73-
74-
- name: Build binary
75-
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
76-
with:
77-
version: latest
78-
args: build --snapshot --clean
69+
type=raw,value=${{ inputs.image_tag }}
7970
8071
- name: Authenticate to Google Cloud
8172
id: auth
@@ -92,24 +83,14 @@ jobs:
9283
install_components: kubectl
9384

9485
- name: Login to GCR
86+
if: ${{ inputs.nginx_plus == true }}
9587
run: gcloud auth configure-docker gcr.io -q
9688

97-
- name: Build NGF Docker Image
98-
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
99-
with:
100-
file: build/Dockerfile
101-
tags: ${{ steps.ngf-meta.outputs.tags }}
102-
context: "."
103-
provenance: false
104-
platforms: linux/amd64
105-
target: goreleaser
106-
pull: true
107-
push: true
108-
109-
- name: Build NGINX Docker Image
89+
- name: Build NGINX Plus Docker Image
90+
if: ${{ inputs.nginx_plus == true }}
11091
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
11192
with:
112-
file: build/Dockerfile${{ inputs.nginx-plus == true && '.nginxplus' || '.nginx'}}
93+
file: build/Dockerfile.nginxplus
11394
tags: ${{ steps.nginx-meta.outputs.tags }}
11495
context: "."
11596
platforms: linux/amd64
@@ -121,16 +102,16 @@ jobs:
121102
NGINX_CONF_DIR=internal/mode/static/nginx/conf
122103
BUILD_AGENT=gha
123104
secrets: |
124-
${{ inputs.nginx-plus == true && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
125-
${{ inputs.nginx-plus == true && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
105+
${{ format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) }}
106+
${{ format('"nginx-repo.key={0}"', secrets.NGINX_KEY) }}
126107
127108
- name: Setup dotenv file
128109
working-directory: ./tests/scripts
129110
run: |
130111
echo "RESOURCE_NAME=nfr-tests-${{ github.run_id }}" >> vars.env
131-
echo "TAG=${{ inputs.version }}-${{ github.run_id }}" >> vars.env
132-
echo "PREFIX=gcr.io/${{ secrets.GCP_PROJECT_ID }}/ngf-nfr/nginx-gateway-fabric" >> vars.env
133-
echo "NGINX_PREFIX=gcr.io/${{ secrets.GCP_PROJECT_ID }}/ngf-nfr/nginx-gateway-fabric/nginx" >> vars.env
112+
echo "TAG=${{ inputs.image_tag }}" >> vars.env
113+
echo "PREFIX=ghcr.io/nginxinc/nginx-gateway-fabric" >> vars.env
114+
echo "NGINX_PREFIX=ghcr.io/nginxinc/nginx-gateway-fabric/nginx" >> vars.env
134115
echo "NGINX_PLUS_PREFIX=gcr.io/${{ secrets.GCP_PROJECT_ID }}/ngf-nfr/nginx-gateway-fabric/nginx-plus" >> vars.env
135116
echo "GKE_CLUSTER_NAME=nfr-tests-${{ github.run_id }}" >> vars.env
136117
echo "GKE_CLUSTER_ZONE=us-east1-b" >> vars.env
@@ -144,15 +125,16 @@ jobs:
144125
echo "NGF_BRANCH=${{ github.ref_name }}" >> vars.env
145126
echo "SOURCE_IP_RANGE=$(curl -sS -4 icanhazip.com)/32" >> vars.env
146127
echo "ADD_VM_IP_AUTH_NETWORKS=true" >> vars.env
147-
echo "PLUS_ENABLED=${{ inputs.nginx-plus }}" >> vars.env
128+
echo "PLUS_ENABLED=${{ inputs.nginx_plus }}" >> vars.env
148129
echo "GINKGO_LABEL=" >> vars.env
130+
echo "NGF_VERSION=${{ inputs.version }}" >> vars.env
149131
150132
- name: Create GKE cluster
151133
working-directory: ./tests
152134
run:
153135
make create-gke-cluster
154136

155-
- name: Setup VM and router
137+
- name: Create and setup VM
156138
working-directory: ./tests
157139
run:
158140
make create-and-setup-vm
@@ -185,6 +167,9 @@ jobs:
185167
body: |
186168
Update with NFR test results for NGF version ${{ inputs.version }}
187169
- Auto-generated by the NFR tests workflow run ${{ github.run_id }}
170+
- Tests ran using Docker image tag ${{ inputs.image_tag }}
171+
- ${{ inputs.test_label }} test(s) ran
172+
- NGINX Plus enabled: ${{ inputs.nginx_plus }}
188173
labels: |
189174
tests
190175
assignees: ${{ github.actor }}

docs/developer/release-process.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ To create a new release, follow these steps:
2828
format `Release X.Y.Z`.
2929
2. Stop merging any new work into the main branch.
3030
3. Test the main branch for release-readiness. For that, use the `edge` containers, which are built from the main
31-
branch, and the [example applications](/examples).
31+
branch, and run the following:
32+
1. Run the [example applications](/examples) manually and verify their correctness.
33+
2. Kick off the [NFR workflow](https://github.com./nginxinc/nginx-gateway-fabric/actions/nfr.yml) in the browser. For `image_tag`, use `edge`, and for `version`, use the upcoming `X.Y.Z` NGF version. This will run all of the NFR tests which are automated and open a PR with the results files when it is complete. Review this PR and make any necessary changes before merging.
3234
4. If a problem is found, prepare a fix PR, merge it into the main branch and return to the previous step.
3335
5. If the supported Gateway API minor version has changed since the last release, test NGINX Gateway Fabric with the previous version of the Gateway API CRDs.
3436
6. If a compatibility issue is found, add a note to the release notes explaining that the previous version is not supported.

tests/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ GW_SERVICE_TYPE=NodePort
1111
GW_SVC_GKE_INTERNAL=false
1212
GINKGO_LABEL=
1313
GINKGO_FLAGS=
14+
NGF_VERSION=
1415

1516
ifneq ($(GINKGO_LABEL),)
1617
override GINKGO_FLAGS += -ginkgo.label-filter "$(GINKGO_LABEL)"
@@ -48,9 +49,10 @@ load-images-with-plus: ## Load NGF and NGINX Plus images on configured kind clus
4849

4950
test: ## Run the system tests against your default k8s cluster
5051
go test -v ./suite $(GINKGO_FLAGS) -args --gateway-api-version=$(GW_API_VERSION) \
51-
--gateway-api-prev-version=$(GW_API_PREV_VERSION) --image-tag=$(TAG) --plus-enabled=$(PLUS_ENABLED) \
52-
--ngf-image-repo=$(PREFIX) --nginx-image-repo=$(NGINX_PREFIX) --pull-policy=$(PULL_POLICY) \
53-
--k8s-version=$(K8S_VERSION) --service-type=$(GW_SERVICE_TYPE) --is-gke-internal-lb=$(GW_SVC_GKE_INTERNAL)
52+
--gateway-api-prev-version=$(GW_API_PREV_VERSION) --image-tag=$(TAG) --version-under-test=$(NGF_VERSION) \
53+
--plus-enabled=$(PLUS_ENABLED) --ngf-image-repo=$(PREFIX) --nginx-image-repo=$(NGINX_PREFIX) \
54+
--pull-policy=$(PULL_POLICY) --k8s-version=$(K8S_VERSION) --service-type=$(GW_SERVICE_TYPE) \
55+
--is-gke-internal-lb=$(GW_SVC_GKE_INTERNAL)
5456

5557
.PHONY: delete-kind-cluster
5658
delete-kind-cluster: ## Delete kind cluster

tests/scripts/remote-scripts/run-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ source ~/vars.env
66

77
echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile && . $HOME/.profile
88

9-
cd nginx-gateway-fabric/tests && make test TAG=${TAG} PREFIX=${PREFIX} NGINX_PREFIX=${NGINX_PREFIX} NGINX_PLUS_PREFIX=${NGINX_PLUS_PREFIX} PLUS_ENABLED=${PLUS_ENABLED} GINKGO_LABEL=${GINKGO_LABEL} GINKGO_FLAGS=${GINKGO_FLAGS} PULL_POLICY=Always GW_SERVICE_TYPE=LoadBalancer GW_SVC_GKE_INTERNAL=true
9+
cd nginx-gateway-fabric/tests && make test TAG=${TAG} PREFIX=${PREFIX} NGINX_PREFIX=${NGINX_PREFIX} NGINX_PLUS_PREFIX=${NGINX_PLUS_PREFIX} PLUS_ENABLED=${PLUS_ENABLED} GINKGO_LABEL=${GINKGO_LABEL} GINKGO_FLAGS=${GINKGO_FLAGS} PULL_POLICY=Always GW_SERVICE_TYPE=LoadBalancer GW_SVC_GKE_INTERNAL=true NGF_VERSION=${NGF_VERSION}

tests/scripts/vars.env-example

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ GINKGO_FLAGS=<optional flags to pass to the go test command>
1919
SOURCE_IP_RANGE=<IPs that should be allowed SSH to the VM, e.g. 1.2.3.4/32 or $(curl -sS -4 icanhazip.com)/32>
2020
ADD_VM_IP_AUTH_NETWORKS=<if set to true, the script will add the VM IP to the list of the GKE cluster master authorized networks>
2121
PLUS_ENABLED=<enable nginx plus>
22+
NGF_VERSION=<version of NGF being tested. Defaults to value of TAG if not set>

tests/suite/system_suite_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var (
4949
ngfImageRepository = flag.String("ngf-image-repo", "", "Image repo for NGF control plane")
5050
nginxImageRepository = flag.String("nginx-image-repo", "", "Image repo for NGF data plane")
5151
imageTag = flag.String("image-tag", "", "Image tag for NGF images")
52+
versionUnderTest = flag.String("version-under-test", "", "Version of NGF that is being tested")
5253
imagePullPolicy = flag.String("pull-policy", "", "Image pull policy for NGF images")
5354
serviceType = flag.String("service-type", "NodePort", "Type of service fronting NGF to be deployed")
5455
isGKEInternalLB = flag.Bool("is-gke-internal-lb", false, "Is the LB service GKE internal only")
@@ -130,7 +131,9 @@ func setup(cfg setupConfig, extraInstallArgs ...string) {
130131
installCfg.ImagePullPolicy = *imagePullPolicy
131132
}
132133

133-
if *imageTag != "" {
134+
if *versionUnderTest != "" {
135+
version = *versionUnderTest
136+
} else if *imageTag != "" {
134137
version = *imageTag
135138
} else {
136139
version = "edge"

0 commit comments

Comments
 (0)