-
Notifications
You must be signed in to change notification settings - Fork 16
167 lines (153 loc) · 5.93 KB
/
bench-aws.yml
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
163
164
165
166
167
name: "Benchmark with Bench client"
on:
push:
branches:
- "ts/add-bench-aws"
release:
types: [published]
jobs:
define-matrix:
name: Define matrix
runs-on: ubuntu-latest
outputs:
types: ${{ steps.types.outputs.type }}
include: ${{ steps.types.outputs.include }}
steps:
- id: types
name: Define matrix
env:
TRIGGER: ${{ github.event_name }}
run: |
set -ex
if [ "$TRIGGER" = 'push' ]; then
echo 'type=["localhost"]' >> "$GITHUB_OUTPUT"
echo 'include=[{"type": "localhost", "ntasks":100, "polling-limit": 300}]' >> "$GITHUB_OUTPUT"
elif [ "$TRIGGER" = 'release' ]; then
echo 'type=["localhost", "aws"]' >> "$GITHUB_OUTPUT"
echo 'include=[{"type": "localhost", "ntasks":100, "polling-limit": 300}, {"type": "aws", "ntasks":1000, "polling-limit": 600}]' >> "$GITHUB_OUTPUT"
fi
test-matrix:
name: Test matrix
runs-on: ubuntu-latest
needs: define-matrix
strategy:
fail-fast: false
matrix:
type: ${{ fromJSON(needs.define-matrix.outputs.type) }}
include: ${{ fromJSON(needs.define-matrix.outputs.include) }}
steps:
- id: test
name: Test matrix
env:
TYPE: ${{ matrix.type }}
NTASKS: ${{ matrix.ntasks }}
POLLING_LIMIT: ${{ matrix.polling-limit }}
run: |
set -ex
echo "Type: $TYPE, Number of tasks: $NTASKS, Polling Limit: $POLLING_LIMIT"
# benchmark:
# name: ${{ matrix.type }}
# runs-on: ubuntu-latest
# # needs: define-matrix
# strategy:
# fail-fast: false
# matrix:
# type: [localhost, aws] # ${{ fromJSON(needs.define-matrix.outputs.type) }}
# include:
# - type: localhost
# ntasks: 100
# polling-limit: 300
# - type: aws
# ntasks: 1000
# polling-limit: 600
# env:
# prefix: benchmark
# outputs:
# terraform-output: ${{ steps.deploy.outputs.terraform-output }}
# armonik-endpoint: ${{ steps.get-armonik-endpoint.outputs.endpoint }}
# steps:
# - name: Checkout
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
# - name: Install Dependencies
# uses: aneoconsulting/ArmoniK.Action.Deploy/dependencies@main
# with:
# terraform: true
# k3s: true
# docker: true
# aws: true
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: eu-west-3
# - name: Get core version
# run: |
# set -ex
# echo "core-version=$(cat versions.tfvars.json | jq -r '.armonik_versions.core')" >> $GITHUB_ENV
# - if: matrix.type == 'aws'
# id: bootstrap-deploy
# name: Deploy Bootstrap
# uses: aneoconsulting/ArmoniK.Action.Deploy/bootstrap-deploy@main
# with:
# type: aws
# prefix: ${{ env.prefix }}
# - id: deploy
# name: "Deploy ArmoniK"
# uses: aneoconsulting/ArmoniK.Action.Deploy/deploy@main
# with:
# type: ${{ matrix.type }}
# prefix: ${{ env.prefix }}
# core-version: ${{ env.core-version }}
# - id: get-armonik-endpoint
# name: "Get ArmoniK's control plane endpoint"
# env:
# TYPE: ${{ matrix.type }}
# run: |
# set -ex
# grpc_endpoint=$(cat "infrastructure/quick-deploy/$TYPE/generated/armonik-output.json" | jq -r '.armonik.control_plane_url' | sed -r 's/(http:\/\/)([^:]*)(:.*)/\2/')
# echo "grpc-endpoint=$grpc_endpoint" >> "$GITHUB_OUTPUT"
# - id: bench
# name: Run Bench
# uses: aneoconsulting/ArmoniK.Action.Deploy/bench@ts/add-bench-action
# with:
# type: ${{ matrix.type }}
# armonik-core-version: ${{ env.core-version }}
# ntasks: ${{ matrix.ntasks }}
# session-name: bench
# grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.grpc-endpoint }}
# kubeconfig-path: ${{ steps.deploy.outputs.generated-folder }}/kubeconfig
# - id: get-bench-stats
# name: Get Bench Stats
# uses: aneoconsulting/ArmoniK.Action.Deploy/get-throughput@main
# with:
# grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.grpc-endpoint }}
# session-name: ${{ steps.bench.outputs.session-name }}
# poll-duration-limit: ${{ matrix.polling-limit }}
# - name: Upload benchmark results to artifact registry
# uses: actions/upload-artifact@v4
# with:
# name: benchclient_benchmark_${{ github.event_name }}_${{ matrix.type }}_${{ github.run_id }}
# path: ${{ steps.get-bench-stats.outputs.bench-file-path }}
# - name: Upload benchmark results to s3
# env:
# EVENT_NAME: ${{ github.event_name }}
# BENCH_RESULTS_PATH: ${{ steps.get-bench-stats.outputs.bench-file-path }}
# TYPE: ${{ matrix.type }}
# GHRUNID: ${{ github.run_id }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_EC2_METADATA_DISABLED: true
# run: |
# aws s3 cp "$BENCH_RESULTS_PATH" "s3://test-armonik-bench-storage/benchclient_benchmark_${EVENT_NAME}_${TYPE}_${GHRUNID}.json"
# - if: always()
# id: destroy
# name: Destroy deployment
# uses: aneoconsulting/ArmoniK.Action.Deploy/destroy@main
# with:
# type: ${{ matrix.type }}
# prefix: ${{ env.prefix }}
# - if: matrix.type == 'aws' && steps.destroy.outcome == 'success'
# id: bootstrap-destroy
# name: Destroy Bootstrap
# uses: aneoconsulting/ArmoniK.Action.Deploy/bootstrap-destroy@main
# with:
# type: aws
# prefix: ${{ env.prefix }}