Skip to content

Commit

Permalink
Merge branch 'l7mp:main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
tyhu05 authored Dec 2, 2024
2 parents 58186cb + 5d1a7b1 commit 87ed328
Show file tree
Hide file tree
Showing 199 changed files with 34,035 additions and 6,783 deletions.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve STUNner
title: ''
labels: ''
assignees: ''

---

### Description

[Description of the problem]

### Steps to Reproduce

[Brief description of the steps you took to encounter the problem, if applicable]

**Expected behavior:** [What you expected to happen]

**Actual behavior:** [What actually happened]

### Versions

[Which version of STUNner you are using]

### Info

[Please copy-paste the output of the below commands and make sure to remove all sensitive information, like usernames, passwords, IP addresses, etc.]

#### Gateway API status

[Output of `kubectl get gateways,gatewayconfigs,gatewayclasses,udproutes.stunner.l7mp.io --all-namespaces -o yaml`]

#### Operator logs

[Output of `kubectl -n stunner-system logs $(kubectl get pods -l control-plane=stunner-gateway-operator-controller-manager --all-namespaces -o jsonpath='{.items[0].metadata.name}')`]
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Run End-to-End Test
name: Run End-to-End Test (dev)

on:
workflow_dispatch:
schedule:
- cron: '0 11 * * 1'
- cron: '0 12 * * 1'

jobs:
e2e_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: '1.23'

- name: Download modules
run: go mod download
Expand All @@ -29,22 +29,22 @@ jobs:
driver: docker
container-runtime: containerd
wait: all
cpus: max
cache: false

- name: Start minikube tunnel
run: minikube tunnel &>mktunnel.log &

- name: Set up Helm
uses: azure/setup-helm@v3
uses: azure/setup-helm@v4
with:
version: v3.11.3
version: v3.16.2

- name: Install STUNner
run: |
helm repo add stunner https://l7mp.io/stunner
helm repo update
helm install stunner-gateway-operator stunner/stunner-gateway-operator-dev --create-namespace --namespace=stunner
helm install stunner stunner/stunner-dev --create-namespace --namespace=stunner
helm install stunner-gateway-operator stunner/stunner-gateway-operator-dev --create-namespace --namespace=stunner --set stunnerGatewayOperator.deployment.container.manager.resources.requests.cpu=200m --set stunnerGatewayOperator.dataplane.spec.resources.requests.cpu=100m
- name: Deploy iperf server
run: kubectl apply -f docs/examples/simple-tunnel/iperf-server.yaml
Expand All @@ -61,12 +61,16 @@ jobs:
- name: Wait for LoadBalancer IP
run: |
while [[ -z $(kubectl get svc udp-gateway -n stunner -o jsonpath="{.status.loadBalancer.ingress[0].ip}") ]]; do echo "Waiting for LoadBalancer IP"; sleep 2; done
for n in {1..60}; do [[ ! -z $(kubectl get svc udp-gateway -n stunner -o jsonpath="{.status.loadBalancer.ingress[0].ip}") ]] && break; echo "Waiting for LoadBalancer IP"; sleep 2; done
echo "* wait for the deployment"
kubectl get all -A
kubectl wait -n stunner --for=condition=Available deployment udp-gateway --timeout 5m
echo "* EVERYTHING UP"
kubectl get all -A
- name: Start turncat
run: |
./turncat --log=all:INFO udp://127.0.0.1:5000 k8s://stunner/stunnerd-config:udp-listener udp://$(kubectl get svc iperf-server -o jsonpath="{.spec.clusterIP}"):5001 &>turncat.log &
./turncat --log=all:INFO udp://127.0.0.1:5000 k8s://stunner/udp-gateway:udp-listener udp://$(kubectl get svc iperf-server -o jsonpath="{.spec.clusterIP}"):5001 &>turncat.log &
sleep 1
- name: Run iperf client
Expand All @@ -86,6 +90,8 @@ jobs:
cat turncat.log
echo "* STUNNER"
kubectl logs -n stunner $(kubectl get pods -n stunner -l app=stunner -o jsonpath='{.items[0].metadata.name}')
echo "* STUNNER-GATEWAY=OPERATOR"
kubectl logs -n stunner $(kubectl get pods -n stunner -l control-plane=stunner-gateway-operator-controller-manager -o jsonpath='{.items[0].metadata.name}')
- name: Check iperf conectivity
run: grep "Server Report" iperf.log
87 changes: 87 additions & 0 deletions .github/workflows/e2e-test-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Run End-to-End Test (stable)

on:
workflow_dispatch:
schedule:
- cron: '0 11 1-7,15-21 * 2'

jobs:
e2e_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install turncat
run: |
URL=`wget -q -O - https://api.github.com/repos/l7mp/stunner/releases/latest | jq -r '.assets[] | select(.name | contains ("turncat")) | select(.name | contains ("linux")) | select(.name | contains ("amd64")) | .browser_download_url'`
wget $URL -O turncat
chmod a+x turncat
- name: Start minikube
uses: medyagh/setup-minikube@master
with:
driver: docker
container-runtime: containerd
wait: all
cache: false

- name: Start minikube tunnel
run: minikube tunnel &>mktunnel.log &

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.16.2

- name: Install STUNner
run: |
helm repo add stunner https://l7mp.io/stunner
helm repo update
helm install stunner-gateway-operator stunner/stunner-gateway-operator --create-namespace --namespace=stunner --set stunnerGatewayOperator.dataplane.mode=managed --set stunnerGatewayOperator.deployment.container.manager.resources.requests.cpu=200m --set stunnerGatewayOperator.dataplane.spec.resources.requests.cpu=100m
- name: Deploy iperf server
run: kubectl apply -f docs/examples/simple-tunnel/iperf-server.yaml

- name: Configure STUNner
run: |
kubectl apply -f docs/examples/simple-tunnel/iperf-stunner.yaml
sleep 75
- name: Install iperf client
run: |
sudo apt-get update
sudo apt-get -y install iperf
- name: Wait for LoadBalancer IP
run: |
for n in {1..60}; do [[ ! -z $(kubectl get svc udp-gateway -n stunner -o jsonpath="{.status.loadBalancer.ingress[0].ip}") ]] && break; echo "Waiting for LoadBalancer IP"; sleep 2; done
kubectl wait -n stunner --for=condition=Available deployment udp-gateway --timeout 5m
kubectl get all -A
- name: Start turncat
run: |
./turncat --log=all:INFO udp://127.0.0.1:5000 k8s://stunner/udp-gateway:udp-listener udp://$(kubectl get svc iperf-server -o jsonpath="{.spec.clusterIP}"):5001 &>turncat.log &
sleep 1
- name: Run iperf client
run: |
iperf -c 127.0.0.1 -p 5000 -u -l 100 -b 5M -t 5 | tee iperf.log
- name: Show logs
run: |
echo "* IPERF"
echo "** Client"
cat iperf.log
echo "** Server"
kubectl logs $(kubectl get pods -l app=iperf-server -o jsonpath='{.items[0].metadata.name}')
echo "* MINIKUBE TUNNEL"
cat mktunnel.log
echo "* TURNCAT"
cat turncat.log
echo "* STUNNER"
kubectl logs -n stunner $(kubectl get pods -n stunner -l app=stunner -o jsonpath='{.items[0].metadata.name}')
echo "* STUNNER-GATEWAY=OPERATOR"
kubectl logs -n stunner $(kubectl get pods -n stunner -l control-plane=stunner-gateway-operator-controller-manager -o jsonpath='{.items[0].metadata.name}')
- name: Check iperf conectivity
run: grep "Server Report" iperf.log
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: '1.23'
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run linters
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
args: --timeout 3m --issues-exit-code=0
args: --timeout 5m
68 changes: 68 additions & 0 deletions .github/workflows/publish--add-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "publish: Add binaries to release assets"

on:
workflow_call:

jobs:
add_binaries:
name: Add binaries to release assets
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
file_end: ""
- os: linux
arch: arm64
file_end: ""

- os: darwin
arch: amd64
file_end: ""
- os: darwin
arch: arm64
file_end: ""

- os: windows
arch: amd64
file_end: ".exe"
- os: windows
arch: arm64
file_end: ".exe"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get version
id: vars
run: echo tag=$(echo ${GITHUB_REF:11}) >> $GITHUB_OUTPUT

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.23'

- name: Build binaries
run: |
export CGO_ENABLED=0 GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}
make build-bin
mv bin/turncat turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
mv bin/stunnerctl stunnerctl-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
- name: Release turncat binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
tag: ${{ github.ref_name }}
asset_name: turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}

- name: Release stunnerctl binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: stunnerctl-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
tag: ${{ github.ref_name }}
asset_name: stunnerctl-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
39 changes: 39 additions & 0 deletions .github/workflows/publish--push-charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "publish: Push Helm charts to web"

on:
workflow_call:
inputs:
dev:
description: Whether to release a dev version
required: true
type: boolean

jobs:
push_charts:
name: Push Helm charts to web
runs-on: ubuntu-latest
steps:
- name: Get version for non-dev release
if: ${{ inputs.dev == false || inputs.dev == 'false' }}
id: vars
run: echo tag=$(echo ${GITHUB_REF:11}) >> $GITHUB_OUTPUT

- name: Trigger release workflow in the stunner-helm repo
if: ${{ inputs.dev == false || inputs.dev == 'false' }}
uses: convictional/[email protected]
with:
github_token: ${{ secrets.WEB_PAT_TOKEN }}
owner: l7mp
repo: stunner-helm
client_payload: '{"tag": "${{ steps.vars.outputs.tag }}", "type": "stunner"}'
workflow_file_name: publish.yaml

- name: Trigger release workflow in the stunner-helm repo
if: ${{ inputs.dev == true || inputs.dev == 'true' }}
uses: convictional/[email protected]
with:
github_token: ${{ secrets.WEB_PAT_TOKEN }}
owner: l7mp
repo: stunner-helm
client_payload: '{"tag": "dev", "type": "stunner"}'
workflow_file_name: publish.yaml
Loading

0 comments on commit 87ed328

Please sign in to comment.