about summary refs log tree commit diff
path: root/gn/services
diff options
context:
space:
mode:
authorShepherd on Tux022024-06-20 08:37:15 -0500
committerShepherd on Tux022024-06-20 08:37:15 -0500
commitfe5fd5cb23907f8e37edafda96bafa608a3e0e7f (patch)
tree0b4cec2038dde07fe26f1c6882369f36a9545a19 /gn/services
parentf0f8dc84eca7088177797f84db05314537615c77 (diff)
parent0362ee068a39ce9a5fd6f0fba9cd5586211f07f1 (diff)
downloadguix-bioinformatics-fe5fd5cb23907f8e37edafda96bafa608a3e0e7f.tar.gz
Merge branch 'master' of /home/git/public/guix-bioinformatics
Diffstat (limited to 'gn/services')
-rw-r--r--gn/services/bh20-seq-resource-container.scm110
-rw-r--r--gn/services/pluto.scm17
2 files changed, 5 insertions, 122 deletions
diff --git a/gn/services/bh20-seq-resource-container.scm b/gn/services/bh20-seq-resource-container.scm
deleted file mode 100644
index e0eccf7..0000000
--- a/gn/services/bh20-seq-resource-container.scm
+++ /dev/null
@@ -1,110 +0,0 @@
-(define-module (gn services bh20-seq-resource-container))
-
-(use-modules (gnu)
-             (gn packages bioinformatics)
-             (guix modules)
-             ((guix packages) #:select (package-source))
-             (guix records)
-             (guix build-system python) ; for python-version from guix/build/python-build-system.scm
-             (ice-9 match))
-(use-service-modules shepherd)
-(use-package-modules compression python python-web)
-
-(define-record-type* <covid19-pubseq-configuration>
-  covid19-pubseq-configuration
-  make-covid19-pubseq-configuration
-  covid19-pubseq-configuration?
-  (package          covid19-pubseq-configuration-package    ; package
-                    (default bh20-seq-resource-for-service))
-  (deploy-directory covid19-pubseq-deploy-directory         ; string
-                    (default "/srv/http"))
-  (port             covid19-pubseq-configuration-port       ; string
-                    (default "5000")))
-
-(define covid19-pubseq-activation-service
-  (match-lambda
-    (($ <covid19-pubseq-configuration> package deploy-directory port)
-     #~(begin
-         (let ((pkg-src #$(package-source package)))
-           (when (file-exists? #$deploy-directory)
-             (delete-file-recursively (mkdir-p #$deploy-directory)))
-           (mkdir-p #$deploy-directory)
-           (if (file-is-directory? pkg-src)
-             (copy-recursively pkg-src #$deploy-directory)
-             (begin
-               (copy-file pkg-src #$(string-append deploy-directory
-                                                   "/src.tar.xz"))
-               (with-directory-excursion #$deploy-directory
-                 (invoke #$(file-append xz "/bin/xz") "-d" "src.tar.xz")
-                 (invoke #$(file-append tar "/bin/tar") "xvf" "src.tar"
-                         "--strip-components=1")))))))))
-
-(define covid19-pubseq-shepherd-service
-  (match-lambda
-    (($ <covid19-pubseq-configuration> package deploy-directory port)
-     (with-imported-modules (source-module-closure
-                              '((gnu build shepherd)
-                                (gnu system file-systems)))
-       (list (shepherd-service
-               (provision '(covid19-pubseq))
-               (requirement '(networking))
-               (modules '((gnu build shepherd)
-                          (gnu system file-systems)))
-               ;(start #~(make-forkexec-constructor/container
-               (start #~(make-forkexec-constructor
-                          (list
-                            #$(file-append gunicorn "/bin/gunicorn")
-                            (string-append "-blocalhost:" #$port)
-                            "bh20simplewebuploader.main:app")
-                          #:directory #$deploy-directory
-                          #:log-file "/var/log/covid19-pubseq.log"
-                          #:environment-variables
-                          ;(let (pyversion (python-version (@ (gnu packages python) python)))
-                          '("TMPDIR=/export/tmp"
-                            "PYTHONPATH=/run/current-system/profile/lib/python3.9/site-packages")
-                          ;  (string-append "PYTHONPATH=/run/current-system/profile/lib/python" pyversion "/site-packages")))
-                          ;#:mappings
-                          ;(list (file-system-mapping
-                          ;        (source "/export/tmp")
-                          ;        (target source)
-                          ;        (writable? #t))
-                          ;      (file-system-mapping
-                          ;        ;; TODO: Don't hardcode python version!
-                          ;        (source "/run/current-system/profile/lib/python3.9/site-packages")
-                          ;        (target source)))
-                          ))
-               (stop  #~(make-kill-destructor))))))))
-
-(define covid19-pubseq-service-type
-  (service-type
-    (name 'covid19-pubseq)
-    (extensions
-      (list
-        (service-extension shepherd-root-service-type
-                           covid19-pubseq-shepherd-service)
-        (service-extension activation-service-type
-                           covid19-pubseq-activation-service)
-        (service-extension profile-service-type
-                           (compose list
-                                    covid19-pubseq-configuration-package))))
-    (default-value (covid19-pubseq-configuration))
-    (description
-     "Run a COVID-19 PubSeq: Public SARS-CoV-2 Sequence Resource Webserver.")))
-
-(operating-system
-  (host-name "covid19-pubseq")
-  (timezone "Etc/UTC")
-  (locale "en_US.utf8")
-
-  (bootloader (bootloader-configuration
-               (bootloader grub-bootloader)
-               (targets '("does-not-matter"))))
-  (file-systems %base-file-systems)
-  ;; No firmware for VMs.
-  (firmware '())
-  ;; We don't need any packages inside the container.
-  (packages '())
-
-  (services (list (service covid19-pubseq-service-type))))
-
-;; guix system container /home/shepherd/guix-bioinformatics/gn/services/bh20-seq-resource-container.scm --share=/export/tmp=/export/tmp --network
diff --git a/gn/services/pluto.scm b/gn/services/pluto.scm
index 720b769..420e2cf 100644
--- a/gn/services/pluto.scm
+++ b/gn/services/pluto.scm
@@ -43,21 +43,14 @@
                (requirement '(networking))
                (modules '((gnu build shepherd)
                           (gnu system file-systems)))
-               (start #~(make-forkexec-constructor/container
-                          ;(list #$(file-append package "/runpluto.sh") #$port)
-                          (list #$(file-append package "/runpluto"))
+               (start #~(make-forkexec-constructor
+                          '(#$(file-append package "/bin/runsliderserver"))
                           #:log-file "/var/log/pluto.log"
                           #:user "julia"
                           #:group "julia"
-                          ;; This prevents the service from using /root as $HOME.
-                          #:environment-variables '()
-                          #:mappings (list (file-system-mapping
-                                             (source "/home/jovyan")
-                                             (target source)
-                                             (writable? #t))
-                                           (file-system-mapping
-                                             (source "/etc/ssl")
-                                             (target source)))))
+                          #:environment-variables
+                          (list "SSL_CERT_DIR=/etc/ssl/certs"
+                                "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")))
                (stop  #~(make-kill-destructor))))))))
 
 (define pluto-service-type