-
Notifications
You must be signed in to change notification settings - Fork 22
162 lines (133 loc) · 5.38 KB
/
e2e_multi_loader.yaml
File metadata and controls
162 lines (133 loc) · 5.38 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: End-to-End Multi-Loader Tests
on:
schedule:
- cron: "0 9 * * 1"
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
env:
GOOS: linux
GO111MODULE: on
jobs:
test-multi-loader:
name: Test Multi-Loader with Knative Deployment
env:
KIND_VERSION: v0.22.0
K8S_VERSION: v1.29
YAML_DIR: workloads/container
runs-on: ubuntu-24.04
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Kubernetes KinD Cluster and install Knative
uses: ./.github/actions/ci_knative_setup
- name: Setup traces for multi trace test
shell: bash
run: bash ./scripts/setup/setup_multi_test_trace.sh
- name: Build and run multi-loader
run: go run tools/multi_loader/multi_loader.go --multiLoaderConfigPath tools/multi_loader/multi_loader_config.json --verbosity debug
- name: Check multi_loader output
run: |
# check if there are 3 output folders: */example_1_test, */example_2_test, */example_3_test
folder_count=$(find data/out/multi-test/*test-experiment/ -mindepth 1 -maxdepth 1 -type d | wc -l)
if [ "$folder_count" -ne 3 ]; then
echo "Output folder count is $folder_count, expected 3"
exit 1
else
echo "Output correct number of folders"
fi
# Check for errors in each output CSV file
for file in $(find . -name "*/example_1_test/experiment_duration_1.csv" -o -name "*/example_2_test/experiment_duration_1.csv" -o -name "*/example_3_test/experiment_duration_1.csv"); do
if [ ! -f "$file" ]; then
echo "File $file not found!"
exit 1
fi
if [ $(grep true "$file" | wc -l) -ne 0 ]; then
echo "Error found in $file"
exit 1
fi
done
echo "No errors found in output files"
- name: Down
if: ${{ always() }}
run: |
kn service delete --all
adv-log-collection:
name: Test Multi-Loader Advanced Log Collection
env:
KIND_VERSION: v0.22.0
K8S_VERSION: v1.29
YAML_DIR: workloads/container
runs-on: ubuntu-24.04
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Kubernetes KinD Cluster and install Knative
uses: ./.github/actions/ci_knative_setup
- name: Setup ssh on KinD Cluster node
shell: bash
run: bash ./scripts/konk-ci/02-kind-ssh.sh
- name: Setup metrics on KinD Cluster
shell: bash
run: bash ./scripts/konk-ci/03-kind-metrics.sh
- name: Setup traces for multi trace test
shell: bash
run: bash ./scripts/setup/setup_multi_test_trace.sh
- name: Setup jq
uses: dcarbone/install-jq-action@v3
- name: Modify multi_loader_config.json for advanced log collection
run: |
metrics='["top", "autoscaler", "activator", "prometheus"]'
# Use jq to modify the JSON file directly
jq --arg m "$metrics" '
.Metrics = ($m | fromjson) |
.Studies[0].TraceValues = ["1"]
' tools/multi_loader/multi_loader_config.json > tmp.json && mv tmp.json tools/multi_loader/multi_loader_config.json
echo "multi_loader_config.json modified successfully"
- name: Build and run multi-loader
run: go run tools/multi_loader/multi_loader.go --multiLoaderConfigPath tools/multi_loader/multi_loader_config.json --verbosity debug
- name: Check multi_loader output
run: |
# check if there are 2 output folders: *_example_1_test & dry_run
folder_count=$(find data/out/multi-test -mindepth 1 -maxdepth 1 -type d | wc -l)
if [ "$folder_count" -ne 2 ]; then
echo "Output folder count is $folder_count, expected 2"
exit 1
else
echo "Output correct number of folders"
fi
# Check for errors in output CSV file
file=$(find . -wholename "*/example_1_test/experiment_duration_1.csv")
if [ ! -f "$file" ]; then
echo "File $file not found!"
exit 1
fi
if [ $(grep true "$file" | wc -l) -ne 0 ]; then
echo "Error found in $file"
exit 1
fi
# Check if advanced logs output are present
# in data/out/multi-test/*/example_1_test/, there should be folders called ["top", "autoscaler", "activator", "prometheus_snapshot"] and each folder should have at least one file
for metric in top autoscaler activator prometheus_snapshot; do
folder="data/out/multi-test/*/example_1_test/$metric"
if [ ! -d $folder ]; then
echo "Folder $metric not found! Expected to find $metric folder"
exit 1
fi
if [ $(find data/out/multi-test/*/example_1_test/$metric -type f | wc -l) -eq 0 ]; then
echo "No files found in $metric folder, expected at least one"
exit 1
fi
done
echo "Advanced logs output present, found files for activators, autoscaler, top and prometheus"
echo "No errors found in output files"
- name: Down
if: ${{ always() }}
run: |
kn service delete --all