-
Notifications
You must be signed in to change notification settings - Fork 16
/
action.yml
212 lines (200 loc) · 8.29 KB
/
action.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: 'Deploy ArmoniK Infra'
description: 'Action to deploy ArmoniK infra in current github workflow'
inputs:
control-plane-image:
description: 'Repository/image for control plane docker image'
required: false
default: 'None'
polling-agent-image:
description: 'Repository/image for polling agent docker image'
required: false
default: 'None'
worker-image:
description: 'Repository/image for worker docker image'
required: false
default: 'None'
metrics-exporter-image:
description: 'Repository/image for metrics exporter docker image'
required: false
default: 'None'
partition-metrics-exporter-image:
description: 'Repository/image for partition metrics exporter docker image'
required: false
default: 'None'
admin-api-image:
description: 'Repository/image for Admi GUI API docker image'
required: false
default: 'None'
admin-app-image:
description: 'Repository/image for Admi GUI APP docker image'
required: false
default: 'None'
core-tag:
description: 'ArmoniK Core tag'
required: false
default: 'None'
worker-tag:
description: 'ArmoniK worker tag'
required: false
default: 'None'
admin-gui-tag:
description: 'ArmoniK Admin GUI tag'
required: false
default: 'None'
docker-is-installed:
description: 'Is docker installed ?'
required: false
default: 'false'
log-level:
description: 'Log Level'
required: false
default: 'Information'
ingress:
description: 'Use ingress'
required: false
default: 'None'
mtls:
description: 'Use mTLS'
required: false
default: 'false'
tls:
description: 'Use tls'
required: false
default: 'false'
outputs:
host-path:
description: 'Path of the shared storage between workers'
value: ${{ steps.sethostpath.outputs.host-path }}
runs:
using: composite
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release jq python3 python-is-python3 python3-pip
pip install python-hcl2 jsonpath-ng
- if: ${{ inputs.docker-is-installed != 'true' }}
name: Install docker
shell: bash
run: |
if ! which docker 2>/dev/null; then
cd ${{ github.action_path }}
sh tools/install/docker.sh
fi
- name: Install kubectl
shell: bash
run: |
if ! which kubectl 2>/dev/null; then
cd ${{ github.action_path }}
sh tools/install/kubectl.sh
fi
- name: Install terraform
shell: bash
run: |
if ! which terraform 2>/dev/null; then
cd ${{ github.action_path }}
sh tools/install/terraform.sh
fi
- name: Install K3s
shell: bash
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.25.6+k3s1" sh -s - --write-kubeconfig-mode 644 --docker --write-kubeconfig ~/.kube/config
- name: Set the name path of the shared storage
id: sethostpath
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
echo "host-path=${ARMONIK_SHARED_HOST_PATH}" >> $GITHUB_OUTPUT
- name: Create shared host path directory
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
mkdir -p ${ARMONIK_SHARED_HOST_PATH}
- name: Create Kubernetes namespace
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
make create-namespace
- name: Deploy KEDA
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
make deploy-keda
- name: Deploy storage
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
make deploy-storage
- name: Deploy monitoring
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
python ${{ github.action_path }}/tools/modify_parameters.py \
-kv "monitoring.metrics_exporter.image=${{ inputs.metrics-exporter-image }}" \
-kv "monitoring.metrics_exporter.tag=${{ inputs.core-tag }}" \
-kv "monitoring.partition_metrics_exporter.image=${{ inputs.partition-metrics-exporter-image }}" \
-kv "monitoring.partition_metrics_exporter.tag=${{ inputs.core-tag }}" \
${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/monitoring/parameters.tfvars \
${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/monitoring/parameters.tfvars.json
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
make deploy-monitoring PARAMETERS_FILE=${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/monitoring/parameters.tfvars.json
- name: Deploy ArmoniK
shell: bash
run: |
set -ex
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
source envvars.sh
if [ -z ${{ inputs.ingress }} ]; then
python ${{ github.action_path }}/tools/modify_parameters.py \
-kv "compute_plane[default].worker[*].image=${{ inputs.worker-image }}" \
-kv "compute_plane[default].worker[*].tag=${{ inputs.worker-tag }}" \
-kv "compute_plane[default].polling_agent.image=${{ inputs.polling-agent-image }}" \
-kv "compute_plane[default].polling_agent.tag=${{ inputs.core-tag }}" \
-kv control_plane.image=${{ inputs.control-plane-image }} \
-kv control_plane.tag=${{ inputs.core-tag }} \
-kv admin_gui.api.image=${{ inputs.admin-api-image }} \
-kv admin_gui.api.tag=${{ inputs.admin-gui-tag }} \
-kv admin_gui.app.image=${{ inputs.admin-app-image }} \
-kv admin_gui.app.tag=${{ inputs.admin-gui-tag }} \
-kv logging_level=${{ inputs.log-level }} \
-kv ingress=null \
-kv authentication.require_authentication=false \
-kv authentication.require_authorization=false \
${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars \
${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars.json
else
python ${{ github.action_path }}/tools/modify_parameters.py \
-kv "compute_plane[default].worker[*].image=${{ inputs.worker-image }}" \
-kv "compute_plane[default].worker[*].tag=${{ inputs.worker-tag }}" \
-kv "compute_plane[default].polling_agent.image=${{ inputs.polling-agent-image }}" \
-kv "compute_plane[default].polling_agent.tag=${{ inputs.core-tag }}" \
-kv control_plane.image=${{ inputs.control-plane-image }} \
-kv control_plane.tag=${{ inputs.core-tag }} \
-kv admin_gui.api.image=${{ inputs.admin-api-image }} \
-kv admin_gui.api.tag=${{ inputs.admin-gui-tag }} \
-kv admin_gui.app.image=${{ inputs.admin-app-image }} \
-kv admin_gui.app.tag=${{ inputs.admin-gui-tag }} \
-kv logging_level=${{ inputs.log-level }} \
-kv ingress.tls=${{ inputs.tls }} \
-kv ingress.mtls=${{ inputs.mtls }} \
-kv ingress.generate_client_cert=false \
-kv authentication.require_authentication=false \
-kv authentication.require_authorization=false \
${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars \
${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars.json
fi
cd ${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages
make deploy-armonik PARAMETERS_FILE=${{ github.action_path }}/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars.json