From ba402e6b12894b846a5adbbc3db54e9e230edf77 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 15 Jul 2024 12:03:19 -0500 Subject: Run script to make non-human data public --- genenetwork/services/genenetwork.scm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'genenetwork') diff --git a/genenetwork/services/genenetwork.scm b/genenetwork/services/genenetwork.scm index 16c5a4f..ec66f64 100644 --- a/genenetwork/services/genenetwork.scm +++ b/genenetwork/services/genenetwork.scm @@ -233,6 +233,33 @@ (chmod file #o644)) (find-files #$xapian-directory))))))))) +(define (make-non-human-data-public-cron-gexp config) + (match-record config + (gn-auth sql-uri auth-db) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (setenv "PYTHONPATH" + (string-append + #$(file-append gn-auth + "/lib/python" + (python-version (package-version python)) + "/site-packages") + ":" + #$(profile + (content (package->development-manifest gn-auth)) + (allow-collisions? #t)) + "/lib/python" + #$(python-version (package-version python)) + "/site-packages")) + + (invoke #$(file-append python "/bin/python3") + "-m" + "scripts.batch_assign_data_to_default_admin" + #$auth-db + #$sql-uri))))) + (define (genenetwork-activation config) (match-record config (gn2-secrets gn3-secrets gn-auth-secrets auth-db) @@ -521,7 +548,12 @@ a @code{} record." (list #~(job '(next-hour) #$(program-file "build-xapian-index-cron-gexp" (build-xapian-index-cron-gexp config)) - #:user "root"))) + #:user "root") + #~(job '(next-hour) + #$(program-file "make-non-human-data-public-cron-gexp" + (make-non-human-data-public-cron-gexp config)) + #:user "gunicorn-gn-auth") + )) (define genenetwork-service-type (service-type -- cgit v1.2.3