about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2023-01-18 18:09:29 +0000
committerArun Isaac2023-01-18 18:09:29 +0000
commit676c578ffe2d35197542f636eb21bae4a75d0057 (patch)
tree39831aaac333c9c0e2409cc2dec3e8985db78dbc
parent442ec2370efa2dfb5f9c0405c167964bcc2478a4 (diff)
downloadgn-machines-676c578ffe2d35197542f636eb21bae4a75d0057.tar.gz
Add data directory to genenetwork configuration.
*
genenetwork-development.scm (<genenetwork-configuration>)[data-directory]:
New field.
(genenetwork3-cd-gexp): Set DATA_DIR in settings file.
(genenetwork-shepherd-services): Map data directory into container.
(operating-system)[services]: Set data-directory of genenetwork
service to /export/data/genenetwork.
* genenetwork-development-deploy.sh: Expose entire data directory
/export/data/genenetwork instead of the contained genotype files
directory.
-rwxr-xr-xgenenetwork-development-deploy.sh3
-rw-r--r--genenetwork-development.scm11
2 files changed, 10 insertions, 4 deletions
diff --git a/genenetwork-development-deploy.sh b/genenetwork-development-deploy.sh
index ee3d12e..b7f469d 100755
--- a/genenetwork-development-deploy.sh
+++ b/genenetwork-development-deploy.sh
@@ -29,8 +29,7 @@ container_script=$(guix system container --network \
                         --share=/export2/guix-containers/genenetwork-development/var/lib/tissue=/var/lib/tissue \
                         --share=/export2/guix-containers/genenetwork-development/var/lib/virtuoso=/var/lib/virtuoso \
                         --share=/export2/guix-containers/genenetwork-development/var/log/cd=/var/log/cd \
-                        --expose=/export/data/genenetwork/genotype_files \
-                        --share=/export/data/genenetwork/xapian \
+                        --expose=/export/data/genenetwork \
                         --share=/export/data/genenetwork-xapian \
                         --share=/export/genenetwork-database-dump \
                         --share=/var/run/mysqld/mysqld.sock=/run/mysqld/mysqld.sock \
diff --git a/genenetwork-development.scm b/genenetwork-development.scm
index 3c34ccc..638d2c9 100644
--- a/genenetwork-development.scm
+++ b/genenetwork-development.scm
@@ -113,6 +113,8 @@ be imported into G-expressions."
                   (default "/var/genenetwork/genotype-files"))
   (sparql-endpoint genenetwork-configuration-sparql-endpoint
                    (default "http://localhost:8081/sparql"))
+  (data-directory genenetwork-data-directory
+                  (default "/var/genenetwork"))
   (xapian-db-path genenetwork-xapian-db-path
                   (default "/var/genenetwork/xapian")))
 
@@ -384,7 +386,7 @@ server described by CONFIG, a <genenetwork-configuration> object."
   "Return a G-expression that runs the latest genenetwork3 development
 server described by CONFIG, a <genenetwork-configuration> object."
   (match-record config <genenetwork-configuration>
-    (gn3-repository gn3-port sparql-endpoint xapian-db-path)
+    (gn3-repository gn3-port sparql-endpoint data-directory xapian-db-path)
     (with-manifest (package->development-manifest genenetwork3)
       (with-packages (list git-minimal nss-certs)
         (with-imported-modules '((guix build utils))
@@ -409,6 +411,7 @@ server described by CONFIG, a <genenetwork-configuration> object."
               (setenv "GN3_CONF"
                       #$(mixed-text-file "gn3.conf"
                                          "SPARQL_ENDPOINT=\"" sparql-endpoint "\"\n"
+                                         "DATA_DIR=\"" data-directory "\"\n"
                                          "XAPIAN_DB_PATH=\"" xapian-db-path "\"\n"))
               (setenv "HOME" "/tmp")
               ;; Run genenetwork3.
@@ -422,7 +425,7 @@ server described by CONFIG, a <genenetwork-configuration> object."
   "Return shepherd services to run the genenetwork development server
 described by CONFIG, a <genenetwork-configuration> object."
   (match-record config <genenetwork-configuration>
-    (gn2-port gn3-port genotype-files xapian-db-path)
+    (gn2-port gn3-port genotype-files data-directory xapian-db-path)
     (list (shepherd-service
            (documentation "Run GeneNetwork 2 development server.")
            (provision '(genenetwork2))
@@ -460,6 +463,9 @@ described by CONFIG, a <genenetwork-configuration> object."
                                                 (target source)
                                                 (writable? #t))
                                                (file-system-mapping
+                                                (source data-directory)
+                                                (target source))
+                                               (file-system-mapping
                                                 (source xapian-db-path)
                                                 (target source)))
                               #:namespaces (delq 'net %namespaces))
@@ -938,6 +944,7 @@ reverse proxy tissue."
                              (sparql-endpoint (string-append "http://localhost:"
                                                              (number->string %virtuoso-sparql-port)
                                                              "/sparql"))
+                             (data-directory "/export/data/genenetwork")
                              (xapian-db-path %xapian-directory)))
                    (simple-service 'set-build-directory-permissions
                                    activation-service-type