diff options
author | Arun Isaac | 2024-08-23 23:53:00 +0100 |
---|---|---|
committer | Arun Isaac | 2024-08-24 00:09:13 +0100 |
commit | 98e600bc3e06ea4c51e8591a767653498d1c1a8a (patch) | |
tree | 4b145e7ad967b46216b6768d92771b0728b7bcc3 | |
parent | bec69bbea36df14b39d8a0332322438fafee49b7 (diff) | |
download | ravanan-98e600bc3e06ea4c51e8591a767653498d1c1a8a.tar.gz ravanan-98e600bc3e06ea4c51e8591a767653498d1c1a8a.tar.lz ravanan-98e600bc3e06ea4c51e8591a767653498d1c1a8a.zip |
command-line-tool: Report progress verbosely.
* ravanan/command-line-tool.scm (run-command-line-tool,
command-line-tool-scheduler): Report progress verbosely, and print out paths to
log files.
-rw-r--r-- | ravanan/command-line-tool.scm | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index 0649a81..4237600 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -513,7 +513,11 @@ path." (if (file-exists? store-data-file) ;; Return a dummy success state object if script has already ;; been run successfully. - (single-machine-job-state script #t) + (begin + (format (current-error-port) + "~a previously run; retrieving result from store~%" + script) + (single-machine-job-state script #t)) ;; Run script if it has not already been run. (begin ;; Delete output files directory if an incomplete one exists @@ -529,22 +533,32 @@ path." ((single-machine) (setenv "WORKFLOW_OUTPUT_DIRECTORY" store-files-directory) (setenv "WORKFLOW_OUTPUT_DATA_FILE" store-data-file) + (format (current-error-port) + "Running ~a~%" + script) (single-machine-job-state script (zero? (with-output-to-file stdout-file (lambda () (with-error-to-file stderr-file (cut system* script))))))) ((slurm-api) - (slurm-job-state script - (submit-job `(("WORKFLOW_OUTPUT_DIRECTORY" . - ,store-files-directory) - ("WORKFLOW_OUTPUT_DATA_FILE" . - ,store-data-file)) - stdout-file - stderr-file - script - #:api-endpoint slurm-api-endpoint - #:jwt slurm-jwt))) + (format (current-error-port) + "Submitting job ~a~%" + script) + (let ((job-id (submit-job `(("WORKFLOW_OUTPUT_DIRECTORY" . + ,store-files-directory) + ("WORKFLOW_OUTPUT_DATA_FILE" . + ,store-data-file)) + stdout-file + stderr-file + script + #:api-endpoint slurm-api-endpoint + #:jwt slurm-jwt))) + (format (current-error-port) + "~a submitted as job ID ~a~%" + script + job-id) + (slurm-job-state script job-id))) (else (assertion-violation batch-system "Invalid batch system"))))))) @@ -927,7 +941,7 @@ named @var{name} with @var{inputs} using tools from Guix manifest (guard (c ((job-failure? c) (let ((script (job-failure-script c))) (error - "Invocation of ~a failed~%See files ~a and ~a for logs~%" + "~a failed; logs at ~a and ~a~%" script (script->store-stdout-file script store) (script->store-stderr-file script store))))) @@ -949,9 +963,13 @@ named @var{name} with @var{inputs} using tools from Guix manifest ((single-machine) 0) ((slurm-api) %job-poll-interval)) (lambda (state) - (capture-command-line-tool-output - ((case batch-system - ((single-machine) single-machine-job-state-script) - ((slurm-api) slurm-job-state-script)) - state) - store)))) + (let ((script ((case batch-system + ((single-machine) single-machine-job-state-script) + ((slurm-api) slurm-job-state-script)) + state))) + (format (current-error-port) + "~a completed; logs at ~a and ~a~%" + script + (script->store-stdout-file script store) + (script->store-stderr-file script store)) + (capture-command-line-tool-output script store))))) |