Skip to content

Commit

Permalink
Move stpes to makefile targets.
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Huang <xin1.huang@intel.com>
  • Loading branch information
gyohuangxin committed Feb 19, 2024
1 parent 98cfcc5 commit c54478e
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 25 deletions.
60 changes: 35 additions & 25 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,45 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Kubernetes
uses: medyagh/setup-minikube@master

- name: Install Envoy Gateway Pods via Kubernetes Yaml
run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/install.yaml

- name: Wait for Envoy Gateway to become available
run: kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available

- name: Install the GatewayClass, Gateway, HTTPRoute and example app
run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/quickstart.yaml -n default
- name: Download Nighthawk Docker images
run: |
docker pull envoyproxy/nighthawk-dev:latest
- name: Wait for example app to become available
run: kubectl wait --timeout=5m -n default deployment/backend --for=condition=Available
- name: Run Benchmark tests
env:
KIND_NODE_TAG: v1.29.0
IMAGE_PULL_POLICY: IfNotPresent
run: make benchmark

- name: Get the name of the Envoy service created the by the example Gateway
run: |
echo "ENVOY_SERVICE=$(kubectl get svc -n envoy-gateway-system --selector=gateway.envoyproxy.io/owning-gateway-namespace=default,gateway.envoyproxy.io/owning-gateway-name=eg -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV
# - name: Setup Kubernetes
# uses: medyagh/setup-minikube@master

- name: Echo ENVOY_SERVICE
run: echo ${{ env.ENVOY_SERVICE }}

- name: Port forward to the Envoy service
run: kubectl -n envoy-gateway-system port-forward service/${ENVOY_SERVICE} 8888:80 &

- name: Curl the example app through Envoy proxy
run: |
curl --verbose --header "Host: www.example.com" http://localhost:8888/get
# - name: Install Envoy Gateway Pods via Kubernetes Yaml
# run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/install.yaml

# - name: Wait for Envoy Gateway to become available
# run: kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available
#
# - name: Install the GatewayClass, Gateway, HTTPRoute and example app
# run: kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/quickstart.yaml -n default
#
# - name: Wait for example app to become available
# run: kubectl wait --timeout=5m -n default deployment/backend --for=condition=Available
#
# - name: Get the name of the Envoy service created the by the example Gateway
# run: |
# echo "ENVOY_SERVICE=$(kubectl get svc -n envoy-gateway-system --selector=gateway.envoyproxy.io/owning-gateway-namespace=default,gateway.envoyproxy.io/owning-gateway-name=eg -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV

# - name: Echo ENVOY_SERVICE
# run: echo ${{ env.ENVOY_SERVICE }}
#
# - name: Port forward to the Envoy service
# run: kubectl -n envoy-gateway-system port-forward service/${ENVOY_SERVICE} 8888:80 &
#
# - name: Curl the example app through Envoy proxy
# run: |
# curl --verbose --header "Host: www.example.com" http://localhost:8888/get

#- name: Apply Gateway Configurations
#
Expand Down
7 changes: 7 additions & 0 deletions test/benchmark/benchmark-test-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Nighthawk test server configuration

### Nighthawk test server deployment

### Gateway

### HTTPRoute
47 changes: 47 additions & 0 deletions test/benchmark/test-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
static_resources:
listeners:
# define an origin server on :10000 that always returns "lorem ipsum..."
- address:
socket_address:
address: 0.0.0.0
port_value: 10000
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
generate_request_id: false
codec_type: AUTO
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: service
domains:
- "*"
http_filters:
- name: dynamic-delay
typed_config:
"@type": type.googleapis.com/nighthawk.server.DynamicDelayConfiguration
static_delay: 0.5s
- name: test-server # before envoy.router because order matters!
typed_config:
"@type": type.googleapis.com/nighthawk.server.ResponseOptions
response_body_size: 10
v3_response_headers:
- { header: { key: "foo", value: "bar" } }
- {
header: { key: "foo", value: "bar2" },
append: true,
}
- { header: { key: "x-nh", value: "1" } }
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
dynamic_stats: false
admin:
access_log_path: /tmp/envoy.log
address:
socket_address:
address: 0.0.0.0
port_value: 8081
17 changes: 17 additions & 0 deletions tools/make/kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ conformance: create-cluster kube-install-image kube-deploy run-conformance delet
.PHONY: experimental-conformance ## Create a kind cluster, deploy EG into it, run Gateway API experimental conformance, and clean up.
experimental-conformance: create-cluster kube-install-image kube-deploy run-experimental-conformance delete-cluster ## Create a kind cluster, deploy EG into it, run Gateway API conformance, and clean up.

.PHONY: benchmark
benchmark: create-cluster kube-install-image kube-deploy build-benchmark run-benchmark

.PHONY: e2e
e2e: create-cluster kube-install-image kube-deploy install-ratelimit run-e2e delete-cluster

Expand Down Expand Up @@ -182,6 +185,20 @@ run-experimental-conformance: ## Run Experimental Gateway API conformance.
kubectl apply -f test/config/gatewayclass.yaml
go test -v -tags experimental ./test/conformance -run TestExperimentalConformance --gateway-class=envoy-gateway --debug=true --organization=envoyproxy --project=envoy-gateway --url=https://github.com/envoyproxy/gateway --version=latest --report-output="$(CONFORMANCE_REPORT_PATH)" --contact=https://github.com/envoyproxy/gateway/blob/main/GOVERNANCE.md

.PHONY: build-benchmark
build-benchmark ## Build Benchmark Framework
@$(LOG_TARGET)
git clone -b 0.5.0 https://github.com/envoyproxy/nighthawk.git && cd nighthawk
ci/do_ci.sh build

.PHONY: run-benchmark
run-benchmark: ## Run benchmark tests
@$(LOG_TARGET)
kubectl wait --timeout=$(WAIT_TIMEOUT) -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available
kubectl apply -f test/config/gatewayclass.yaml
# kubectl create configmap test-server-config --from-file=test/benchmark/test-server.yaml --output yaml
kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/v0.6.0/quickstart.yaml -n default

.PHONY: delete-cluster
delete-cluster: $(tools/kind) ## Delete kind cluster.
@$(LOG_TARGET)
Expand Down

0 comments on commit c54478e

Please sign in to comment.