forked from rancher/fleet
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 2.45 KB
/
benchmark.yml
File metadata and controls
100 lines (83 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Benchmarks
on:
workflow_dispatch:
inputs:
timeout:
description: Per-experiment timeout (e.g., 2m, 5m)
required: false
default: 5m
namespace:
description: Fleet workspace namespace
required: false
default: fleet-local
permissions:
contents: read
concurrency:
group: benchmarks-${{ github.ref }}
cancel-in-progress: true
jobs:
benchmark:
name: Run Fleet Benchmarks
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
cache: true
- name: Install host dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Setup kubectl
uses: azure/setup-kubectl@v4
with:
version: 'latest'
- name: Setup Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Install k3d
uses: AbsaOSS/k3d-action@v2
with:
version: v5.6.3
- name: Create k3d cluster
run: |
# Use default settings; no custom Docker network required
k3d_args="" ./dev/setup-k3d upstream
- name: Build Fleet images
run: |
./dev/build-fleet
- name: Import images to k3d
env:
FLEET_E2E_CLUSTER: k3d-upstream
run: |
./dev/import-images-k3d
- name: Install Fleet to cluster
run: |
./dev/setup-fleet upstream
- name: Label local cluster for benchmarks
run: |
kubectl -n ${{ inputs.namespace }} label clusters.fleet.cattle.io local fleet.cattle.io/benchmark=true --overwrite
- name: Run Benchmarks
env:
FLEET_BENCH_TIMEOUT: ${{ inputs.timeout }}
FLEET_BENCH_NAMESPACE: ${{ inputs.namespace }}
run: |
go run ./benchmarks/cmd run -d benchmarks/db -t "$FLEET_BENCH_TIMEOUT" -n "$FLEET_BENCH_NAMESPACE"
- name: Collect benchmark report filename
id: report
shell: bash
run: |
set -euo pipefail
file=$(ls -1t b-*.json | head -n1)
echo "report=$file" >> "$GITHUB_OUTPUT"
echo "Found report: $file"
- name: Upload benchmark JSON
uses: actions/upload-artifact@v4
with:
name: benchmark-report
path: ${{ steps.report.outputs.report }}