-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 2.4 KB
/
run_simulation.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
name: Run Simulation
on:
repository_dispatch:
types: run-simulation
jobs:
# This workflow contains a single job called "run"
run:
runs-on: self-hosted
continue-on-error: true
strategy:
fail-fast: false
matrix:
model: ${{ github.event.client_payload.models }}
name: run-${{ matrix.model.slug }}
steps:
- uses: actions/checkout@v2
- name: Create input file from params
run: |
echo '${{ toJson(github.event.client_payload) }}' > raw-file.json
jq '.models = [${{ toJson(matrix.model) }}'] raw-file.json > runnerInputFile.json
- name: Echo the contents of the file
run: |
mkdir -p input output log
cp runnerInputFile.json input/
cp runnerInputFile.json output/
cat input/runnerInputFile.json
pwd
hostname
- name: Log into registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GPR_USER }}
password: ${{ secrets.GPR_PAT }}
- name: Run Docker container.
run: |
sudo -E docker-compose pull -q model-runner
sudo -E docker-compose run --rm model-runner
env:
API_SHARED_SECRET: ${{secrets.API_SHARED_SECRET}}
AZURE_STORAGE_ACCOUNT: ${{secrets.AZURE_STORAGE_ACCOUNT}}
AZURE_STORAGE_CONTAINER: ${{secrets.AZURE_STORAGE_CONTAINER}}
AZURE_STORAGE_KEY: ${{secrets.AZURE_STORAGE_KEY}}
DOCKER_USER: ${{ secrets.GPR_USER }}
DOCKER_PASSWORD: ${{ secrets.GPR_PAT }}
RUNNER_VERSION: ${{ secrets.RUNNER_VERSION }}
- name: Determine which artifacts to keep
id: keep-artifacts
if: always()
run: echo '::set-output name=result::${{secrets.KEEP_ARTIFACTS}}'
- uses: actions/upload-artifact@v1
if: always() && contains(steps.keep-artifacts.outputs.result, 'output')
with:
name: "model-run-outputs-${{ matrix.model.slug }}"
path: output
- uses: actions/upload-artifact@v1
if: always() && contains(steps.keep-artifacts.outputs.result, 'input')
with:
name: "model-run-inputs-${{ matrix.model.slug }}"
path: input
- uses: actions/upload-artifact@v1
if: always() && contains(steps.keep-artifacts.outputs.result, 'log')
with:
name: "logs-${{ matrix.model.slug }}"
path: log
- name: Cleanup
if: always()
run: |
rm -rf log output inputFile.json