Skip to content

Commit a49dbcf

Browse files
committed
[CI] Run nightly calibration with new model
This turn the old calibration workflow into a reusable workflow, which can be used by multiple model runs.
1 parent a95e916 commit a49dbcf

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

.github/workflows/calibration.yaml .github/workflows/calibration_common.yaml

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
name: Calibration
1+
name: "Calibration (reusable)"
22

33
on:
4+
workflow_call:
5+
inputs:
6+
commit:
7+
description: '40-character commit hash'
8+
required: true
9+
default: ''
10+
type: string
11+
model:
12+
description: 'Model'
13+
required: true
14+
default: ''
15+
type: string
416
workflow_dispatch:
517
inputs:
618
commit:
719
description: '40-character commit hash'
820
required: true
9-
default: ""
21+
default: ''
1022
type: string
11-
schedule:
12-
- cron: 31 2 * * *
23+
model:
24+
description: 'Model'
25+
required: true
26+
default: ''
27+
type: choice
28+
options:
29+
- 'mod1'
30+
- 'mod2'
1331

1432
env:
1533
REPO_PATH: /mnt/tlo/TLOmodel
1634
OUTPUT_ROOT: /mnt/tlodev2stg/tlo-dev-fs-2/task-runner/output
1735
RUNS_NUMBER: 10
1836
PYTHON_VER: 3.11
19-
RUN_NAME: 021_long_run_all_diseases_run
20-
PROCESS_NAME: 022_long_run_all_diseases_process
37+
RUN_NAME: 021_long_run_all_diseases_${{ inputs.model }}_run
38+
PROCESS_NAME: 022_long_run_all_diseases_${{ inputs.model }}_process
2139

2240
jobs:
2341

@@ -43,11 +61,7 @@ jobs:
4361
- name: Generate environment variables
4462
id: vars
4563
run: |
46-
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]] && [[ -n "${{ inputs.commit }}" ]]; then
47-
SHA=${{ inputs.commit }}
48-
else
49-
SHA=${{ github.sha }}
50-
fi
64+
SHA=${{ inputs.commit }}
5165
ENV="/mnt/tlo/env-${SHA}"
5266
if [[ -d "${ENV}" ]]; then
5367
echo "Virtual environment directory ${ENV} already exists, leaving..."
@@ -134,7 +148,7 @@ jobs:
134148
tasks:
135149
needs: setup
136150
name: Run task ${{ matrix.index }}
137-
runs-on: [tlo-dev-vm-1, tasks] # Use only runners dedicated to running the tasks.
151+
runs-on: [tlo-dev-vm-1, tasks, ${{ inputs.model }}] # Use only runners dedicated to running the tasks.
138152
timeout-minutes: 5760 # = 4 * 24 * 60 minutes = 4 days
139153
strategy:
140154
fail-fast: false

.github/workflows/calibrations.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Calibrations (nightly)"
2+
3+
on:
4+
schedule:
5+
- cron: 31 2 * * *
6+
7+
jobs:
8+
name: "Calibration for model ${{ matrix.model }}"
9+
version-matrix:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
model: [mod1, mod2]
14+
uses: ./.github/workflows/calibration_common.yaml
15+
with:
16+
model: ${{ matrix.model }}
17+
commit: ${{ github.sha }}
18+
secrets: inherit

0 commit comments

Comments
 (0)