Skip to content

Commit

Permalink
get http input file docker image from config
Browse files Browse the repository at this point in the history
  • Loading branch information
NishiPhalke committed May 27, 2021
1 parent db0932e commit 8fc80a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/main/kotlin/krews/config/SlurmConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ data class SlurmWorkflowConfig(
val jobCompletionPollInterval: Int = 10,
// Optional ssh configuration. Will cause all slurm command to be passed through ssh.
// Only available for password-less login.
val ssh: SshConfig? = null,

val httpInputDockerImage: String? = null
val ssh: SshConfig? = null
)

data class SshConfig(
Expand Down
6 changes: 0 additions & 6 deletions src/main/kotlin/krews/executor/slurm/SlurmExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class SlurmExecutor(private val workflowConfig: WorkflowConfig) : LocallyDirecte

private var allShutdown = AtomicBoolean(false)

//private val httpInputDockerImage = workflowConfig.slurm?.httpInputDockerImage

override fun downloadFile(fromPath: String, toPath: Path) {
val fromFile = workflowBasePath.resolve(fromPath)
Expand Down Expand Up @@ -139,11 +138,6 @@ class SlurmExecutor(private val workflowConfig: WorkflowConfig) : LocallyDirecte
val downloadCommand = remoteDownloadInputFile.downloadFileCommand("/download")
var downloadImageName = remoteDownloadInputFile.downloadFileImage()

/*if(httpInputDockerImage != null)
{
downloadImageName= httpInputDockerImage
}*/

sbatchScript.append("singularity exec --containall docker://$downloadImageName $downloadCommand\n")
sbatchScript.append("echo Exit status of download $singUUID: $?\n")
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/krews/file/HttpInputFile.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package krews.file

data class HttpInputFile(val url: String, override val path: String) : InputFile() {
override fun downloadFileImage() = "alpine:3.9"
data class HttpInputFile(val url: String, override val path: String, val dockerimage: String? = "alpine:3.9") : InputFile() {
override fun downloadFileImage() = "$dockerimage"
override fun downloadFileCommand(containerBaseDir: String) = "wget $url -O $containerBaseDir/$path"
}

0 comments on commit 8fc80a9

Please sign in to comment.