-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (113 loc) · 3.74 KB
/
evaluation_latency.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
name: 'Benchmark - Latency'
on:
workflow_dispatch:
# inputs:
# logLevel:
# description: 'Log level'
# required: true
# default: 'warning'
# tags:
# description: 'Test scenario tags'
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
timeout-minutes: 240
strategy:
max-parallel: 3
fail-fast: false
matrix:
scenario: ["baseline", "syncmesh", "advanced-mongo"]
latency: ["without-latency"]
node_count: [3] #, 6]
defaults:
run:
working-directory: infrastructure
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v2
- name: Setup Credential
run: echo $GCE_CREDENTIALS | base64 -di > ./credentials.json
env:
GCE_CREDENTIALS: '${{ secrets.GCE_CREDENTIALS }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: "dspj-315716"
service_account_key: ${{ secrets.GCE_CREDENTIALS }}
export_default_credentials: true
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
# Checks that all Terraform configuration files adhere to a canonical format
# - name: Terraform Format
# run: terraform fmt -check
# Generates an execution plan for Terraform
- name: Terraform Plan
run: terraform plan -var public_access=false -var scenario="${{ matrix.scenario }}" -var instance_scenario="${{ matrix.latency }}-${{ matrix.node_count}}" -var machine_type="n1-standard-1" -out tfplan
- name: Make dir
run: mkdir /tmp/ipynb
- name: Create directory
run: mkdir /tmp/logoutput
- name: Terraform Apply
run: terraform apply tfplan
- name: Sleep
run: sleep 3480
timeout-minutes: 120
- name: Set up Python
uses: actions/setup-python@v2
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: python3
- name: Install dependencies
working-directory: evaluation
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt install tshark -y
- name: Query Data
working-directory: evaluation
run: papermill 1_QueryData.ipynb /tmp/ipynb/1_QueryData.ipynb -p experiment "experiment-${{ matrix.scenario }}-${{ matrix.latency }}-${{ matrix.node_count}}"
- name: Prepare Data
working-directory: evaluation
run: papermill 02_PrepareData.ipynb /tmp/ipynb/02_PrepareData.ipynb
- uses: actions/upload-artifact@master
if: always()
with:
name: output-${{ matrix.scenario }}-${{ matrix.latency }}-${{ matrix.node_count}}
path: /tmp/ipynb
- uses: actions/upload-artifact@master
if: always()
with:
name: data-${{ matrix.scenario }}-${{ matrix.latency }}-${{ matrix.node_count}}
path: ./evaluation/data/
- name: Terraform Destroy
if: always()
run: terraform destroy -auto-approve
bundle:
if: always()
name: 'Bundle'
runs-on: ubuntu-latest
needs: [terraform]
timeout-minutes: 240
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@v2
if: always()
with:
path: ./artifacts
- uses: actions/upload-artifact@master
if: always()
with:
name: bundle
path: ./artifacts
# - uses: actions/upload-artifact@master
# if: always()
# with:
# name: out
# path: ./evaluation/out/