File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ plugins {
13
13
}
14
14
15
15
group = " io.krews"
16
- version = " 0.14.15 "
16
+ version = " 0.15.0 "
17
17
18
18
repositories {
19
19
maven { setUrl(" https://dl.bintray.com/kotlin/kotlin-eap" ) }
Original file line number Diff line number Diff line change 1
1
package krews.config
2
2
3
+ data class SingularityConfig (
4
+ val localImage : String? = null
5
+ )
6
+
3
7
data class TaskConfig (
4
8
// Task level input parameters
5
9
val params : Map <String , Any > = mapOf(),
@@ -14,7 +18,9 @@ data class TaskConfig (
14
18
// The number of tasks "executions" that will be run with the same job / vm.
15
19
val grouping : Int = 1 ,
16
20
// Docker image; defaults to one provided by task
17
- val dockerImage : String? = null
21
+ val dockerImage : String? = null ,
22
+ // optional Singularity config
23
+ val singularity : SingularityConfig ? = null
18
24
)
19
25
20
26
data class WorkflowConfig (
Original file line number Diff line number Diff line change @@ -191,10 +191,11 @@ class BsubExecutor(private val workflowConfig: WorkflowConfig) : LocallyDirected
191
191
bsubScript.append(" export SINGULARITY_BIND=\" $binds \"\n " )
192
192
193
193
// Add running the task to script
194
- val remoteImage = ! taskRunContext.dockerImage.endsWith(" .sif" )
194
+ val trueImage = taskConfig.singularity?.localImage ? : taskRunContext.dockerImage
195
+ val remoteImage = ! trueImage.endsWith(" .sif" )
195
196
bsubScript.append(" \n " )
196
197
bsubScript.append(" # Run task command.\n " )
197
- bsubScript.append(" singularity exec --containall ${if (remoteImage) " docker://" else " " }${taskRunContext.dockerImage } $containerCommand " )
198
+ bsubScript.append(" singularity exec --containall ${if (remoteImage) " docker://" else " " }${trueImage } $containerCommand " )
198
199
bsubScript.append(" \n " )
199
200
200
201
// Add copying output files into output dir to script
Original file line number Diff line number Diff line change @@ -195,9 +195,11 @@ class SlurmExecutor(private val workflowConfig: WorkflowConfig) : LocallyDirecte
195
195
sbatchScript.append(" export SINGULARITY_BIND=\" $binds \"\n " )
196
196
197
197
// Add running the task to script
198
+ val trueImage = taskConfig.singularity?.localImage ? : taskRunContext.dockerImage
199
+ val remoteImage = ! trueImage.endsWith(" .sif" )
198
200
sbatchScript.append(" \n " )
199
201
sbatchScript.append(" # Run task command.\n " )
200
- sbatchScript.append(" singularity exec --containall docker://${taskRunContext.dockerImage } $containerCommand " )
202
+ sbatchScript.append(" singularity exec --containall ${ if (remoteImage) " docker://" else " " }${trueImage } $containerCommand " )
201
203
sbatchScript.append(" \n " )
202
204
203
205
// Add copying output files into output dir to script
You can’t perform that action at this time.
0 commit comments