Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/test-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Test snakemake 🐍 pipeline
on:
pull_request:
branches:
- main

jobs:
test-pipeline:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- "8888:3306"
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Setup pipeline 🚰
uses: actions/checkout@v4

- name: Setup slurm 🐌
uses: koesterlab/setup-slurm-action@v1

- name: Cache conda 🏦
id: cache-conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER_CONDA: 1
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER_CONDA }}-${{hashFiles('environment.yml') }}

- if: ${{ steps.cache-conda.outputs.cache-hit != 'true' }}
name: Setup conda 🐍
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: aatrnaseqpipe
environment-file: environment.yml
# https://github.com/conda-incubator/setup-miniconda/issues/267
# XXX don't use this: use-only-tar-bz2: true

- if: ${{ steps.cache-conda.outputs.cache-hit == 'true' }}
name: Activate conda 🐍
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: aatrnaseqpipe

- name: Cache test data 🏦
id: cache-test
uses: actions/cache@v4
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER_TEST_DATA: 0
with:
path: ./.test
key:
# hash based on the FASTA reference
${{ runner.os }}-test-data-${{ env.CACHE_NUMBER_TEST_DATA }}-${{hashFiles('./.test/sacCer3-mature-tRNAs-dual-adapt-v2.fa')}}

- if: ${{ steps.cache-test.outputs.cache-hit != 'true' }}
name: Download test data ⬇️
working-directory: ./.test
run: |
echo ">> working directory: $(pwd)"
bash download_test_data.sh
echo ">> directory contents:"
ls -l

- if: false
name: Dry-run snakemake
run: |
conda init
conda activate aatrnaseqpipe
snakemake -n \
--configfile=config/config-test.yaml \
--profile-cluster/slurm
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions cluster/slurm/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
executor: cluster-generic
cluster-generic-submit-cmd:
sbatch \
--output="{log}.out" \
--error="{log}.err" \
--job-name="{rule}-{wildcards}" \
--nodes=1 \
--ntasks={threads} \
--partition="{resources.queue}" \
--mem={resources.mem_mb} \
"{resources.gpu_opts}"

# note that GB values should be passed to mem_mb
default-resources:
- mem_mb=8
# - queue="rna"
- gpu_opts=""

jobs: 50

resources:
- ngpu=8

# set rule specific requirements
# set-resources:
# - rebasecall:queue="gpu"
# - rebasecall:gpu_opts="-gpu num=1:j_exclusive=yes"
# - rebasecall:ngpu=1
# - rebasecall:mem_mb=24
# - remora:mem_mb=24
# - cca_classify:queue="gpu"
# - cca_classify:gpu_opts="-gpu num=1:j_exclusive=yes"
# - cca_classify:ngpu=1


printshellcmds: True
show-failed-logs: True
latency-wait: 60
cluster-generic-cancel-cmd: "scancel"