aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-04-20 15:10:26 +0530
committerArun Isaac2022-04-20 15:10:26 +0530
commit0065184382b425295cc57da7364afb0cf43bb9e9 (patch)
treec4bc60dcf3e641430d0f61dc4119ff151ec878b6
parentfd1bf6d1359b64b26d75e54cff9e831c4b10f382 (diff)
downloadgn-machines-0065184382b425295cc57da7364afb0cf43bb9e9.tar.gz
Add dump-genenetwork-database CI job.
* genenetwork-development.scm (%dump-genenetwork-database-export-directory): New variable. (dump-genenetwork-database): New function. (dump-genenetwork-database-project)[ci-jobs]: Rename dump-genenetwork-database job to dump-genenetwork-database-tests. Add new dump-genenetwork-database job. (operating-system): Add set-dump-genenetwork-database-export-directory-permissions service.
-rw-r--r--genenetwork-development.scm44
1 files changed, 42 insertions, 2 deletions
diff --git a/genenetwork-development.scm b/genenetwork-development.scm
index 2465573..bc09960 100644
--- a/genenetwork-development.scm
+++ b/genenetwork-development.scm
@@ -475,6 +475,11 @@ command to be executed."
;;; dump-genenetwork-database
;;;
+;; Path to genenetwork database dump export directory that has lots of
+;; free space
+(define %dump-genenetwork-database-export-directory
+ "/export/genenetwork-database-dump")
+
;; Unreleased version of ccwl that is required by
;; dump-genenetwork-database for its graphql library.
(define ccwl
@@ -544,17 +549,41 @@ command to be executed."
(allow-collisions? #t))
(list "make" "check")))))
+(define (dump-genenetwork-database project)
+ (with-imported-modules '((guix build utils))
+ (with-packages (list git-minimal guile-3.0 guile-dbd-mysql
+ guile-dbi nss-certs)
+ #~(begin
+ (use-modules (guix build utils))
+
+ (invoke "git" "clone"
+ "--depth" "1"
+ #$(forge-project-repository project)
+ ".")
+ (let ((dump-directory #$(string-append %dump-genenetwork-database-export-directory
+ "/dump")))
+ (when (file-exists? dump-directory)
+ (delete-file-recursively dump-directory))
+ (mkdir-p dump-directory)
+ (invoke "./pre-inst-env" "./dump.scm"
+ #$(string-append %dump-genenetwork-database-export-directory
+ "/conn.scm")
+ dump-directory))))))
+
(define dump-genenetwork-database-project
(forge-project
(name "dump-genenetwork-database")
(repository "https://git.genenetwork.org/arunisaac/dump-genenetwork-database")
(ci-jobs (list (forge-laminar-job
- (name "dump-genenetwork-database")
+ (name "dump-genenetwork-database-tests")
(run (derivation-job-gexp
this-forge-project
this-forge-laminar-job
dump-genenetwork-database-tests
- #:guix-daemon-uri %guix-daemon-uri)))))
+ #:guix-daemon-uri %guix-daemon-uri)))
+ (forge-laminar-job
+ (name "dump-genenetwork-database")
+ (run (dump-genenetwork-database this-forge-project)))))
(ci-jobs-trigger 'webhook)))
@@ -647,4 +676,15 @@ command to be executed."
(development-server-configuration
(inherit %default-genenetwork3-configuration)
(port %genenetwork3-port)))
+ (simple-service 'set-dump-genenetwork-database-export-directory-permissions
+ activation-service-type
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+
+ (for-each (lambda (file)
+ (chown file
+ (passwd:uid (getpw "laminar"))
+ (passwd:gid (getpw "laminar"))))
+ (find-files #$%dump-genenetwork-database-export-directory)))))
%base-services)))