Skip to content

Commit

Permalink
[CI] Run nightly calibration with new model
Browse files Browse the repository at this point in the history
This turn the old calibration workflow into a reusable workflow, which can be
used by multiple model runs.
  • Loading branch information
giordano committed May 17, 2024
1 parent a95e916 commit a49dbcf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
name: Calibration
name: "Calibration (reusable)"

on:
workflow_call:
inputs:
commit:
description: '40-character commit hash'
required: true
default: ''
type: string
model:
description: 'Model'
required: true
default: ''
type: string
workflow_dispatch:
inputs:
commit:
description: '40-character commit hash'
required: true
default: ""
default: ''
type: string
schedule:
- cron: 31 2 * * *
model:
description: 'Model'
required: true
default: ''
type: choice
options:
- 'mod1'
- 'mod2'

env:
REPO_PATH: /mnt/tlo/TLOmodel
OUTPUT_ROOT: /mnt/tlodev2stg/tlo-dev-fs-2/task-runner/output
RUNS_NUMBER: 10
PYTHON_VER: 3.11
RUN_NAME: 021_long_run_all_diseases_run
PROCESS_NAME: 022_long_run_all_diseases_process
RUN_NAME: 021_long_run_all_diseases_${{ inputs.model }}_run
PROCESS_NAME: 022_long_run_all_diseases_${{ inputs.model }}_process

jobs:

Expand All @@ -43,11 +61,7 @@ jobs:
- name: Generate environment variables
id: vars
run: |
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]] && [[ -n "${{ inputs.commit }}" ]]; then
SHA=${{ inputs.commit }}
else
SHA=${{ github.sha }}
fi
SHA=${{ inputs.commit }}
ENV="/mnt/tlo/env-${SHA}"
if [[ -d "${ENV}" ]]; then
echo "Virtual environment directory ${ENV} already exists, leaving..."
Expand Down Expand Up @@ -134,7 +148,7 @@ jobs:
tasks:
needs: setup
name: Run task ${{ matrix.index }}
runs-on: [tlo-dev-vm-1, tasks] # Use only runners dedicated to running the tasks.
runs-on: [tlo-dev-vm-1, tasks, ${{ inputs.model }}] # Use only runners dedicated to running the tasks.
timeout-minutes: 5760 # = 4 * 24 * 60 minutes = 4 days
strategy:
fail-fast: false
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/calibrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Calibrations (nightly)"

on:
schedule:
- cron: 31 2 * * *

jobs:
name: "Calibration for model ${{ matrix.model }}"
version-matrix:
strategy:
fail-fast: false
matrix:
model: [mod1, mod2]
uses: ./.github/workflows/calibration_common.yaml
with:
model: ${{ matrix.model }}
commit: ${{ github.sha }}
secrets: inherit

0 comments on commit a49dbcf

Please sign in to comment.