aboutsummaryrefslogtreecommitdiff
path: root/gn/services/genome-browser.scm
diff options
context:
space:
mode:
authorEfraim Flashner2021-04-22 20:33:14 +0300
committerEfraim Flashner2021-04-22 20:35:59 +0300
commit765ea0a57cdc89c5dabccf4a4a398b80c8267449 (patch)
tree94aa52e410ffd027ceeb2a325d2c0d145b95844c /gn/services/genome-browser.scm
parenta5c2123037175dcfea827444a325c839b8f7d05b (diff)
downloadguix-bioinformatics-765ea0a57cdc89c5dabccf4a4a398b80c8267449.tar.gz
gn: Initial ucsc-genome-browser and service.
Diffstat (limited to 'gn/services/genome-browser.scm')
-rw-r--r--gn/services/genome-browser.scm88
1 files changed, 88 insertions, 0 deletions
diff --git a/gn/services/genome-browser.scm b/gn/services/genome-browser.scm
new file mode 100644
index 0000000..961569a
--- /dev/null
+++ b/gn/services/genome-browser.scm
@@ -0,0 +1,88 @@
+(define-module (gn services genome-browser))
+
+(use-modules (gnu)
+ (gn packages bioinformatics)
+ )
+(use-service-modules web)
+
+(define %hg.conf
+ (plain-file "hg.conf"
+ (string-append "db.host=gbdb\n"
+ "db.user=admin\n"
+ "db.password=admin\n"
+ "db.trackDb=trackDb\n"
+ "defaultGenome=Human\n"
+ "central.db=hgcentral\n"
+ "central.host=gbdb\n"
+ "central.user=admin\n"
+ "central.password=admin\n"
+ "central.domain=\n"
+ "backupcentral.db=hgcentral\n"
+ "backupcentral.host=gbdb\n"
+ "backupcentral.user=admin\n"
+ "backupcentral.password=admin\n"
+ "backupcentral.domain=\n")))
+
+;; TODO: create 'daily clean' mcron scripts.
+
+(define ucsc-genome-browser-port 4321)
+
+(operating-system
+ (host-name "genome-browser")
+ (timezone "Etc/UTC")
+ (locale "en_US.utf8")
+
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)
+ (target "does-not-matter")))
+ (file-systems %base-file-systems)
+ ;; No firmware for VMs
+ (firmware '())
+ (packages (cons* %base-packages))
+ (services
+ (list (service httpd-service-type
+ (httpd-configuration
+ (config
+ (httpd-config-file
+ (document-root (file-append ucsc-genome-browser "/html"))
+ (listen (list (number->string ucsc-genome-browser-port)))
+ (modules
+ (cons*
+ (httpd-module
+ (name "cgid_module")
+ (file "modules/mod_cgid.so"))
+ (httpd-module
+ (name "include_module")
+ (file "modules/mod_include.so"))
+ %default-httpd-modules))
+ (extra-config (list "\
+TypesConfig etc/httpd/mime.types
+# same as 'listen' above
+<VirtualHost *:" (number->string ucsc-genome-browser-port) ">
+ XBitHack On
+ DocumentRoot " ucsc-genome-browser "/html
+ Alias /bin " ucsc-genome-browser "/bin
+ Alias /htdocs " ucsc-genome-browser "/htdocs
+ <Directory " ucsc-genome-browser "/html>
+ Options +Includes
+ SSILegacyExprParser on
+ </Directory>
+
+ ScriptAlias /cgi-bin/ " ucsc-genome-browser "/cgi-bin/
+ <Directory " ucsc-genome-browser "/cgi-bin>
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ SetHandler cgi-script
+ Require all granted
+ </Directory>
+
+ <Directory /var/www/html/trash>
+ Options MultiViews
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+ </Directory>
+</VirtualHost>")))))))))
+
+;; guix system container -L /path/to/guix-past/modules/ -L /path/to/guix-bioinformatics/ /path/to/guix-bioinformatics/gn/services/genome-browser.scm --network
+;; xdg-open http://localhost:4321