From 5d06ccc6b27dd213871ff8cede2d44aed2cae373 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 9 Oct 2024 22:50:24 +0100 Subject: batch-system: Introduce record type. A record type allows us an easy way to group and pass along parameters required by the slurm-api batch system. * ravanan/batch-system.scm: New file. * bin/ravanan: Import (ravanan batch-system). (main): Create object for batch-system argument. Do not pass #:slurm-api-endpoint and #:slurm-jwt arguments. * ravanan/command-line-tool.scm: Import (ravanan batch-system). (command-line-tool-supported-requirements): Check for slurm-api batch system using slurm-api-batch-system?. (run-command-line-tool): Check for slurm-api batch system using slurm-api-batch-system?. Do not accept #:slurm-api-endpoint and #:slurm-jwt arguments. * ravanan/workflow.scm: Import (ravanan batch-system). (workflow-scheduler): Do not accept #:slurm-api-endpoint and #:slurm-jwt arguments. Pass batch-system to job-state-status. (run-workflow): Check for slurm-api batch system using slurm-api-batch-system?. Do not accept #:slurm-api-endpoint and #:slurm-jwt arguments. * ravanan/job-state.scm: Import (ravanan batch-system). (job-state-status): Do not accept #:slurm-api-endpoint and #:slurm-jwt arguments. Accept batch-system argument. --- bin/ravanan | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/ravanan b/bin/ravanan index cc9005d..5807a8e 100755 --- a/bin/ravanan +++ b/bin/ravanan @@ -27,6 +27,7 @@ exec guile --no-auto-compile -e main -s "$0" "$@" (ice-9 match) (web uri) (json) + (ravanan batch-system) (ravanan reader) (ravanan utils) (ravanan workflow)) @@ -145,11 +146,14 @@ files that have the token in the @verbatim{SLURM_JWT=token} format." (if (file-name-absolute? (assq-ref args 'store)) (assq-ref args 'store) (canonicalize-path (assq-ref args 'store))) - (assq-ref args 'batch-system) - #:guix-daemon-socket (assq-ref args 'guix-daemon-socket) - #:slurm-api-endpoint (assq-ref args 'slurm-api-endpoint) - #:slurm-jwt (and (assq-ref args 'slurm-jwt) - (read-jwt (assq-ref args 'slurm-jwt)))) + (case (assq-ref args 'batch-system) + ((single-machine) 'single-machine) + ((slurm-api) + (slurm-api-batch-system + (assq-ref args 'slurm-api-endpoint) + (and (assq-ref args 'slurm-jwt) + (read-jwt (assq-ref args 'slurm-jwt)))))) + #:guix-daemon-socket (assq-ref args 'guix-daemon-socket)) (current-output-port) #:pretty #t) (newline (current-output-port)))))))) -- cgit v1.2.3