-
Notifications
You must be signed in to change notification settings - Fork 1
230 lines (186 loc) · 10.3 KB
/
night.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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# GitHub runner seems not to support ipv6, thus, we can not test on bwCloud.
# See https://github.com/actions/runner-images/issues/668
name: Night
on:
workflow_dispatch:
schedule:
- cron: '20 4 * * 2'
push:
branches:
- fix-night-workflow
concurrency: night
jobs:
night:
name: Night
runs-on: ubuntu-22.04
steps:
###################################################
#
# Prepare
#
###################################################
- name: (PREPARE) Checkout Repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Setup Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}"
- name: (PREPARE) Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v1
with:
version: 438.0.0
- name: (PREPARE) Setup GCP credentials
uses: actions/github-script@v3
with:
script: |
if (!process.env.GCP_CREDENTIALS) throw 'GCP_CREDENTIALS undefined'
const fs = require('fs')
const file = 'gcp-credentials.json'
const content = new Buffer.from(process.env.GCP_CREDENTIALS, 'base64').toString('utf-8')
fs.writeFileSync(file, content)
env:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
- name: (PREPARE) Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.10.13
cache: pip
- name: (PREPARE) Install xOpera
run: sudo ./src/assets/scripts/install-xopera.sh
- name: (PREPARE) Cache Unfurl
uses: actions/cache@v3
with:
path: /home/runner/.unfurl_home
key: unfurl-home
# TODO: ./src/assets/scripts/install-unfurl.sh installs unfurl for root and not for "runner"
- name: (PREPARE) Install Unfurl
run: pip install unfurl==0.7.1
- name: (PREPARE) Set up Unfurl
run: yes | unfurl home --init
###################################################
#
# Installation
#
###################################################
- name: (INSTALLATION) Install vintner
run: curl -fsSL https://vintner.opentosca.org/install.sh | sudo bash -
- name: (INSTALLATION) Verify signature
run: |
curl https://vintner.opentosca.org/vintner-release.gpg | gpg --import
wget https://github.com/opentosca/opentosca-vintner/releases/download/latest/vintner-linux-x64.asc
gpg --verify vintner-linux-x64.asc /usr/bin/vintner
###################################################
#
# Vintner
#
###################################################
- name: (VINTNER) Ensure that version is overridden
run: |
if [ "$(vintner --version)" == "__VERSION__" ]; then
exit 1
fi
- name: (VINTNER) Ensure that license is overridden
run: |
if [ "$(vintner info license)" == "$(cat src/assets/LICENSE)" ]; then
exit 1
fi
- name: (VINTNER) Ensure that dependencies are overridden
run: |
if [ "$(vintner info dependencies)" == "$(cat src/assets/dependencies.csv)" ]; then
exit 1
fi
- name: (VINTNER) Test filesystem initialization
run: vintner setup init
- name: (VINTNER) Test resolver
run: vintner setup benchmark --seeds 10 250
###################################################
#
# xOpera Motivation
#
###################################################
- name: (XOPERA-MOTIVATION) Deploy the production variant of xopera-motivation on GCP
run: |
vintner setup clean --force
vintner setup init
vintner orchestrators init xopera --no-venv
vintner orchestrators enable --orchestrator xopera
vintner templates import --template motivation --path examples/xopera-motivation
vintner instances init --instance motivation --template motivation
vintner instances resolve --instance motivation --presets prod
vintner instances validate --instance motivation
cp examples/xopera-motivation/deployment-inputs.example.yaml examples/xopera-motivation/deployment-inputs.ignored.yaml
sed -i "/gcp_service_account_file:/c\gcp_service_account_file: $(pwd)/gcp-credentials.json" examples/xopera-motivation/deployment-inputs.ignored.yaml
vintner instances deploy --instance motivation --inputs examples/xopera-motivation/deployment-inputs.ignored.yaml
- name: (XOPERA-MOTIVATION) Test the production variant of xopera-motivation on GCP
run: curl --fail-with-body https://application-dot-stoetzms-387808.ey.r.appspot.com
- name: (XOPERA-MOTIVATION) Undeploy the production variant of xopera-motivation on GCP
run: vintner instances undeploy --instance motivation
if: always()
###################################################
#
# xOpera Pruning
#
###################################################
- name: (XOPERA-PRUNING) Deploy the elastic variant of xopera-pruning on GCP
run: |
vintner setup clean --force
vintner setup init
vintner orchestrators init xopera --no-venv
vintner orchestrators enable --orchestrator xopera
vintner templates import --template pruning --path examples/xopera-pruning
vintner instances init --instance pruning --template pruning
vintner instances resolve --instance pruning --presets elastic
vintner instances validate --instance pruning
echo "gcp_service_account_file: $(pwd)/gcp-credentials.json" > examples/xopera-pruning/deployment-inputs.ignored.yaml
vintner instances deploy --instance pruning --inputs examples/xopera-pruning/deployment-inputs.ignored.yaml
- name: (XOPERA-PRUNING) Test the elastic variant of xopera-pruning on GCP
run: curl --fail-with-body https://shop-dot-stoetzms-387808.ey.r.appspot.com
- name: (XOPERA-PRUNING) Undeploy the elastic variant of xopera-pruning on GCP
run: vintner instances undeploy --instance pruning
if: always()
###################################################
#
# Unfurl Artifacts
#
###################################################
- name: (UNFURL-ARTIFACTS) Deploy the enterprise plan of unfurl-artifacts on GCP
run: |
vintner setup clean --force
vintner setup init
vintner orchestrators init unfurl --no-venv
vintner orchestrators enable --orchestrator unfurl
vintner templates import --template artifacts --path examples/unfurl-artifacts
vintner instances init --instance artifacts --template artifacts
vintner instances resolve --instance artifacts --inputs examples/unfurl-artifacts/tests/enterprise/inputs.yaml
echo "gcp_credentials: $(pwd)/gcp-credentials.json" > examples/unfurl-artifacts/deployment-inputs.ignored.yaml
vintner instances deploy --instance artifacts --inputs examples/unfurl-artifacts/deployment-inputs.ignored.yaml
- name: (UNFURL-ARTIFACTS) Test the enterprise plan of unfurl-artifacts on GCP
run: curl --fail-with-body https://shop-dot-stoetzms-387808.ey.r.appspot.com
- name: (UNFURL-ARTIFACTS) Undeploy the enterprise plan of unfurl-artifacts on GCP
run: vintner instances undeploy --instance artifacts
if: always()
###################################################
#
# Notification
#
###################################################
- name: (NOTIFICATION) Send success notification
run: |
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Night workflow [${GITHUB_RUN_ID}](https://github.com/OpenTOSCA/opentosca-vintner/actions/runs/${GITHUB_RUN_ID}) succeeded.\"}" ${DISCORD_WEBHOOK_NIGHT_WORKFLOW}
env:
DISCORD_WEBHOOK_NIGHT_WORKFLOW: ${{ secrets.DISCORD_WEBHOOK_NIGHT_WORKFLOW }}
if: success()
- name: (NOTIFICATION) Send failure notification
run: |
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Night workflow [${GITHUB_RUN_ID}](https://github.com/OpenTOSCA/opentosca-vintner/actions/runs/${GITHUB_RUN_ID}) failed.\"}" ${DISCORD_WEBHOOK_NIGHT_WORKFLOW}
env:
DISCORD_WEBHOOK_NIGHT_WORKFLOW: ${{ secrets.DISCORD_WEBHOOK_NIGHT_WORKFLOW }}
if: failure()
- name: (DISCORD) Send cancel notification
run: |
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Night workflow [${GITHUB_RUN_ID}](https://github.com/OpenTOSCA/opentosca-vintner/actions/runs/${GITHUB_RUN_ID}) cancelled.\"}" ${DISCORD_WEBHOOK_NIGHT_WORKFLOW}
env:
DISCORD_WEBHOOK_NIGHT_WORKFLOW: ${{ secrets.DISCORD_WEBHOOK_NIGHT_WORKFLOW }}
if: cancelled()