Repository: envoyproxy/gateway
Pull request #3692 (2024-06-28 01:49:01)

chore: move benchmark-test job in build_and_test.yaml
**What type of PR is this?**
<!--
Your PR title should be descriptive, and generally start with type that contains a subsystem name with `()` if necessary 
and summary followed by a colon. format `chore/docs/api/feat/fix/refactor/style/test: summary`.
Examples:
* "docs: fix grammar error"
* "feat(translator): add new feature"
* "fix: fix xx bug"
* "chore: change ci & build tools etc"
* "api: add xxx fields in ClientTrafficPolicy"
-->

<!--
NOTE: If your PR contains any API changes (changes under `/api`), we recommend you to separate these API changes into
a new PR, and we will review the API part first. It will save you lots of implementation time if the API get accepted.
-->

**What this PR does / why we need it**:

Runs after `build` is succeeded, save some time in CI.

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/envoyproxy/gateway/pull/3692?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=envoyproxy) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 68.52%. Comparing base [(`2a86997`)](https://app.codecov.io/gh/envoyproxy/gateway/commit/2a869970e33f02855c38b42a8d19c47d2c43cad9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=envoyproxy) to head [(`829fbb1`)](https://app.codecov.io/gh/envoyproxy/gateway/commit/829fbb14d32462744c9342697502159b7e25ee91?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=envoyproxy).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #3692      +/-   ##
==========================================
- Coverage   68.55%   68.52%   -0.03%     
==========================================
  Files         170      170              
  Lines       20690    20690              
==========================================
- Hits        14183    14178       -5     
- Misses       5492     5496       +4     
- Partials     1015     1016       +1     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/envoyproxy/gateway/pull/3692?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=envoyproxy).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=envoyproxy).

shawnh2: /retest

Patch:
diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml
deleted file mode 100644
index 9f87ca4cb..000000000
--- a/.github/workflows/benchmark.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-name: Benchmarking Tests at Scale
-on:
-  pull_request:
-    branches:
-      - "main"
-      - "release/v*"
-  workflow_dispatch:
-    inputs:
-      rps:
-        description: "The target requests-per-second rate. Default: 10000"
-        default: '10000'
-        type: string
-        required: false
-      connections:
-        description: "The maximum allowed number of concurrent connections per event loop. HTTP/1 only. Default: 100."
-        default: '100'
-        type: string
-        required: false
-      duration:
-        description: "The number of seconds that the test should run. Default: 90."
-        default: '90'
-        type: string
-        required: false
-      cpu_limits:
-        description: "The CPU resource limits for the envoy gateway, in unit 'm'. Default: 1000."
-        default: '1000'
-        type: string
-        required: false
-      memory_limits:
-        description: "The memory resource limits for the envoy gateway, in unit 'Mi'. Default: 1024."
-        default: '1024'
-        type: string
-        required: false
-
-jobs:
-  benchmark-test:
-    name: Benchmark Test
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-
-      - uses: ./tools/github-actions/setup-deps
-
-      - name: Run Benchmark tests
-        env:
-          KIND_NODE_TAG: v1.28.0
-          IMAGE_PULL_POLICY: IfNotPresent
-          BENCHMARK_RPS: ${{ github.event.inputs.rps || 10000 }}
-          BENCHMARK_CONNECTIONS: ${{ github.event.inputs.connections || 100 }}
-          BENCHMARK_DURATION: ${{ github.event.inputs.duration || 90 }}
-          BENCHMARK_CPU_LIMITS: ${{ github.event.inputs.cpu_limits || 1000 }}
-          BENCHMARK_MEMORY_LIMITS: ${{ github.event.inputs.memory_limits || 2048 }}
-        run: make benchmark
-
-      - name: Read Benchmark report
-        run: cat test/benchmark/benchmark_report.md
diff --git a/internal/gatewayapi/envoyextensionpolicy.go b/internal/gatewayapi/envoyextensionpolicy.go
index af7904ec3..5baecbcb5 100644
--- a/internal/gatewayapi/envoyextensionpolicy.go
+++ b/internal/gatewayapi/envoyextensionpolicy.go
@@ -430,7 +430,7 @@ func (t *Translator) buildExtProcs(policy *egv1a1.EnvoyExtensionPolicy, resource
 	}
 
 	for idx, ep := range policy.Spec.ExtProc {
-		name := irConfigNameForEEP(policy, idx)
+		name := irConfigNameForExtProc(policy, idx)
 		extProcIR, err := t.buildExtProc(name, utils.NamespacedName(policy), ep, idx, resources, envoyProxy)
 		if err != nil {
 			return nil, err
@@ -534,12 +534,11 @@ func (t *Translator) buildExtProc(
 	return extProcIR, err
 }
 
-func irConfigNameForEEP(policy *egv1a1.EnvoyExtensionPolicy, idx int) string {
+func irConfigNameForExtProc(policy *egv1a1.EnvoyExtensionPolicy, index int) string {
 	return fmt.Sprintf(
-		"%s/%s/%d",
-		strings.ToLower(egv1a1.KindEnvoyExtensionPolicy),
-		utils.NamespacedName(policy).String(),
-		idx)
+		"%s/extproc/%s",
+		irConfigName(policy),
+		strconv.Itoa(index))
 }
 
 func (t *Translator) buildWasms(
diff --git a/internal/gatewayapi/status/gateway.go b/internal/gatewayapi/status/gateway.go
index aeeabf88d..e9c204066 100644
--- a/internal/gatewayapi/status/gateway.go
+++ b/internal/gatewayapi/status/gateway.go
@@ -75,7 +75,7 @@ func UpdateGatewayStatusProgrammedCondition(gw *gwapiv1.Gateway, svc *corev1.Ser
 			}
 		}
 
-		var gwAddresses []gwapiv1.GatewayStatusAddress
+		gwAddresses := make([]gwapiv1.GatewayStatusAddress, 0, len(addresses)+len(hostnames))
 		for i := range addresses {
 			addr := gwapiv1.GatewayStatusAddress{
 				Type:  ptr.To(gwapiv1.IPAddressType),
diff --git a/site/content/en/v0.6.0/user/customize-envoyproxy.md b/site/content/en/v0.6.0/user/customize-envoyproxy.md
index 356a3d7b0..7f9bfb7cd 100644
--- a/site/content/en/v0.6.0/user/customize-envoyproxy.md
+++ b/site/content/en/v0.6.0/user/customize-envoyproxy.md
@@ -236,7 +236,7 @@ metadata:
 spec:
   bootstrap:
     type: Replace
-    bootstrap: |
+    value: |
       admin:
         access_log:
         - name: envoy.access_loggers.file


Test patch:
diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml
index 72a03539a..f7079180f 100644
--- a/.github/workflows/build_and_test.yaml
+++ b/.github/workflows/build_and_test.yaml
@@ -135,6 +135,29 @@ jobs:
         IMAGE_PULL_POLICY: IfNotPresent
       run: make e2e
 
+  benchmark-test:
+    runs-on: ubuntu-latest
+    needs: [build]
+    steps:
+    - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332  # v4.1.7
+    - uses: ./tools/github-actions/setup-deps
+
+    # Benchmark
+    - name: Run Benchmark tests
+      env:
+        KIND_NODE_TAG: v1.28.9
+        IMAGE_PULL_POLICY: IfNotPresent
+        # Args for benchmark test
+        BENCHMARK_RPS: 10000
+        BENCHMARK_CONNECTIONS: 100
+        BENCHMARK_DURATION: 30
+        BENCHMARK_CPU_LIMITS: 1000
+        BENCHMARK_MEMORY_LIMITS: 2000
+      run: make benchmark
+
+    - name: Read Benchmark report
+      run: cat test/benchmark/benchmark_report.md
+
   publish:
     runs-on: ubuntu-latest
     needs: [conformance-test, e2e-test]
diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml
index 76a40d590..295ca972e 100644
--- a/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml
+++ b/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml
@@ -230,7 +230,7 @@ xdsIR:
             settings:
             - protocol: GRPC
               weight: 1
-          name: envoyextensionpolicy/default/policy-for-route-1/0
+          name: envoyextensionpolicy/default/policy-for-route-1/extproc/0
         hostname: gateway.envoyproxy.io
         isHTTP2: false
         name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
@@ -254,7 +254,7 @@ xdsIR:
             settings:
             - protocol: GRPC
               weight: 1
-          name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0
+          name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0
         hostname: gateway.envoyproxy.io
         isHTTP2: false
         name: httproute/default/httproute-2/rule/0/match/0/gateway_envoyproxy_io
diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml
index c5accb662..4be44031a 100644
--- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml
+++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml
@@ -315,7 +315,7 @@ xdsIR:
                   name: policy-btls-grpc-2/default-ca
                 sni: grpc-backend-2
               weight: 1
-          name: envoyextensionpolicy/default/policy-for-http-route/0
+          name: envoyextensionpolicy/default/policy-for-http-route/extproc/0
           requestHeaderProcessing: true
           responseHeaderProcessing: true
         hostname: www.foo.com
@@ -349,7 +349,7 @@ xdsIR:
               weight: 1
           failOpen: true
           messageTimeout: 5s
-          name: envoyextensionpolicy/default/policy-for-gateway/0
+          name: envoyextensionpolicy/default/policy-for-gateway/extproc/0
           requestBodyProcessingMode: Buffered
           requestHeaderProcessing: true
           responseBodyProcessingMode: Streamed
diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml
index dcc1e7522..800cafff0 100644
--- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml
+++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml
@@ -335,7 +335,7 @@ xdsIR:
                   name: policy-btls-backend-ip/envoy-gateway-ca
                 sni: ip-backend
               weight: 1
-          name: envoyextensionpolicy/default/policy-for-http-route/0
+          name: envoyextensionpolicy/default/policy-for-http-route/extproc/0
         hostname: www.foo.com
         isHTTP2: false
         name: httproute/default/httproute-1/rule/0/match/0/www_foo_com
diff --git a/internal/gatewayapi/testdata/envoyproxy-accesslog-cel-with-invalid.in.yaml b/internal/gatewayapi/testdata/envoyproxy-accesslog-cel-with-invalid.in.yaml
index dd96ed4b0..38d1e20e0 100644
--- a/internal/gatewayapi/testdata/envoyproxy-accesslog-cel-with-invalid.in.yaml
+++ b/internal/gatewayapi/testdata/envoyproxy-accesslog-cel-with-invalid.in.yaml
@@ -10,7 +10,7 @@ envoyProxyForGatewayClass:
         settings:
         - matches:
           - "response.code >= 400"
-          - ")++++" # invalid CEL expression will be ignored
+          - ")++++"
           format:
             type: Text
             text: |
diff --git a/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml b/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml
index 64773de0a..8209c2947 100644
--- a/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml
+++ b/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml
@@ -19,7 +19,7 @@ http:
               protocol: HTTP
               weight: 1
         extProc:
-          - name: envoyextensionpolicy/default/policy-for-route-2/0
+          - name: envoyextensionpolicy/default/policy-for-route-2/extproc/0
             failOpen: true
             messageTimeout: 5s
             requestHeaderProcessing: true
@@ -31,7 +31,7 @@ http:
               settings:
                 - protocol: GRPC
                   weight: 1
-          - name: envoyextensionpolicy/default/policy-for-route-1/0
+          - name: envoyextensionpolicy/default/policy-for-route-1/extproc/0
             failOpen: true
             messageTimeout: 5s
             responseHeaderProcessing: true
@@ -59,14 +59,14 @@ http:
               protocol: HTTP
               weight: 1
         extProc:
-          - name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0
+          - name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/extproc/0
             authority: grpc-backend-3.envoy-gateway:3000
             destination:
               name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0/grpc-backend-3
               settings:
                 - protocol: GRPC
                   weight: 1
-          - name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0
+          - name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0
             failOpen: false
             messageTimeout: 15s
             authority: grpc-backend.envoy-gateway:9000
diff --git a/internal/xds/translator/testdata/out/xds-ir/ext-proc.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/ext-proc.listeners.yaml
index eed8c83a0..8e85e79cf 100755
--- a/internal/xds/translator/testdata/out/xds-ir/ext-proc.listeners.yaml
+++ b/internal/xds/translator/testdata/out/xds-ir/ext-proc.listeners.yaml
@@ -15,7 +15,7 @@
           maxConcurrentStreams: 100
         httpFilters:
         - disabled: true
-          name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/0
+          name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/extproc/0
           typedConfig:
             '@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
             failureModeAllow: true
@@ -33,7 +33,7 @@
               responseHeaderMode: SKIP
               responseTrailerMode: SKIP
         - disabled: true
-          name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/0
+          name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/extproc/0
           typedConfig:
             '@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
             failureModeAllow: true
@@ -50,7 +50,7 @@
               responseHeaderMode: SEND
               responseTrailerMode: SKIP
         - disabled: true
-          name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0
+          name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/extproc/0
           typedConfig:
             '@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
             grpcService:
@@ -64,7 +64,7 @@
               responseHeaderMode: SKIP
               responseTrailerMode: SKIP
         - disabled: true
-          name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0
+          name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0
           typedConfig:
             '@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
             grpcService:
diff --git a/internal/xds/translator/testdata/out/xds-ir/ext-proc.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ext-proc.routes.yaml
index 0daf1919c..c17e6456d 100755
--- a/internal/xds/translator/testdata/out/xds-ir/ext-proc.routes.yaml
+++ b/internal/xds/translator/testdata/out/xds-ir/ext-proc.routes.yaml
@@ -13,10 +13,10 @@
         upgradeConfigs:
         - upgradeType: websocket
       typedPerFilterConfig:
-        envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/0:
+        envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/extproc/0:
           '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
           config: {}
-        envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/0:
+        envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/extproc/0:
           '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
           config: {}
     - match:
@@ -27,9 +27,9 @@
         upgradeConfigs:
         - upgradeType: websocket
       typedPerFilterConfig:
-        envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0:
+        envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0:
           '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
           config: {}
-        envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0:
+        envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/extproc/0:
           '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
           config: {}