Skip to content

Commit

Permalink
ci: refactor run notebook workflows (#295)
Browse files Browse the repository at this point in the history
* ci: fix release workflow

* ci: refactor run notebook workflows
  • Loading branch information
martinkim0 authored Jul 12, 2024
1 parent d6d9191 commit bd61ebf
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 161 deletions.
104 changes: 0 additions & 104 deletions .github/workflows/run_linux_cuda.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/run_notebook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: run notebook

on:
workflow_call:
inputs:
notebook:
description: "Path to the notebook to run"
required: true
type: string
version:
description: "latest/stable/semver/branch"
required: true
type: string

jobs:
notebook:
runs-on: [self-hosted, Linux, X64, CUDA]

container:
image: ghcr.io/scverse/scvi-tools:py3.11-cu12-${{ inputs.version }}-tutorials
options: --user root --gpus all

timeout-minutes: 600 # lenient timeout for scbasset tutorial

steps:
- uses: actions/checkout@v4

- name: Install Python kernel
run: |
python -m ipykernel install
- name: Run notebook
run: |
python -m jupyter nbconvert --execute --inplace ${{ inputs.notebook }}
- uses: peter-evans/create-pull-request@v5
with:
commit-message: run ${{ inputs.notebook }}
title: automated update for ${{ inputs.notebook }}
branch: update-${{ inputs.notebook }}
57 changes: 57 additions & 0 deletions .github/workflows/run_notebook_all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: run notebook (all)

on:
workflow_dispatch:
inputs:
version:
description: "latest/stable/semver/branch"
required: true
type: string

jobs:
notebook:
strategy:
matrix:
notebook:
- atac/PeakVI.ipynb
- atac/PoissonVI.ipynb
- atac/scbasset_batch.ipynb
- atac/scbasset.ipynb
- dev/data_tutorial.ipynb
- dev/model_user_guide.ipynb
- dev/module_user_guide.ipynb
- hub/cellxgene_census_model.ipynb
- hub/minification.ipynb
- hub/scvi_hub_intro_and_download.ipynb
- hub/scvi_hub_upload_and_large_files.ipynb
- multimodal/cite_scrna_integration_w_totalVI.ipynb
- multimodal/MultiVI_tutorial.ipynb
- multimodal/totalVI_reference_mapping.ipynb
- multimodal/totalVI.ipynb
- quick_start/api_overview.ipynb
- quick_start/data_loading.ipynb
- scrna/amortized_lda.ipynb
- scrna/AutoZI_tutorial.ipynb
- scrna/cellassign_tutorial.ipynb
- scrna/contrastiveVI_tutorial.ipynb
- scrna/harmonization.ipynb
- scrna/linear_decoder.ipynb
- scrna/query_hlca_knn.ipynb
- scrna/scanvi_fix.ipynb
- scrna/scarches_scvi_tools.ipynb
- scrna/scVI_DE_worm.ipynb
- scrna/seed_labeling.ipynb
- scrna/tabula_muris.ipynb
- scrna/MrVI_tutorial.ipynb
- spatial/cell2location_lymph_node_spatial_tutorial.ipynb
- spatial/DestVI_tutorial.ipynb
- spatial/gimvi_tutorial.ipynb
- spatial/stereoscope_heart_LV_tutorial.ipynb
- spatial/tangram_scvi_tools.ipynb
- tuning/autotune_new_model.ipynb
- tuning/autotune_scvi.ipynb

uses: ./.github/workflows/run_notebook.yaml
with:
notebook: ${{ matrix.notebook }}
version: ${{ inputs.version }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Run notebook (Linux, CUDA, branch)
name: run notebook (individual)

on:
workflow_dispatch:
inputs:
notebook-path:
description: Path to the notebook to run
notebook:
description: "Path to the notebook to run"
required: true
type: choice
options: # not including R tutorials currently
Expand All @@ -15,6 +15,7 @@ on:
- dev/data_tutorial.ipynb
- dev/model_user_guide.ipynb
- dev/module_user_guide.ipynb
- hub/cellxgene_census_model.ipynb
- hub/minification.ipynb
- hub/scvi_hub_intro_and_download.ipynb
- hub/scvi_hub_upload_and_large_files.ipynb
Expand Down Expand Up @@ -44,61 +45,14 @@ on:
- spatial/tangram_scvi_tools.ipynb
- tuning/autotune_new_model.ipynb
- tuning/autotune_scvi.ipynb

python-version:
description: Python version
required: true
default: "3.11"
type: choice
options:
- "3.11"
- "3.10"
- "3.9"

cuda-version:
description: CUDA version
required: true
default: "11"
type: choice
options:
- "11"

branch-name:
description: scvi-tools branch to run on
version:
description: "latest/stable/semver/branch"
required: true
default: "main"
type: string

jobs:
docker:
runs-on: [self-hosted, Linux, X64, CUDA]

container:
image: scverse/scvi-tools:py${{ inputs.python-version }}-cu${{ inputs.cuda-version }}-tutorials-${{ inputs.branch-name}}
options: --user root --gpus all

timeout-minutes: 600 # lenient timeout for scbasset tutorial

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python kernel
run: |
python -m ipykernel install
- name: Run notebook
run: |
python -m jupyter nbconvert --execute --inplace ${{ inputs.notebook-path }}
- name: Submit PR with changes
uses: peter-evans/create-pull-request@v5
with:
commit-message: Execute ${{ inputs.notebook-path }}
title: Automated update for ${{ inputs.notebook-path }}
branch: update-${{ inputs.notebook-path }}
body: |
Update ${{ inputs.notebook-path }}:
- Python version: ${{ inputs.python-version }}
- CUDA version: ${{ inputs.cuda-version }}
- scvi-tools branch: ${{ inputs.branch-name }}
notebook:
uses: ./.github/workflows/run_notebook.yaml
with:
notebook: ${{ inputs.notebook }}
version: ${{ inputs.version }}

0 comments on commit bd61ebf

Please sign in to comment.