about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2022-09-26 13:21:25 +0530
committerArun Isaac2022-09-26 13:37:41 +0530
commitbbdd74d2def319f53e40aab3a5e1dc50e5cc2388 (patch)
tree17de183da768c759493b0c66ac8bcd70f62eb3a4
parent3b7ac978875648171b485bed992b8976dc3d5e3e (diff)
downloadgn-machines-bbdd74d2def319f53e40aab3a5e1dc50e5cc2388.tar.gz
Set up xapian search index for genenetwork2 CD.
* genenetwork-development.scm (%xapian-db-path): New variable.
(genenetwork2-shepherd-service)[start]: Share %xapian-db-path with the
container.
(%default-genenetwork2-configuration)[runner]: Pass %xapian-db-path to
CD runner.
* genenetwork/development-helper.scm (genenetwork2-runner-gexp):
Accept xapian-db-path argument and set XAPIAN_DB_PATH environment
variable.
* genenetwork-development-deploy.sh: Expose
/export/data/genenetwork/xapian in the container.
-rwxr-xr-xgenenetwork-development-deploy.sh1
-rw-r--r--genenetwork-development.scm10
-rw-r--r--genenetwork/development-helper.scm6
3 files changed, 14 insertions, 3 deletions
diff --git a/genenetwork-development-deploy.sh b/genenetwork-development-deploy.sh
index ad9f795..4391bb8 100755
--- a/genenetwork-development-deploy.sh
+++ b/genenetwork-development-deploy.sh
@@ -30,6 +30,7 @@ container_script=$(guix system container --network \
                         --share=/var/guix-containers/genenetwork-development/var/lib/virtuoso=/var/lib/virtuoso \
                         --share=/var/guix-containers/genenetwork-development/var/log/cd=/var/log/cd \
                         --expose=/export/data/genenetwork/genotype_files \
+                        --expose=/export/data/genenetwork/xapian \
                         --share=/export/genenetwork-database-dump \
                         --share=/var/run/mysqld/mysqld.sock=/run/mysqld/mysqld.sock \
                         genenetwork-development.scm)
diff --git a/genenetwork-development.scm b/genenetwork-development.scm
index 2de0ff4..852711f 100644
--- a/genenetwork-development.scm
+++ b/genenetwork-development.scm
@@ -177,6 +177,10 @@ CONFIG, a <development-server-configuration> object, on startup."
 (define %genotype-files
   "/export/data/genenetwork/genotype_files")
 
+;; Path to the xapian search index used by genenetwork2
+(define %xapian-db-path
+  "/export/data/genenetwork/xapian")
+
 ;; Port on which genenetwork2 is listening
 (define %genenetwork2-port
   9092)
@@ -284,6 +288,9 @@ describing genenetwork2."
                            (source #$%genotype-files)
                            (target source))
                           (file-system-mapping
+                           (source #$%xapian-db-path)
+                           (target source))
+                          (file-system-mapping
                            (source "/run/mysqld/mysqld.sock")
                            (target source)
                            (writable? #t)))
@@ -305,7 +312,8 @@ describing genenetwork2."
                      (content (package->development-manifest genenetwork2))
                      (allow-collisions? #t))
                   #$%genenetwork3-port
-                  #$%genotype-files))))))
+                  #$%genotype-files
+                  #$%xapian-db-path))))))
 
 (define %genenetwork-accounts
   (list (user-group
diff --git a/genenetwork/development-helper.scm b/genenetwork/development-helper.scm
index 7899630..353bf1a 100644
--- a/genenetwork/development-helper.scm
+++ b/genenetwork/development-helper.scm
@@ -101,13 +101,14 @@ with genenetwork3 dependencies."
             (invoke "pylint" "gn3"))
           (mkdir-p #$output)))))
 
-(define (genenetwork2-runner-gexp genenetwork2-source profile gn3-port genotype-files)
+(define (genenetwork2-runner-gexp genenetwork2-source profile gn3-port
+                                  genotype-files xapian-db-path)
   "Return a G-expression that runs the genenetwork2 server for
 GENENETWORK2-SOURCE in PROFILE. GENENETWORK2-SOURCE is a checkout of
 the genenetwork2 source code. PROFILE is a profile with genenetwork2
 dependencies. GN3-PORT is the port on which a local instance of
 genenetwork3 is listening. GENOTYPE-FILES is the path to genotype
-files."
+files. XAPIAN-DB-PATH is the path to the xapian search index."
   (with-imported-modules '((guix build utils))
     (with-profile profile
       #~(begin
@@ -128,6 +129,7 @@ files."
              (setenv "SQL_URI" "mysql://webqtlout:webqtlout@localhost/db_webqtl")
              (setenv "HOME" "/tmp")
              (setenv "NO_REDIS" "no-redis")
+             (setenv "XAPIAN_DB_PATH" #$xapian-db-path)
              (invoke "sh" "bin/genenetwork2")))))))
 
 (define (genenetwork3-runner-gexp genenetwork3-source profile)