summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/ravanan2
-rw-r--r--ravanan/store.scm15
2 files changed, 17 insertions, 0 deletions
diff --git a/bin/ravanan b/bin/ravanan
index f1a9e5d..0e0f9e2 100755
--- a/bin/ravanan
+++ b/bin/ravanan
@@ -31,6 +31,7 @@ exec guile --no-auto-compile -e main -s "$0" "$@"
(ravanan batch-system)
(ravanan config)
(ravanan reader)
+ (ravanan store)
(ravanan utils)
(ravanan verbosity)
(ravanan workflow)
@@ -219,6 +220,7 @@ files that have the token in the @verbatim{SLURM_JWT=token} format."
((workflow-file inputs-file)
;; We must not try to compile guix manifest files.
(set! %load-should-auto-compile #f)
+ (make-store (assq-ref args 'store))
(let* ( ;; FIXME: This is a bit of a hack to avoid canonizing remote
;; paths.
(store (if (file-name-absolute? (assq-ref args 'store))
diff --git a/ravanan/store.scm b/ravanan/store.scm
index 9dfc1ec..abe8891 100644
--- a/ravanan/store.scm
+++ b/ravanan/store.scm
@@ -24,6 +24,7 @@
%store-data-directory
%store-logs-directory
+ make-store
script->store-files-directory
script->store-data-file
script->store-stdout-file
@@ -39,6 +40,20 @@
(define %store-logs-directory
"logs")
+(define (make-store store)
+ "Make @var{store} directory and initialize with subdirectories. If @var{store}
+already exists, do nothing."
+ (unless (file-exists? store)
+ (format (current-error-port)
+ "store ~a does not exist; creating it~%"
+ store)
+ (make-directories store)
+ (for-each (lambda (directory)
+ (mkdir (expand-file-name directory store)))
+ (list %store-files-directory
+ %store-data-directory
+ %store-logs-directory))))
+
(define (script->store-files-directory script store)
"Return the store files directory in @var{store} corresponding to @var{script}
path."