aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-09-06 10:51:04 +0100
committerArun Isaac2024-09-06 11:05:42 +0100
commit4ea53bd7851ac20635f22a32fa42b08ecbf4fd80 (patch)
treea43fb3085716deb4a011b5ce8605882a3cfd3169
parentc4164374719566236d33699b92ec09ee2d9617a8 (diff)
downloadravanan-4ea53bd7851ac20635f22a32fa42b08ecbf4fd80.tar.gz
ravanan-4ea53bd7851ac20635f22a32fa42b08ecbf4fd80.tar.lz
ravanan-4ea53bd7851ac20635f22a32fa42b08ecbf4fd80.zip
command-line-tool: Introduce <scheduler-proc> record type.
* ravanan/command-line-tool.scm (<scheduler-proc>): New record type. (command-line-tool-scheduler): Use <scheduler-proc> records. * ravanan/workflow.scm (command-line-tool->propagator): Use <scheduler-proc> records.
-rw-r--r--ravanan/command-line-tool.scm33
-rw-r--r--ravanan/workflow.scm2
2 files changed, 23 insertions, 12 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm
index 8f269ff..1b23c7e 100644
--- a/ravanan/command-line-tool.scm
+++ b/ravanan/command-line-tool.scm
@@ -60,6 +60,9 @@
check-requirements
inherit-requirements
%command-line-tool-supported-requirements
+ scheduler-proc
+ scheduler-proc-name
+ scheduler-proc-cwl
single-machine-job-state
single-machine-job-state?
single-machine-job-state-script
@@ -99,6 +102,12 @@
(apply warning fmt args)
(exit #f))
+(define-immutable-record-type <scheduler-proc>
+ (scheduler-proc name cwl)
+ scheduler-proc?
+ (name scheduler-proc-name)
+ (cwl scheduler-proc-cwl))
+
(define-immutable-record-type <single-machine-job-state>
(single-machine-job-state script success?)
single-machine-job-state?
@@ -938,17 +947,19 @@ named @var{name} with @var{inputs} using tools from Guix manifest
#:key guix-daemon-socket
slurm-api-endpoint slurm-jwt)
(scheduler (match-lambda*
- (((name cwl) inputs)
- (run-command-line-tool name
- manifest
- cwl
- inputs
- scratch
- store
- batch-system
- #:guix-daemon-socket guix-daemon-socket
- #:slurm-api-endpoint slurm-api-endpoint
- #:slurm-jwt slurm-jwt)))
+ ((proc inputs)
+ (let ((name (scheduler-proc-name proc))
+ (cwl (scheduler-proc-cwl proc)))
+ (run-command-line-tool name
+ manifest
+ cwl
+ inputs
+ scratch
+ store
+ batch-system
+ #:guix-daemon-socket guix-daemon-socket
+ #:slurm-api-endpoint slurm-api-endpoint
+ #:slurm-jwt slurm-jwt))))
(lambda (state)
(guard (c ((job-failure? c)
(let ((script (job-failure-script c)))
diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm
index b30c386..2ecc4e6 100644
--- a/ravanan/workflow.scm
+++ b/ravanan/workflow.scm
@@ -126,7 +126,7 @@ requirements and hints of the step."
"Convert @code{CommandLineTool} workflow @var{cwl} of @var{name} to a
propagator."
(propagator name
- (list name cwl)
+ (scheduler-proc name cwl)
(vector-map->list (lambda (input)
(cons (assoc-ref input "id")
(assoc-ref input "id")))