about summary refs log tree commit diff
path: root/genenetwork
diff options
context:
space:
mode:
Diffstat (limited to 'genenetwork')
-rw-r--r--genenetwork/services/genenetwork.scm24
1 files changed, 20 insertions, 4 deletions
diff --git a/genenetwork/services/genenetwork.scm b/genenetwork/services/genenetwork.scm
index a403f21..65e8e22 100644
--- a/genenetwork/services/genenetwork.scm
+++ b/genenetwork/services/genenetwork.scm
@@ -57,6 +57,7 @@
             genenetwork-configuration-port           ; external port
             genenetwork-configuration-gn2-port       ; internal port
             genenetwork-configuration-gn3-port       ; internal port
+            genenetwork-configuration-gn-guile-port  ; aka gn4 internal port (may be external)
             genenetwork-configuration-auth-db        ; RW auth DB
             genenetwork-configuration-xapian-db      ; RO search index, unless you want to regenerate inside VM
             genenetwork-configuration-genotype-files ; RO genotype files
@@ -150,6 +151,8 @@
                   (default "https://genenetwork.org"))
   (sessions-dir gn-uploader-sessions-dir
                 (default "/var/genenetwork/sessions/gn-uploader"))
+  (sqlite-databases-directory gn-uploader-sqlite-databases-directory
+                              (default "/var/genenetwork/sqlite/gn-uploader"))
   (log-level gn-uploader-configuration-log-level
              (default 'warning)
              (sanitize sanitize-log-level)))
@@ -370,6 +373,8 @@ object."
                                        ("GENENETWORK_FILES" ,genotype-files)
                                        ("GN3_LOCAL_URL" ,(string-append "http://localhost:"
                                                                         (number->string gn3-port)))
+                                       ("GN_GUILE_SERVER_URL" ,(string-append "http://localhost:" ; AKA GN4
+                                                                        (number->string gn-guile-port) "/" ))
                                        ("GN_SERVER_URL" ,(string-append "https://" server-name "/api3/"))
                                        ("AUTH_SERVER_URL" ,(string-append "https://" gn-auth-server-name "/"))
                                        ("JS_GUIX_PATH" ,(file-append gn2-profile "/share/genenetwork2/javascript"))
@@ -386,6 +391,8 @@ object."
                                     (configuration-file-gexp
                                      `(("AUTH_DB" ,auth-db)
                                        ("AUTH_SERVER_URL" ,(string-append "https://" gn-auth-server-name "/"))
+                                       ("GN_GUILE_SERVER_URL" ,(string-append "http://localhost:" ; AKA GN4
+                                                                        (number->string gn-guile-port) "/"))
                                        ("DATA_DIR" ,gn3-data-directory)
                                        ("SOURCE_DIR" ,gn-sourcecode-directory)
                                        ("SPARQL_ENDPOINT" ,sparql-endpoint)
@@ -534,6 +541,7 @@ object."
                              (port gn-auth-port))))
              (wsgi-app-module "gn_auth:create_app()")
              (workers 20)
+             (timeout 1200)
              (environment-variables
               (list (environment-variable
                      (name "GN_AUTH_CONF")
@@ -613,7 +621,7 @@ a @code{<genenetwork-configuration>} record."
                                (build-xapian-index-cron-gexp config))
                #:user "root")))
 
-(define (gn-guile-gexp gn-guile-port)
+(define (gn-guile-gexp gn-guile-port) 
   (with-imported-modules '((guix build utils))
     #~(begin
         (use-modules (guix build utils))
@@ -684,7 +692,7 @@ a @code{<genenetwork-configuration>} record."
 
 (define (gn-uploader-activation config)
   (match-record config <gn-uploader-configuration>
-    (secrets data-directory sessions-dir)
+    (secrets data-directory sessions-dir sqlite-databases-directory)
     (with-imported-modules '((guix build utils))
       #~(begin
           (use-modules (guix build utils))
@@ -695,6 +703,8 @@ a @code{<genenetwork-configuration>} record."
                              (passwd:gid (getpw "gunicorn-gn-uploader"))))
                     (append (list #$secrets)
                             (find-files #$sessions-dir
+                                        #:directories? #t)
+                            (find-files #$sqlite-databases-directory
                                         #:directories? #t)))
           ;; Set owner-only permissions on secrets files.
           (for-each (lambda (file)
@@ -711,7 +721,7 @@ a @code{<genenetwork-configuration>} record."
 
 (define (gn-uploader-gunicorn-app config)
   (match-record config <gn-uploader-configuration>
-    (gn-uploader sql-uri port data-directory secrets log-level auth-server-url gn2-server-url sessions-dir)
+    (gn-uploader sql-uri port data-directory secrets log-level auth-server-url gn2-server-url sessions-dir sqlite-databases-directory)
     ;; If we mapped only the mysqld.sock socket file, it would break
     ;; when the external mysqld server is restarted.
     (let* ((database-mapping (file-system-mapping
@@ -726,7 +736,8 @@ a @code{<genenetwork-configuration>} record."
                                                                                 "/uploads"))
                                                ("AUTH_SERVER_URL" ,auth-server-url)
                                                ("GN2_SERVER_URL" ,gn2-server-url)
-                                               ("SESSION_FILESYSTEM_CACHE_PATH" ,sessions-dir)))))
+                                               ("SESSION_FILESYSTEM_CACHE_PATH" ,sessions-dir)
+                                               ("ASYNCHRONOUS_JOBS_SQLITE_DB" ,(string-append sqlite-databases-directory "/background-jobs.db"))))))
            (gn-uploader-profile (profile
                                  (content (package->development-manifest gn-uploader))
                                  (allow-collisions? #t)))
@@ -738,6 +749,7 @@ a @code{<genenetwork-configuration>} record."
                              (port port))))
              (wsgi-app-module "scripts.qcapp_wsgi:app")
              (workers 20)
+             (timeout 1200)
              (environment-variables
               (list (environment-variable
                      (name "UPLOADER_CONF")
@@ -771,6 +783,10 @@ a @code{<genenetwork-configuration>} record."
                              (file-system-mapping
                               (source sessions-dir)
                               (target source)
+                              (writable? #t))
+                             (file-system-mapping
+                              (source sqlite-databases-directory)
+                              (target source)
                               (writable? #t))))
              (extra-cli-arguments
               (list "--log-level"