Compare commits

..

4 Commits

Author SHA1 Message Date
437425e652 reduce .gitignore 2026-09-16 22:21:52 +02:00
229c8c358d corrected sarek run 2026-09-16 12:43:45 +02:00
02cefd8fa9 sarek test 2026-09-15 11:06:26 +02:00
27655dc1b8 fix: actually use banded strategy when requested 2026-09-11 20:21:50 +02:00
10 changed files with 137 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,2 +1 @@
cleanup-volume-claim.sh
build.sh

View File

@@ -17,6 +17,7 @@
package recreationaltech.plugin
import groovy.transform.CompileDynamic
import recreationaltech.plugin.strategies.K8sDVFSFrequencyBandsSchedulingStrategy
import recreationaltech.plugin.strategies.K8sDVFSSchedulingStrategy
import recreationaltech.plugin.strategies.K8sHashSchedulingStrategy
@@ -137,12 +138,11 @@ class K8sExecutor extends Executor implements ExtensionPoint {
ips[i] = client.getNodeExternalIp(nodes[i])
log.info "[K8s] node ${nodes[i]} -> ${ips[i]}"
}
strategy = new K8sDVFSSchedulingStrategy(this.runtimeEstimator,
strategy = new K8sDVFSFrequencyBandsSchedulingStrategy(this.runtimeEstimator,
new K8sDVFSClient(nodes, ips),
() -> getClient(),
k8sConfig.runtimeComparisonEpsilon,
k8sConfig.dvfsSchedulingNumTopRuntimes)
strategy.fullSpeedMode = false
} else {
log.error "[K8s] invalid scheduling strategy $k8sConfig.schedulingStrategy, falling back on \"Hash\""
strategy = new K8sHashSchedulingStrategy()

1
sarek/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.fastq.gz

3
sarek/clean.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
rm -rf out work .nextflow .nextflow.log .nextflow.log.* measurements

24
sarek/nextflow-k8s.config Normal file
View File

@@ -0,0 +1,24 @@
workDir = '/workspace'
process {
executor = 'k8s'
//container = 'ubuntu:22.04'
pod = [
imagePullPolicy: 'IfNotPresent'
]
}
k8s {
namespace = 'trogantk'
storageClaimName = 'cephfs-trogantk'
storageMountPath = '/workspace'
launchDir = '/workspace/launch'
projectDir = '/workspace/projects'
cleanup = true
pod = [
nodeSelector: [usedby: 'trogantk']
]
}

41
sarek/nextflow.config Normal file
View File

@@ -0,0 +1,41 @@
plugins {
id 'k8s-dvfs@0.1.0'
}
workDir = '/workspace'
process {
executor = 'k8s-dvfs'
//container = 'ubuntu:22.04'
pod = [
imagePullPolicy: 'IfNotPresent'
]
}
k8s {
namespace = 'trogantk'
storageClaimName = 'cephfs-trogantk'
storageMountPath = '/workspace'
launchDir = '/workspace/launch'
projectDir = '/workspace/projects'
cleanup = true
imagePullPolicy = 'IfNotPresent'
schedulerInterval = '1m'
recordTaskRuntimes = false
schedulingStrategy = 'DVFS'
runtimeComparisonEpsilon = '10s'
dvfsSchedulingNumTopRuntimes = 3
nodeLabel = 'usedby=trogantk'
nodeInit {
enabled = true
image = 'gitea.kleine.eulenhexe.de/kevin/ma/dvfs-agent:0.2.0'
command = ['/usr/local/bin/agent']
wait = 'Running'
cleanup = true
}
}

30
sarek/run-k8s.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <size: 1 or 3> <logfile-outname>"
exit
fi
SIZE=$1
LOGOUT=$2
TESTDATA_ARCHIVE=/root/sarek-testdata.tar.gz
MYDIR=$(pwd)
mkdir -p /workspace/sarek
mkdir -p /workspace/launch/work
cp nextflow-k8s.config /workspace/sarek/nextflow-k8s.config
cp runtimes.csv /workspace/launch/work/runtimes.csv
cp samplesheet${SIZE}.csv /workspace/launch/samplesheet.csv
cp samplesheet${SIZE}.csv /workspace/sarek/samplesheet.csv
cd /workspace/launch
tar xzf ${TESTDATA_ARCHIVE}
cd /workspace/sarek
time nextflow run -c nextflow-k8s.config nf-core/sarek -r 3.9.0 -profile docker --genome GRCm38 --input samplesheet.csv --outdir out --skip_tools multiqc
rm -rf out
cp .nextflow.log /${LOGOUT}
cd ${MYDIR}
rm -rf /workspace/*

30
sarek/run.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <size: 1 or 3> <logfile-outname>"
exit
fi
SIZE=$1
LOGOUT=$2
TESTDATA_ARCHIVE=/root/sarek-testdata.tar.gz
MYDIR=$(pwd)
mkdir -p /workspace/sarek
mkdir -p /workspace/launch/work
cp nextflow.config /workspace/sarek/nextflow.config
cp runtimes.csv /workspace/launch/work/runtimes.csv
cp samplesheet${SIZE}.csv /workspace/launch/samplesheet.csv
cp samplesheet${SIZE}.csv /workspace/sarek/samplesheet.csv
cd /workspace/launch
tar xzf ${TESTDATA_ARCHIVE}
cd /workspace/sarek
time nextflow run -c nextflow.config nf-core/sarek -r 3.9.0 -profile docker --genome GRCm38 --input samplesheet.csv --outdir out --skip_tools multiqc
rm -rf out
cp .nextflow.log /${LOGOUT}
cd ${MYDIR}
rm -rf /workspace/*

2
sarek/samplesheet1.csv Normal file
View File

@@ -0,0 +1,2 @@
patient,sample,lane,fastq_1,fastq_2
ID1,S1,L001,SRR27016609_1.fastq.gz,SRR27016609_2.fastq.gz
1 patient sample lane fastq_1 fastq_2
2 ID1 S1 L001 SRR27016609_1.fastq.gz SRR27016609_2.fastq.gz

4
sarek/samplesheet3.csv Normal file
View File

@@ -0,0 +1,4 @@
patient,sample,lane,fastq_1,fastq_2
ID1,S1,L001,SRR27016609_1.fastq.gz,SRR27016609_2.fastq.gz
ID1,S2,L001,SRR27016607_1.fastq.gz,SRR27016607_2.fastq.gz
ID1,S3,L001,SRR27016605_1.fastq.gz,SRR27016605_2.fastq.gz
1 patient sample lane fastq_1 fastq_2
2 ID1 S1 L001 SRR27016609_1.fastq.gz SRR27016609_2.fastq.gz
3 ID1 S2 L001 SRR27016607_1.fastq.gz SRR27016607_2.fastq.gz
4 ID1 S3 L001 SRR27016605_1.fastq.gz SRR27016605_2.fastq.gz