-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (133 loc) · 4.92 KB
/
skaled_manual.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
name: Skaled Manually-Running Tests
on:
schedule:
- cron: '00 12 * * 5'
workflow_dispatch:
inputs:
suite:
description: 'Test Suite'
default: 'stability'
required: true
test:
description: 'Test'
default: 'down_up'
required: true
skaled_provider:
description: 'Skaled Provider (binary_from_container|binary_as_artifact|container)'
default: 'endpoint_by_terraform_with_containers'
required: true
num_nodes:
description: 'Num Nodes'
default: '16'
required: true
skaled_release:
description: 'Skaled Release'
default: 'develop-latest'
required: true
kick_interval:
description: 'KICK_INTERVAL (stability test)'
default: '450'
required: true
jobs:
main_job:
runs-on: self-hosted
timeout-minutes: 4200
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PROJECT: skaled
SUITE: ${{ github.event.inputs.suite || 'stability' }}
TEST: ${{ github.event.inputs.test || 'down_up' }}
SKALED_PROVIDER: skaled_providers/${{ github.event.inputs.skaled_provider || 'endpoint_by_terraform_with_containers' }}
SKALED_RELEASE: ${{ github.event.inputs.skaled_release || 'develop-latest' }}
NUM_NODES: ${{ github.event.inputs.num_nodes || '16' }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_access_key: ${{ secrets.AWS_ACCESS_KEY }}
TF_VAR_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NO_ULIMIT_CHECK: 1
KICK_INTERVAL: ${{ github.event.inputs.kick_interval || '1800' }}
steps:
- name: Add secrets
run: |
touch ~/.netrc
chmod 600 ~/.netrc
echo "machine github.com" > ~/.netrc
echo "login dimalit" >> ~/.netrc
echo "password ${{ secrets.DIMALIT_ACCESS_TOKEN }}" >> ~/.netrc
echo "${{ secrets.D4_AWS_PEM }}" > ~/d4_aws.pem
echo "${{ secrets.GRAFANA_CI_KEY }}" > ~/grafana_ci
chmod 600 ~/grafana_ci
- uses: hashicorp/[email protected]
with:
terraform_wrapper: false
- name: Clean up
run: |
pwd
mounts=$(mount | awk -F ' on | type' '{print $2}' | grep '/btrfs$')||true
echo $mounts
for m in $mounts; do sudo umount $m; done
sudo rm -rf *
- uses: actions/checkout@v2
with:
ssh-key: '${{secrets.RUNNER_SSH_KEY}}'
submodules: 'recursive'
- run: cd skaled_providers/endpoint_by_terraform_with_containers/tf/tf_scripts && terraform init
- name: Prepare SGX keys/certs
run: |
echo "${{ secrets.sgx_key }}" > sgx_certs/sgx.key
chmod 600 sgx_certs/sgx.key
sudo mkdir /skale_node_data || true
sudo cp -r sgx_certs /skale_node_data
sudo chown -R $USER:$USER /skale_node_data/sgx_certs/*
- name: Update Environment
run: |
./update_environment.sh $PROJECT+$SUITE
- name: Run Tests
run: |
export DATA_DIR="$HOME/data_dir"
echo "::set-env name=DATA_DIR::$DATA_DIR"
sudo rm -rf $DATA_DIR || true
mkdir $DATA_DIR
./run_tests.sh $PROJECT+$SUITE+$TEST
- name: Clean up AWS
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_terraform_with_containers' }}
continue-on-error: true
run: |
cd skaled_providers/endpoint_by_terraform_with_containers
NUM_NODES=${{ env.NUM_NODES }} ./free_skaled.sh
- uses: actions/upload-artifact@v2
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_terraform_with_containers' }}
continue-on-error: true
with:
name: aws_config
path: |
skaled_providers/endpoint_by_terraform_with_containers/tf/output.json
- name: Save logs
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_container' }}
run: |
sudo docker logs $(docker ps -a -q) 2>aleth.err 1>aleth.out || true
sudo chown $USER:$USER aleth.*
continue-on-error: true
- uses: actions/upload-artifact@v2
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_container' }}
continue-on-error: true
with:
path: |
skaled_providers/endpoint_by_container/data_dir/config.json
aleth.*
- uses: actions/upload-artifact@v2
if: ${{ always() && startsWith(env.SKALED_PROVIDER, 'skaled_providers/binary_') }}
continue-on-error: true
with:
name: data_dir
path: |
${{ env.DATA_DIR }}/**/aleth.*
${{ env.DATA_DIR }}/**/config.json
- uses: actions/upload-artifact@v2
if: ${{ always() && env.TEST == 'skaled_chart' }}
continue-on-error: true
with:
name: skaled_chart
path: |
integration_tests/skaled/load_js/skaled_chart.png
integration_tests/skaled/load_js/skaled_chart.txt