-
Notifications
You must be signed in to change notification settings - Fork 29
144 lines (140 loc) · 5.38 KB
/
benchmark.yaml
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
name: Benchmark
on:
push:
branches:
- main
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
jobs:
benchmark-for-awslogs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ] # TODO: Add Windows e2e tests: https://github.com/aws/shim-loggers-for-containerd/issues/68
name: Benchmark / awslogs / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: Start LocalStack
shell: bash
run: scripts/start-localstack
- name: install and start containerd
shell: bash
run: sudo scripts/install-containerd
- name: start ecs local endpoint
shell: bash
run: scripts/start-ecs-local-endpoint
- name: ip forwarding # awslogs driver hardcodes "169.254.170.2" as the aws credential endpoint ip so need to forward to local endpoint
shell: bash
run: sudo scripts/ip-forwarding
- name: build
run: sudo make build
- name: Run benchmark
run: sudo -E make test-benchmark-for-awslogs | tee benchmark-for-awslogs.txt
shell: bash
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Benchmark for awslogs
tool: 'go'
benchmark-data-dir-path: "dev/bench/awslogs/ubuntu"
output-file-path: benchmark-for-awslogs.txt
- name: Push benchmark result
run: git push 'https://github.com/aws/shim-loggers-for-containerd.git' gh-pages:gh-pages
benchmark-for-fluentd:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ] # TODO: Add Windows e2e tests: https://github.com/aws/shim-loggers-for-containerd/issues/68
name: Benchmark / fluentd / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: install and start containerd
shell: bash
run: sudo scripts/install-containerd
- name: start fluentd local endpoint
shell: bash
run: scripts/start-fluentd-local-endpoint
- name: build
run: sudo make build
- name: Run benchmark
run: sudo make test-benchmark-for-fluentd | tee benchmark-for-fluentd.txt
shell: bash
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Benchmark for awslogs
tool: 'go'
benchmark-data-dir-path: "dev/bench/fluentd/ubuntu"
output-file-path: benchmark-for-fluentd.txt
- name: Push benchmark result
run: git push 'https://github.com/aws/shim-loggers-for-containerd.git' gh-pages:gh-pages
benchmark-for-splunk:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ] # TODO: Add Windows e2e tests: https://github.com/aws/shim-loggers-for-containerd/issues/68
name: Benchmark / splunk / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: install and start containerd
shell: bash
run: sudo scripts/install-containerd
- name: start splunk local endpoint
id: splunk-local-endpoint
shell: bash
run: |
SPLUNK_PASSWORD=1234567Aa!
SPLUNK_PORT=8089
SPLUNK_IMAGE=splunk/splunk
CONTAINER_ID=$(docker run -d -p $SPLUNK_PORT:8089 -p 8088:8088 \
-e "SPLUNK_START_ARGS=--accept-license" \
-e "SPLUNK_PASSWORD=$SPLUNK_PASSWORD" \
-e "SPLUNK_HEC_TOKEN=abcd1234" \
$SPLUNK_IMAGE)
: # Splunk can only receives requests after becoming healthy
until [ $(docker inspect $CONTAINER_ID --format ‘{{.State.Health.Status}}’) == ‘healthy’ ]; do sleep 10s; done;
curl -L -k -u admin:$SPLUNK_PASSWORD \
-X POST https://localhost:$SPLUNK_PORT/services/admin/token-auth/tokens_auth \
-d disabled=false
: # Wait for token to be enabled
sleep 5
TOKEN_OUTPUT=$(curl -L -k -u admin:$SPLUNK_PASSWORD \
-X POST https://localhost:$SPLUNK_PORT/services/authorization/tokens?output_mode=json \
-d name=admin -d audience=tests)
SPLUNK_TOKEN=$(echo $TOKEN_OUTPUT | jq -r '.entry[0].content.token')
echo "SPLUNK_TOKEN=$SPLUNK_TOKEN" >> $GITHUB_OUTPUT
- name: build
run: sudo make build
- name: Run benchmark
run: sudo SPLUNK_TOKEN=${{ steps.splunk-local-endpoint.outputs.SPLUNK_TOKEN }} make test-benchmark-for-splunk | tee benchmark-for-splunk.txt
shell: bash
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Benchmark for splunk
tool: 'go'
benchmark-data-dir-path: "dev/bench/splunk/ubuntu"
output-file-path: benchmark-for-splunk.txt
- name: Push benchmark result
run: git push 'https://github.com/aws/shim-loggers-for-containerd.git' gh-pages:gh-pages