diff options
Diffstat (limited to 'gn/services')
| -rw-r--r-- | gn/services/bxd-power-container.scm | 24 | ||||
| -rw-r--r-- | gn/services/discourse.scm | 129 | ||||
| -rw-r--r-- | gn/services/file-systems.scm | 653 | ||||
| -rw-r--r-- | gn/services/genenetwork1.scm | 33 | ||||
| -rw-r--r-- | gn/services/genome-browser.scm | 207 | ||||
| -rw-r--r-- | gn/services/gitea-README | 17 | ||||
| -rw-r--r-- | gn/services/gitea-container.scm | 94 | ||||
| -rw-r--r-- | gn/services/gitea-dump.service | 11 | ||||
| -rw-r--r-- | gn/services/gitea-dump.timer | 9 | ||||
| -rw-r--r-- | gn/services/gitea-nocontainer.service | 10 | ||||
| -rw-r--r-- | gn/services/gitea.service | 10 | ||||
| -rw-r--r-- | gn/services/gn1-httpd-config.scm | 136 | ||||
| -rw-r--r-- | gn/services/rn6-assembly-container.scm | 24 | ||||
| -rw-r--r-- | gn/services/rshiny.scm | 86 | ||||
| -rw-r--r-- | gn/services/science.scm | 387 | ||||
| -rw-r--r-- | gn/services/singlecell-container.scm | 27 |
16 files changed, 0 insertions, 1857 deletions
diff --git a/gn/services/bxd-power-container.scm b/gn/services/bxd-power-container.scm deleted file mode 100644 index 9191302..0000000 --- a/gn/services/bxd-power-container.scm +++ /dev/null @@ -1,24 +0,0 @@ -(define-module (gn services bxd-power-container)) - -(use-modules (gnu) - (gn packages bioinformatics) - (gn services rshiny)) - -(operating-system - (host-name "bxd-power") - (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 only need a few packages inside the container. - (packages (list coreutils)) - - (services (list (service rshiny-service-type - (rshiny-configuration - (package bxd-power-calculator-app) - (binary "bxd-power-calculator-app")))))) diff --git a/gn/services/discourse.scm b/gn/services/discourse.scm deleted file mode 100644 index feebb98..0000000 --- a/gn/services/discourse.scm +++ /dev/null @@ -1,129 +0,0 @@ -(define-module (gn services discourse)) - -(use-modules (gnu) - (gn packages ruby) - (guix modules) - (guix records) - (ice-9 match) - (gnu packages ruby-check)) -(use-service-modules networking shepherd web) -(use-package-modules node ruby) - -(define-record-type* <discourse-configuration> - discourse-configuration - make-discourse-configuration - discourse-configuration? - (package discourse-configuration-package ; package - (default discourse)) - (deploy-directory discourse-deploy-directory ; string - (default "/srv/http")) - (port discourse-configuration-port ; list of strings - (default '("3000"))) - (bundler discourse-configuration-bundler ; package - (default bundler)) - ) - -(define discourse-activation - (match-lambda - (($ <discourse-configuration> package deploy-directory port bundler) - #~(begin - (mkdir-p #$deploy-directory) - (copy-recursively #$package #$deploy-directory) - (for-each make-file-writable (find-files #$deploy-directory)) - (with-directory-excursion #$deploy-directory - ;; copied from the discourse package. - (substitute* "Gemfile" - ;; Don't require specific versions of these gems - (("6.0.3.3") (package-version ruby-rails)) - (("2.0.1") (package-version ruby-sassc)) - (("active_model_serializers.*") "active_model_serializers'\n") - ;; Add tzinfo-data and figure out how to use non-Ruby version later - (("active_model_serializers'") - "active_model_serializers'\ngem 'tzinfo-data'") - ;; ruby-cppjieba-rb never finishes the install phase with ruby-2.6 - ((".*cppjieba_rb.*") "")) - (invoke #$(file-append node "/bin/npm") "install" "svgo") - ) - )))) - -(define discourse-service - (match-lambda - (($ <discourse-configuration> package deploy-directory port bundler) - (with-imported-modules (source-module-closure - '((gnu build shepherd) - (gnu system file-systems))) - (list (shepherd-service - (provision '(discourse)) - (requirement '(networking)) - (modules '((gnu build shepherd) - (gnu system file-systems))) - (start #~(make-forkexec-constructor/container - (list #$(file-append package "/server.py")) - ;; Needs to run from the directory it is located in. - #:directory #$deploy-directory - #:log-file "/var/log/discourse.log" - ;; We don't need to set TMPDIR because we're inside a container. - #:environment-variables - '( - ;"EDIRECT_PUBMED_MASTER=/export2/PubMed" - ;"NLTK_DATA=/var/cache/nltk_data" - ;"PERL_LWP_SSL_CA_FILE=/etc/ssl/certs/ca-certificates.crt" - ) - ;#:mappings (list (file-system-mapping - ; (source "/export2/PubMed") - ; (target source) - ; (writable? #t)) - ; (file-system-mapping - ; (source "/export/ratspub") - ; (target source) - ; (writable? #t)) - ; (file-system-mapping - ; (source "/var/cache/nltk_data") - ; (target source)) - ; (file-system-mapping - ; (source "/etc/ssl/certs") - ; (target source))) - )) - (stop #~(make-kill-destructor))))) - ))) - -(define discourse-service-type - (service-type - (name 'discourse) - (extensions - (list - (service-extension activation-service-type - discourse-activation) - (service-extension shepherd-root-service-type - discourse-service) - ;; Make sure discourse doesn't get garbage collected. - (service-extension profile-service-type - (compose list discourse-configuration-package)) - ;; Make sure php-fpm is instantiated. - (service-extension php-fpm-service-type - (const #t)))) - (default-value (discourse-configuration)) - (description - "Run an instance of Discourse."))) - -(operating-system - (host-name "discourse") - (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 '()) - (packages (append - (list node) - %base-packages)) - - (services (list (service dhcp-service-type) - (service discourse-service-type - ;; The following is for testing: - ;(discourse-configuration - ; (port '("3333"))) - )))) diff --git a/gn/services/file-systems.scm b/gn/services/file-systems.scm deleted file mode 100644 index 386f2ac..0000000 --- a/gn/services/file-systems.scm +++ /dev/null @@ -1,653 +0,0 @@ -(define-module (gn services file-systems) - #:use-module (guix gexp) - #:use-module (guix records) - #:use-module (gnu services) - #:use-module (gnu services shepherd) - #:use-module (gnu system accounts) - #:use-module (gnu system shadow) - #:use-module (gnu packages admin) - #:use-module (gnu packages linux) - #:use-module (gn packages file-systems) - #:use-module (ice-9 match) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-9) - - #:export (lizardfs-configuration - lizardfs-configuration? - lizardfs-service-type - - lizardfs-mfschunkserver-config-file - lizardfs-mfschunkserver-config-file? - lizardfs-mfshdd-config-file - lizardfs-mfshdd-config-file? - lizardfs-mfsmaster-config-file - lizardfs-mfsmaster-config-file? - lizardfs-mfsmetalogger-config-file - lizardfs-mfsmetalogger-config-file?)) - - -(define %lizardfs-accounts - (list (user-group - (name "lizardfs") - (system? #t)) - (user-account - (name "lizardfs") - (group "lizardfs") - (system? #t) - (comment "Lizardfs User") - (home-directory "/var/lib/lizardfs") - (shell (file-append shadow "/sbin/nologin"))))) - -(define-record-type* <lizardfs-mfsmetalogger-config-file> - lizardfs-mfsmetalogger-config-file - make-lizardfs-mfsmetalogger-config-file - lizardfs-mfsmetalogger-config-file? - (working-user lizardfs-mfsmetalogger-config-file-working-user - (default "lizardfs")) - (working-group lizardfs-mfsmetalogger-config-file-working-group - (default "lizardfs")) - (syslog-identifier lizardfs-mfsmetalogger-config-file-syslog-identifier - (default "mfsmetalogger")) - (lock-memory lizardfs-mfsmetalogger-config-file-lock-memory - (default #f)) ; 0 or 1 - (nice-level lizardfs-mfsmetalogger-config-file-nice-level - (default -19)) - (data-path lizardfs-mfsmetalogger-config-file-data-path - (default "/var/lib/lizardfs")) - (back-logs lizardfs-mfsmetalogger-config-file-back-logs - (default 50)) - (back-meta-keep-previous lizardfs-mfsmetalogger-config-file-back-meta-keep-previous - (default 3)) - (meta-download-frequency lizardfs-mfsmetalogger-config-file-meta-download-frequency - (default 24)) - (master-reconnection-delay lizardfs-mfsmetalogger-config-file-master-reconnection-delay - (default 5)) - (master-host lizardfs-mfsmetalogger-config-file-master-host - (default "mfsmaster")) - (master-port lizardfs-mfsmetalogger-config-file-master-port - (default 9419)) - (master-timeout lizardfs-mfsmetalogger-config-file-master-timeout - (default 60))) - -(define-gexp-compiler (lizardfs-mfsmetalogger-config-file-compiler - (file <lizardfs-mfsmetalogger-config-file>) system target) - (match file - (($ <lizardfs-mfsmetalogger-config-file> working-user working-group syslog-identifier lock-memory nice-level data-path back-logs back-meta-keep-previous meta-download-frequency master-reconnection-delay master-host master-port master-timeout) - (gexp->derivation - "mfsmetalogger.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@`("WORKING_USER = " ,working-user "\n") - ,@`("WORKING_GROUP = " ,working-group "\n") - ,@`("SYSLOG_IDENT = " ,syslog-identifier "\n") - ,@(if lock-memory - `("LOCK_MEMORY = 1\n") - `("LOCK_MEMORY = 0\n")) - ,@`("NICE_LEVEL = " ,(number->string nice-level) "\n") - ,@`("DATA_PATH = " ,data-path "\n") - ,@`("BACK_LOGS = " ,(number->string back-logs) "\n") - ,@`("BACK_META_KEEP_PREVIOUS = " ,(number->string back-meta-keep-previous) "\n") - ,@`("META_DOWNLOAD_FREQ = " ,(number->string meta-download-frequency) "\n") - ,@`("MASTER_RECONNECTION_DELAY = " ,(number->string master-reconnection-delay) "\n") - ,@`("MASTER_HOST = " ,master-host "\n") - ,@`("MASTER_PORT = " ,(number->string master-port) "\n") - ,@`("MASTER_TIMEOUT = " ,(number->string master-timeout) "\n")))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-mfschunkserver-config-file> - lizardfs-mfschunkserver-config-file - make-lizardfs-mfschunkserver-config-file - lizardfs-mfschunkserver-config-file? - (label lizardfs-mfschunkserver-label - (default "_")) - (working-user lizardfs-mfschunkserver-config-file-working-user - (default "lizardfs")) - (working-group lizardfs-mfschunkserver-config-file-working-group - (default "lizardfs")) - (syslog-identifier lizardfs-mfschunkserver-config-file-syslog-identifier - (default "mfschunkserver")) - (lock-memory lizardfs-mfschunkserver-config-file-lock-memory - (default #f)) ; 0 or 1 - (nice-level lizardfs-mfschunkserver-config-file-nice-level - (default -19)) - (data-path lizardfs-mfschunkserver-config-file-data-path - (default "/var/lib/lizardfs")) - (master-reconnection-delay lizardfs-mfschunkserver-config-file-master-reconnection-delay - (default 5)) - (bind-host lizardfs-mfschunkserver-bind-host - (default "*")) - (master-host lizardfs-mfschunkserver-config-file-master-host - (default "mfsmaster")) - (master-port lizardfs-mfschunkserver-config-file-master-port - (default 9420)) - (master-timeout lizardfs-mfschunkserver-config-file-master-timeout - (default 60)) - (csserv-listen-host lizardfs-mfschunkserver-config-csserv-listen-host - (default "*")) - (csserv-listen-port lizardfs-mfschunkserver-config-csserv-listen-port - (default 9422)) - (hdd-conf-filename lizardfs-mfschunkserver-config-hdd-conf-filename - (default "/etc/lizardfs/mfshdd.cfg")) ; This should be our generated one - (hdd-leave-space-default lizardfs-mfschunkserver-config-hdd-leave-space-default - (default "4GiB")) - (hdd-test-freq lizardfs-mfschunkserver-config-hdd-test-freq - (default 10)) - (hdd-advise-no-cache lizardfs-mfschunkserver-config-hdd-advise-no-cache - (default #t)) ; 0 or 1 - (hdd-punch-holes lizardfs-mfschunkserver-config-hdd-punch-holes - (default #t)) ; 0 or 1 - (enable-load-factor lizardfrs-mfschunkserver-config-enable-load-factor - (default #f)) ; 0 or 1 - (replication-bandwidth-limit-kbps - lizardfs-mfschunkserver-config-replication-bandwidth-limit-kbps - (default 8192)) - (nr-of-network-workers lizardfs-mfschunkserver-config-nr-of-network-workers - (default 1)) - (nr-of-hdd-workers-per-network-worker - lizardfs-mfschunkerver-config-nr-of-hdd-workers-per-network-pworker - (default 20)) - (read-ahead-kb lizardfs-mfschunkserver-config-read-ahead-kb - (default 0)) - (max-read-behind-kb lizardfs-mfschunkserver-config-max-read-behind-kb - (default 0)) - (create-new-chunks-in-moosefs-format - lizardfs-mfschunkserver-config-crate-new-chunks-in-moosefs-format - (default #t)) ; 0 or 1 - (perform-fsync lizardfs-mfschunkserver-config-perform-fsync - (default #t)) ; 0 or 1 - ) - -(define-gexp-compiler (lizardfs-mfschunkserver-config-file-compiler - (file <lizardfs-mfschunkserver-config-file>) system target) - (match file - (($ <lizardfs-mfschunkserver-config-file> label working-user working-group syslog-identifier lock-memory nice-level data-path master-reconnection-delay bind-host master-host master-port master-timeout csserv-listen-host csserv-listen-port hdd-conf-filename hdd-leave-space-default hdd-test-freq hdd-advise-no-cache hdd-punch-holes enable-load-factor replication-bandwidth-limit-kbps nr-of-network-workers nr-of-hdd-workers-per-network-worker read-ahead-kb max-read-behind-kb create-new-chunks-in-moosefs-format perform-fsync) - (gexp->derivation - "mfschunkserver.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@`("LABEL = " ,label "\n") - ,@`("WORKING_USER = " ,working-user "\n") - ,@`("WORKING_GROUP = " ,working-group "\n") - ,@`("SYSLOG_IDENT = " ,syslog-identifier "\n") - ,@(if lock-memory - `("LOCK_MEMORY = 1\n") - `("LOCK_MEMORY = 0\n")) - ,@`("NICE_LEVEL = " ,(number->string nice-level) "\n") - ,@`("DATA_PATH = " ,data-path "\n") - ,@`("MASTER_RECONNECTION_DELAY = " ,(number->string master-reconnection-delay) "\n") - ,@`("MASTER_HOST = " ,master-host "\n") - ,@`("MASTER_PORT = " ,(number->string master-port) "\n") - ,@`("MASTER_TIMEOUT = " ,(number->string master-timeout) "\n") - ,@`("CSSERV_LISTEN_HOST = " ,csserv-listen-host "\n") - ,@`("CSSERV_LISTEN_PORT = " ,(number->string csserv-listen-port) "\n") - ,@`("HDD_CONF_FILENAME = " ,hdd-conf-filename "\n") - ,@`("HDD_LEAVE_SPACE_DEFAULT = " ,hdd-leave-space-default "\n") - ,@`("HDD_TEST_FREQ = " ,(number->string hdd-test-freq) "\n") - ,@(if hdd-advise-no-cache - `("HDD_ADVISE_NO_CACHE = 1\n") - `("HDD_ADVISE_NO_CACHE = 0\n")) - ,@(if hdd-punch-holes - `("HDD_PUNCH_HOLES = 1\n") - `("HDD_PUNCH_HOLES = 0\n")) - ,@(if enable-load-factor - `("ENABLE_LOAD_FACTOR = 1\n") - `("ENABLE_LOAD_FACTOR = 0\n")) - ,@`("REPLICATION_BANDWIDTH_LIMIT_KBPS = " ,(number->string replication-bandwidth-limit-kbps) "\n") - ,@`("NR_OF_NETWORK_WORKERS = " ,(number->string nr-of-network-workers) "\n") - ,@`("NR_OF_HDD_WORKERS_PER_NETWORK_WORKER = " ,(number->string nr-of-hdd-workers-per-network-worker) "\n") - ,@`("READ_AHEAD_KB = " ,(number->string read-ahead-kb) "\n") - ,@`("MAX_READ_BEHIND_KB = " ,(number->string max-read-behind-kb) "\n") - ,@(if create-new-chunks-in-moosefs-format - `("CREATE_NEW_CHUNKS_IN_MOOSEFS_FORMAT = 1\n") - `("CREATE_NEW_CHUNKS_IN_MOOSEFS_FORMAT = 0\n")) - ,@(if perform-fsync - `("PERFORM_FSYNC = 1\n") - `("PERFORM_FSYNC = 0\n"))))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-mfshdd-config-file> - lizardfs-mfshdd-config-file - make-lizardfs-mfshdd-config-file - lizardfs-mfshdd-config-file? - (disks-to-use lizardfs-mfshdd-config-file-disks-to-use - (default '())) - (disks-to-remove lizardfs-mfshdd-config-file-disks-to-remove - (default '()))) - -(define-gexp-compiler (lizardfs-mfshdd-config-file-compiler - (file <lizardfs-mfshdd-config-file>) system target) - (match file - (($ <lizardfs-mfshdd-config-file> disks-to-use disks-to-remove) - (gexp->derivation - "mfshdd.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@(append-map - (lambda (disk) - `(,disk "\n")) - disks-to-use) - ,@(append-map - (lambda (disk) - `("*" ,disk "\n")) - disks-to-remove)))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-mfsmaster-config-file> - lizardfs-mfsmaster-config-file - make-lizardfs-mfsmaster-config-file - lizardfs-mfsmaster-config-file? - (personality lizardsf-mfsmaster-config-personality - (default "")) - (admin-password lizardfs-mfsmaster-config-admin-password - (default "")) - (working-user lizardfs-mfsmaster-config-working-user - (default "lizardfs")) - (working-group lizardfs-mfsmaster-config-working-group - (default "lizardfs")) - (syslog-ident lizardfs-mfsmaster-config-syslog-ident - (default "mfsmaster")) - (lock-memory lizardfs-mfsmaster-config-lock-memory - (default #f)) ; 0 or 1 - (nice-level lizardfs-mfsmaster-config-nice-level - (default -19)) - (exports-filename lizardfs-mfsmaster-config-exports-filename - (default "/etc/lizardfs/mfsexports.cfg")) ; our created one? - (topology-filename lizardfs-mfsmaster-config-topology-filename - (default "/etc/lizardfs/mfstopology.cfg")) ; our created one? - (custom-goals-filename lizardfs-mfsmaster-config-custom-goals-filename - (default "/etc/lizardfs/mfsgoals.cfg")) ; our created one? - (data-path lizardfs-mfsmaster-config-data-path - (default "/var/lib/lizardfs")) - (prefer-local-chunkserver lizardfs-mfsmaster-prefer-local-chunkserver - (default #t)) ; 0 or 1 - (auto-recovery lizardfs-mfsmaster-config-auto-recovery - (default #f)) ; 0 or 1 - (back-logs lizardfs-mfsmaster-config-back-logs - (default 50)) - (back-meta-keep-previous lizardfs-mfsmaster-config-back-meta-keep-previous - (default 1)) - (operations-delay-init lizardfs-mfsmaster-config-operations-delay-init - (default 300)) - (operations-delay-disconnect lizardfs-mfsmaster-config-operations-delay-disconnect - (default 3600)) - (matoml-listen-host lizardfs-mfsmaster-config-matoml-listen-host - (default "*")) - (matoml-listen-port lizardfs-mfsmaster-config-matoml-listen-port - (default 9419)) - (matoml-log-preserve-seconds lizardfs-mfsmaster-config-matoml-log-preserve-seconds - (default 600)) - (matocs-listen-host lizardfs-mfsmaster-config-matocs-listen-host - (default "*")) - (matocs-listen-port lizardfs-mfsmaster-config-matocs-listen-port - (default 9420)) - (matocl-listen-host lizardfs-mfsmaster-config-matocl-listen-host - (default "*")) - (matocl-listen-port lizardfs-mfsmaster-config-matocl-listen-port - (default 9421)) - (matots-listen-host lizardfs-mfsmaster-config-matots-listen-host - (default "*")) - (matots-listen-port lizardfs-mfsmaster-config-matots-listen-port - (default 9424)) - (chunks-loop-max-cps lizardfs-mfsmaster-config-chunks-loop-max-cps - (default 100000)) - (chunks-loop-min-time lizardfs-mfsmaster-config-chunks-loop-min-time - (default 300)) - (chunks-loop-peroid lizardfs-mfsmaster-config-chunks-loop-period - (default 1000)) - (chunks-loop-max-cpu lizardfs-mfsmaster-config-chunks-loop-max-cpu - (default 60)) - (chunks-soft-del-limit lizardfs-mfsmaster-config-chunks-soft-del-limit - (default 10)) - (chunks-hard-del-limit lizardfs-mfsmaster-config-chunks-hard-del-limit - (default 25)) - (chunks-write-rep-limit lizardfs-mfsmaster-config-chunks-write-rep-limit - (default 2)) - (chunks-read-rep-limit lizardfs-mfsmaster-config-chunks-read-rep-limit - (default 10)) - (endangered-chunks-priority lizardfs-mfsmaster-config-endangered-chunks-priority - (default 0)) - (endangered-chunks-max-capacity lizardfs-mfsmaster-config-endangered-chunks-max-capacity - (default "1Mi")) - (acceptable-difference lizardfs-mfsmaster-config-acceptable-difference - (default 0.1)) - (chunks-rebalancing-between-labels lizardfs-mfsmaster-config-chunks-rebalancing-between-labels - (default 0)) - (free-inodes-period lizardfs-mfsmaster-config-free-inodes-period - (default 60)) - (no-atime lizardfs-mfsmaster-config-no-atime - (default #f)) ; 0 or 1 - (session-sustain-time lizardfs-mfsmaster-config-session-sustain-time - (default 86400)) - (reject-old-client lizardfs-mfsmaster-config-reject-old-clients - (default #f)) ; 0 or 1 - (globaliolimits-filename lizardfs-mfsmaster-config-globaliolimits-filename - (default "/etc/lizardfs/globaliolimits.cfg")) ; our generated one? - (globaliolimits-renegotiation-period-settings - lizardfs-mfsmaster-config-globaliolmits-renegotiation-period-settings - (default 0.1)) - (globaliolimits-accumulate-ms lizardfs-mfsmaster-config-globaliolimits-accumulate-ms - (default 250)) - (mfsmetarestore-path lizardfs-mfsmaster-config-mfsmeaterestore-path - (default (file-append lizardfs "/sbin/mfsmetarestore"))) - (master-reconnection-delay lizardfs-mfsmaster-config-master-reconnection-delay - (default 5)) - (master-host lizardfs-mfsmaster-config-master-host - (default "mfsmaster")) - (master-port lizardfs-mfsmaster-config-master-port - (default 9419)) - (master-timeout lizardfs-mfsmaster-config-master-timeout - (default 60)) - (metadata-checksum-interval lizardfs-mfsmaster-config-metadata-checksum-interval - (default 50)) - (metadata-checksum-recalculation-speed lizardfs-mfsmaster-config-metadata-recalculation-speed - (default 100)) - (disable-metadata-checksum-verification lizardfs-mfsmaster-config-disable-metadata-checksum-verification - (default #f)) ; 0 or 1 - (metadata-save-request-min-period lizardfs-mfsmaster-config-metadata-save-request-min-period - (default 1800)) - (use-bdb-for-name-storage lizardfs-mfsmaster-config-use-bdb-for-name-storage - (default #t)) ; 0 or 1 - (bdb-name-storage-cache lizardfs-mfsmaster-config-bdb-name-storage-cache - (default 10)) - (avoid-same-ip-chunkservers lizardfs-mfsmaster-config-avoid-same-ip-chunkservers - (default #f)) ; 0 or 1 - (load-factor-penalty lizardfs-mfsmaster-config-load-factor-penalty - (default 0)) ; between 0, 0.5, inclusive - (redundancy-level lizardfs-mfsmaster-config-redundancy-level - (default 0)) - (snapshot-initial-batch-size-limit lizardfs-mfsmaster-config-snapshot-initial-batch-size-limit - (default 10000)) - (file-test-loop-min-time lizardfs-mfsmaster-config-file-test-loop-min-time - (default 3600))) - - -(define-gexp-compiler (lizardfs-mfsmaster-config-file-compiler - (file <lizardfs-mfsmaster-config-file>) system target) - (match file - (($ <lizardfs-mfsmaster-config-file> personality admin-password working-user working-group syslog-ident lock-memory nice-level exports-filename topology-filename custom-goals-filename data-path prefer-local-chunkserver auto-recovery back-logs back-meta-keep-previous operations-delay-init operations-delay-disconnect matoml-listen-host matoml-listen-port matoml-log-preserve-seconds matocs-listen-host matocs-listen-port matocl-listen-host matocl-listen-port matots-listen-host matots-listen-port chunks-loop-max-cps chunks-loop-min-time chunks-loop-period chunks-loop-max-cpu chunks-soft-del-limit chunks-hard-del-limit chunks-write-rep-limit chunks-read-rep-limit endangered-chunks-priority endangered-chunks-max-capacity acceptable-difference chunks-rebalancing-between-labels free-inodes-period no-atime session-sustain-time reject-old-client globaliolimits-filename globaliolimits-renegotiation-period-settings globaliolimits-accumulate-ms mfsmetarestore-path master-reconnection-delay master-host master-port master-timeout metadata-checksum-interval metadata-checksum-recalculation-speed disable-metadata-checksum-verification metadata-save-request-min-period use-bdb-for-name-storage bdb-name-storage-cache avoid-same-ip-chunkservers load-factor-penalty redundancy-level snapshot-initial-batch-size-limit file-test-loop-min-time) - (gexp->derivation - "mfsmaster.cfg" - #~(call-with-output-file #$output - (lambda (port) - (display - (string-append - "# This file generated by GNU Guix\n\n" - (ungexp-splicing - `(,@`("PERSONALITY = " ,personality "\n") - ,@`("ADMIN_PASSWORD = \"" ,admin-password "\"\n") - ,@`("WORKING_USER = " ,working-user "\n") - ,@`("WORKING_GROUP = " ,working-group "\n") - ,@`("SYSLOG_IDENT = " ,syslog-ident "\n") - ,@(if lock-memory - `("LOCK_MEMORY = 1\n") - `("LOCK_MEMORY = 0\n")) - ,@`("NICE_LEVEL = " ,(number->string nice-level) "\n") - ,@`("EXPORTS_FILENAME = " ,exports-filename "\n") - ,@`("TOPOLOGY_FILENAME = " ,topology-filename "\n") - ,@`("CUSTOM_GOALS_FILENAME = " ,custom-goals-filename "\n") - ,@`("DATA_PATH = " ,data-path "\n") - ,@(if prefer-local-chunkserver - `("PREFER_LOCAL_CHUNKSERVER = 1\n") - `("PREFER_LOCAL_CHUNKSERVER = 0\n")) - ,@(if auto-recovery - `("AUTO_RECOVERY = 1\n") - `("AUTO_RECOVERY = 0\n")) - ,@`("BACK_LOGS = " ,(number->string back-logs) "\n") - ,@`("BACK_META_KEEP_PREVIOUS = " ,(number->string back-meta-keep-previous) "\n") - ,@`("OPERATIONS_DELAY_INIT = " ,(number->string operations-delay-init) "\n") - ,@`("OPERATIONS_DELAY_DISCONNECT = " ,(number->string operations-delay-disconnect) "\n") - ,@`("MATOML_LISTEN_HOST = " ,matoml-listen-host "\n") - ,@`("MATOML_LISTEN_PORT = " ,(number->string matoml-listen-port) "\n") - ,@`("MATOML_LOG_PRESERVE_SECONDS = " ,(number->string matoml-log-preserve-seconds) "\n") - ,@`("MATOCS_LISTEN_HOST = " ,matocs-listen-host "\n") - ,@`("MATOCS_LISTEN_PORT = " ,(number->string matocs-listen-port) "\n") - ,@`("MATOCL_LISTEN_HOST = " ,matocl-listen-host "\n") - ,@`("MATOCL_LISTEN_PORT = " ,(number->string matocl-listen-port) "\n") - ,@`("MATOTS_LISTEN_HOST = " ,matots-listen-host "\n") - ,@`("MATOTS_LISTEN_PORT = " ,(number->string matots-listen-port) "\n") - ,@`("CHUNKS_LOOP_MAX_CPS = " ,(number->string chunks-loop-max-cps) "\n") - ,@`("CHUNKS_LOOP_MIN_TIME = " ,(number->string chunks-loop-min-time) "\n") - ,@`("CHUNKS_LOOP_PERIOD = " ,(number->string chunks-loop-period) "\n") - ,@`("CHUNKS_LOOP_MAX_CPU = " ,(number->string chunks-loop-max-cpu) "\n") - ,@`("CHUNKS_SOFT_DEL_LIMIT = " ,(number->string chunks-soft-del-limit) "\n") - ,@`("CHUNKS_HARD_DEL_LIMIT = " ,(number->string chunks-hard-del-limit) "\n") - ,@`("CHUNKS_WRITE_REP_LIMIT = " ,(number->string chunks-write-rep-limit) "\n") - ,@`("CHUNKS_READ_REP_LIMIT = " ,(number->string chunks-read-rep-limit) "\n") - ,@`("ENDANGERED_CHUNKS_PRIORITY = " ,(number->string endangered-chunks-priority) "\n") - ,@`("ENDANGERED_CHUNKS_MAX_CAPACITY = " ,endangered-chunks-max-capacity "\n") - ,@`("ACCEPTABLE_DIFFERENCE = " ,(number->string acceptable-difference) "\n") - ,@`("CHUNKS_REBALANCING_BETWEEN_LABELS = " ,(number->string chunks-rebalancing-between-labels) "\n") - ,@`("FREE_INODES_PERIOD = " ,(number->string free-inodes-period) "\n") - ,@(if no-atime - `("NO_ATIME = 1\n") - `("NO_ATIME = 0\n")) - ,@`("SESSION_SUSTAIN_TIME = " ,(number->string session-sustain-time) "\n") - ,@(if reject-old-client - `("REJECT_OLD_CLIENT = 1\n") - `("REJECT_OLD_CLIENT = 0\n")) - ,@`("GLOBALIOLIMITS_FILENAME = " ,globaliolimits-filename "\n") - ,@`("GLOBALIOLIMITS_RENEGOTIATION_PERIOD_SETTINGS = " ,(number->string globaliolimits-renegotiation-period-settings) "\n") - ,@`("GLOBALIOLIMITS_ACCUMULATE_MS = " ,(number->string globaliolimits-accumulate-ms) "\n") - ,@`("MFSMETARESTORE_PATH = " ,mfsmetarestore-path "\n") - ,@`("MASTER_RECONNECTION_DELAY = " ,(number->string master-reconnection-delay) "\n") - ,@`("MASTER_HOST = " ,master-host "\n") - ,@`("MASTER_PORT = " ,(number->string master-port) "\n") - ,@`("MASTER_TIMEOUT = " ,(number->string master-timeout) "\n") - ,@`("METADATA_CHECKSUM_INTERVAL = " ,(number->string metadata-checksum-interval) "\n") - ,@`("METADATA_CHECKSUM_RECALCULATION_SPEED = " ,(number->string metadata-checksum-recalculation-speed) "\n") - ,@(if disable-metadata-checksum-verification - `("DISABLE_METADATA_CHECKSUM_VERIFICATION = 1\n") - `("DISABLE_METADATA_CHECKSUM_VERIFICATION = 0\n")) - ,@`("METADATA_SAVE_REQUEST_MIN_PERIOD = " ,(number->string metadata-save-request-min-period) "\n") - ,@(if use-bdb-for-name-storage - `("USE_BDB_FOR_NAME_STORAGE = 1\n") - `("USE_BDB_FOR_NAME_STORAGE = 0\n")) - ,@`("BDB_NAME_STORAGE_CACHE = " ,(number->string bdb-name-storage-cache) "\n") - ,@(if avoid-same-ip-chunkservers - `("AVOID_SAME_IP_CHUNKSERVERS = 1\n") - `("AVOID_SAME_IP_CHUNKSERVERS = 0\n")) - ,@`("LOAD_FACTOR_PENALTY = " ,(number->string load-factor-penalty) "\n") - ,@`("REDUNDANCY_LEVEL = " ,(number->string redundancy-level) "\n") - ,@`("SNAPSHOT_INITIAL_BATCH_SIZE_LIMIT = " ,(number->string snapshot-initial-batch-size-limit) "\n") - ,@`("FILE_TEST_LOOP_MIN_TIME = " ,(number->string file-test-loop-min-time) "\n")))) - port))) - #:local-build? #t)))) - -(define-record-type* <lizardfs-configuration> - lizardfs-configuration - make-lizardfs-configuration - lizardfs-configuration? - (package lizardfs-configuration-package - (default lizardfs)) - (mfsmetalogger-config lizardfs-configuration-mfsmetalogger-config - (default (lizardfs-mfsmetalogger-config-file))) - (mfschunkserver-config lizardfs-configuration-mfschunkserver-config - (default (lizardfs-mfschunkserver-config-file))) - (mfshdd-config lizardfs-configuration-mfshdd-config - (default (lizardfs-mfshdd-config-file))) - (mfsmaster-config lizardfs-configuration-mfsmaster-config - (default (lizardfs-mfsmaster-config-file))) - (run-mfsmetalogger-service? lizardfs-configuration-run-mfsmetalogger-service - (default #f)) - (mfsgoals-config lizardfs-configuration-mfsgoals-config - (default (plain-file "mfsgoals.cfg" - (string-append - "1 1_copy : _\n" - "2 2_copies : _ _\n" - "3 3_copies : _ _ _\n")))) - (mfsmount-config lizardfs-configuration-mfsmount-config - (default (plain-file "mfsmount.cfg" - ""))) - (mfsexports-config lizardfs-configuration-mfsexports-config - (default (plain-file "mfsexports.cfg" - ""))) - (mfstopology-config lizardfs-configuration-mfstopology-config - (default (plain-file "mfstopology.cfg" - ""))) - (globaliolimits-config lizardfs-configuration-globaliolimits-config - (default (plain-file "globaliolimits.cfg" - ""))) - (iolimits-config lizardfs-configuration-iolimits-config - (default (plain-file "iolimits.cfg" - "")))) - -(define lizardfs-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Lizardfs mfsmaster server") - (provision '(lizardfs)) - (requirement '(loopback)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/mfsmaster") - "-c" "/etc/lizardfs/mfsmaster.cfg" - "-d" "start") - #:log-file "/var/log/mfsmaster.log")) - (stop #~(make-system-destructor - #$(file-append package "/sbin/mfsmaster") - " -c /etc/lizardfs/mfsmaster.cfg" - " stop")) - (respawn? #f) - (auto-start? #f) - ))))) - -(define lizardfs-mfsmetalogger-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Lizardfs mfsmetalogger server") - (provision '(lizardfs-mfsmetalogger)) - (requirement '(loopback lizardfs)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/mfsmetalogger") - "-c" "/etc/lizardfs/mfsmetalogger.cfg" - "-d" "start") - #:log-file "/var/log/mfsmetalogger.log")) - (stop #~(make-system-destructor - #$(file-append package "/sbin/mfsmetalogger") - " -c /etc/lizardfs/mfsmetalogger.cfg" - " stop")) - (auto-start? #f) - ))))) - -(define lizardfs-mfschunkserver-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Lizardfs mfschunkserver server") - (provision '(lizardfs-mfschunkserver)) - (requirement '(loopback lizardfs)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/mfschunkserver") - "-c" "/etc/lizardfs/mfschunkserver.cfg" - "-d" "start") - #:log-file "/var/log/mfschunkserver.log")) - (stop #~(make-system-destructor - #$(file-append package "/sbin/mfschunkserver") - " -c /etc/lizardfs/mfschunkserver.cfg" - " stop")) - (auto-start? #f) - ))))) - -(define lizardfs-mfsmount-shepherd-service - (match-lambda - (($ <lizardfs-configuration> package) - (list - (shepherd-service - (documentation "Mount Lizardfs filesystems") - (provision '(lizardfs-mounts)) - (requirement '(loopback)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/bin/mfsmount") - ;#$mountpoint - "-o" "mfsdelayedinit") - )) - ;(stop #~(make-system-destructor #$(file-append fuse "/bin/fusermount") " -u " #$mountpoint)) - (stop #~(make-kill-destructor)) - (auto-start? #f) - ))))) - -(define (lizardfs-etc-service config) - `(("lizardfs/globaliolimits.cfg" - ,(lizardfs-configuration-globaliolimits-config config)) - ("lizardfs/iolimits.cfg" - ,(lizardfs-configuration-iolimits-config config)) - ("lizardfs/mfschunkserver.cfg" - ,(lizardfs-configuration-mfschunkserver-config config)) - ("lizardfs/mfsexports.cfg" - ,(lizardfs-configuration-mfsexports-config config)) - ("lizardfs/mfsgoals.cfg" - ,(lizardfs-configuration-mfsgoals-config config)) - ("lizardfs/mfshdd.cfg" - ,(lizardfs-configuration-mfshdd-config config)) - ("lizardfs/mfsmaster.cfg" - ,(lizardfs-configuration-mfsmaster-config config)) - ("lizardfs/mfsmetalogger.cfg" - ,(lizardfs-configuration-mfsmetalogger-config config)) - ("lizardfs/mfsmount.cfg" - ,(lizardfs-configuration-mfsmount-config config)) - ("lizardfs/mfstopology.cfg" - ,(lizardfs-configuration-mfstopology-config config)))) - -(define (lizardfs-activation config) - #~(begin - (unless (and (file-exists? "/var/lib/lizardfs/metadata.mfs") - (lizardfs-configuration-run-mfsmetalogger-service config)) - ;; First run "service". - (with-output-to-file "/var/lib/lizardfs/metadata.mfs" - (lambda () - (format #t "MFSM NEW")))) - #$(plain-file? (lizardfs-configuration-globaliolimits-config config)) - #$(plain-file? (lizardfs-configuration-iolimits-config config)) - #$(plain-file? (lizardfs-configuration-mfschunkserver-config config)) - #$(plain-file? (lizardfs-configuration-mfsexports-config config)) - #$(plain-file? (lizardfs-configuration-mfsgoals-config config)) - #$(plain-file? (lizardfs-configuration-mfshdd-config config)) - #$(plain-file? (lizardfs-configuration-mfsmaster-config config)) - #$(plain-file? (lizardfs-configuration-mfsmetalogger-config config)) - #$(plain-file? (lizardfs-configuration-mfsmount-config config)) - #$(plain-file? (lizardfs-configuration-mfstopology-config config)) - #t)) - -(define (lizardfs-services-to-run config) - (append (lizardfs-shepherd-service config) - (lizardfs-mfschunkserver-shepherd-service config) - (if (lizardfs-configuration-run-mfsmetalogger-service config) - (lizardfs-mfsmetalogger-shepherd-service config) - '()))) - -(define lizardfs-service-type - (service-type - (name 'lizardfs) - (extensions - (list - (service-extension shepherd-root-service-type - lizardfs-services-to-run) - (service-extension activation-service-type - lizardfs-activation) - (service-extension etc-service-type - lizardfs-etc-service) - (service-extension account-service-type - (const %lizardfs-accounts)) - (service-extension profile-service-type - (compose list lizardfs-configuration-package)))) - (default-value (lizardfs-configuration)) - (description ""))) diff --git a/gn/services/genenetwork1.scm b/gn/services/genenetwork1.scm deleted file mode 100644 index 4e29956..0000000 --- a/gn/services/genenetwork1.scm +++ /dev/null @@ -1,33 +0,0 @@ -(define-module (gn services genenetwork1)) - -(use-modules (gnu) - (past packages python) - (past packages web) - (gn packages genenetwork) - (gn packages python24) - (gn services gn1-httpd-config)) -(use-service-modules web) - -(operating-system - (host-name "genenetwork") - (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 '()) - (packages (cons* %base-packages)) - (services (list (service special-files-service-type - ;; The genotypes folder doesn't have it's shebangs patched. - `(("/usr/bin/python" ,(file-append python-2.4 "/bin/python")))) - (service httpd-service-type - (httpd-configuration - ;; Must be a httpd-2.2 variant. - (package httpd22-with-mod-python) - (config GN1-httpd-config)))))) - -;; guix system container -L /path/to/guix-past/modules/ -L /path/to/guix-bioinformatics/ /path/to/guix-bioinformatics/gn/services/genenetwork1.scm --network --expose=/gnshare/gn/web/genotypes -;; xdg-open http://localhost:8042 diff --git a/gn/services/genome-browser.scm b/gn/services/genome-browser.scm deleted file mode 100644 index e350674..0000000 --- a/gn/services/genome-browser.scm +++ /dev/null @@ -1,207 +0,0 @@ -;; See dockerfile for some clarification about choices: -;; https://github.com/icebert/docker_ucsc_genome_browser/blob/master/Dockerfile -;; http://genome.ucsc.edu/goldenPath/help/mirrorManual.html -(define-module (gn services genome-browser)) - -(use-modules (gnu) - (guix build utils) - (guix packages) - (gn packages bioinformatics)) -(use-service-modules - databases - networking - web) -(use-package-modules - bash - databases - ghostscript - wget) - -(define %hg.conf - (mixed-text-file "hg.conf" - "browser.documentRoot=" ucsc-genome-browser "/html\n" - ;"db.host=localhost\n" - ;"db.user=readonly\n" - ;"db.password=access\n" - "db.host=tux02\n" - "db.user=webqtlout\n" - "db.password=webqtlout\n" - "db.trackDb=trackDb\n" - ;"db.port=13306\n" - "gbdbLoc1=/gbdb/\n" - "gbdbLoc2=http://hgdownload.soe.ucsc.edu/gbdb/\n" - ;# To disable on-the-fly loading of mysql data, comment out these lines. - "slow-db.host=genome-mysql.soe.ucsc.edu\n" - "slow-db.user=genomep\n" - "slow-db.password=password\n" - "defaultGenome=Mouse\n" - "central.db=hgcentral\n" - ;"central.host=localhost\n" - ;"central.socket=/run/mysqld/mysqld.sock\n" ; default for mysql service - ;"central.user=readwrite\n" - ;"central.password=update\n" - "central.host=tux02\n" - "central.user=webqtlout\n" - "central.password=webqtlout\n" - "central.domain=\n" - "backupcentral.db=hgcentral\n" - "backupcentral.host=tux02\n" - "backupcentral.user=webqtlout\n" - "backupcentral.password=webqtlout\n" - "backupcentral.domain=\n" - "freeType=on\n" - "freeTypeDir=" gs-fonts "/share/fonts/type1/ghostscript\n" - ;"hgc.psxyPath=" gmt "/bin/psxy" - ;"hgc.ps2rasterPath=" gmt "/bin/ps2raster" - "hgc.ghostscriptPath=" ghostscript "/bin/gs\n" ; needed? - "udc.cacheDir=/var/cache/genome/udcCache\n")) ; default is /tmp/udcCache - -(define %startup-script - (mixed-text-file "create_databases.sh" - wget "/bin/wget http://hgdownload.soe.ucsc.edu/admin/hgcentral.sql\n" - bash-minimal "/bin/sh " (package-source ucsc-genome-browser) "/src/product/ex.MySQLUserPerms.sh\n" - mariadb "/bin/mysql -e \"create database hgcentral;\" mysql\n" - mariadb "/bin/mysql hgcentral < hgcentral.sql\n" - coreutils-minimal "/bin/mkdir -p /var/cache/genome\n" - coreutils-minimal "/bin/chown -R httpd:httpd /var/www\n")) - -;; This might be useful as a one-off shepherd job. -;(define %genome-activation-script -; #~(begin -; ;(unless (file-exists? "/var/lib/mysql/hgcentral") -; ; (invoke #$(file-append wget "/bin/wget") "http://hgdownload.soe.ucsc.edu/admin/hgcentral.sql" "-O" "/var/lib/mysql/hgcentral.sql") -; ; ;(invoke "sh" #$(file-append (package-source ucsc-genome-browser) "/src/product/ex.MySQLUserPerms.sh")) -; ; (invoke #$(file-append mariadb "/bin/mysql") "-e" "\"create database hgcentral;\"" "mysql") -; ; (invoke #$(file-append mariadb "/bin/mysql") "hgcentral" "<" "/var/lib/mysql/hgcentral.sql")) -; (unless (file-exists? "/var/www/html/trash") -; (mkdir-p "/var/www/html/trash")) -; (unless (file-exists? "/var/cache/genome") -; (mkdir-p "/var/cache/genome")) -; (for-each (lambda (file) -; (chown file (passwd:uid "httpd") (passwd:gid "httpd"))) -; (append (find-files "/var/cache/genome" #:directories? #t) -; (find-files "/var/www/html/trash" #:directories? #t))) -; (for-each (lambda (file) -; (chown file (passwd:uid "mysql") (passwd:gid "mysql"))) -; (find-files "/var/lib/mysql" #:directories? #t)))) - -;(define %one-month-files -; (let ((%one-month (* 60 60 24 30))) -; (find-files "/var/cache/genome" (lambda (file stat) -; (> (stat:atime stat) %one-month))))) - -;; TODO: -;; create 'daily clean' mcron scripts. Only needed in /var/cache/genome grows too large. -;; use rsync to make sure mouse genome data is kept up-to-date. - -(define ucsc-genome-browser-port 4323) - -(operating-system - (host-name "genome-browser") - (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 '()) - (packages (cons* mariadb ; for create-db script, interacting with database if necessary - %base-packages)) - (services - (list ;(service mysql-service-type - ; (mysql-configuration - ; (port 13306))) ; don't overlap with tux02's mariadb - (service special-files-service-type - `(;("/root/create_hgcentral" ,%startup-script) - ("/var/lib/genome/hg.conf" ,%hg.conf))) - (service inetd-service-type - (inetd-configuration - (entries - (list - (inetd-entry - (node "127.0.0.1") - (name "blat") ; yes, it's named blat - (socket-type 'stream) - (protocol "tcp") ; probably? - (wait? #f) - (user "httpd:httpd") ; or dedicated user. Needs write access. - (program (file-append ucsc-genome-browser "/bin/gfServer")) - (arguments - '("gfServer" "dynserver" "/gbdb"))))))) - (service syslog-service-type) ; needed by inetd - (service httpd-service-type - (httpd-configuration - (config - (httpd-config-file - (document-root (file-append ucsc-genome-browser "/html")) - (server-name "Genome_Browser") - (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 -# More logs for more debugging. -LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b\" common -CustomLog /var/log/httpd/combined_log common -#LogLevel debug -# cgid.sock needs to be creatable, not in the store -ScriptSock /var/run/cgid.sock -#XBitHack needs to not be inside the VirtualHost block. -XBitHack On -# same as 'listen' above -<VirtualHost *:" (number->string ucsc-genome-browser-port) "> - DocumentRoot " ucsc-genome-browser "/html - Alias /bin " ucsc-genome-browser "/bin - #Alias /cgi-bin " ucsc-genome-browser "/cgi-bin # causes cgi scripts to fail to render - Alias /favicon.ico " ucsc-genome-browser "/html/faviconRR.ico - Alias /htdocs " ucsc-genome-browser "/htdocs - #Alias /htdocs " ucsc-genome-browser "/html - Alias /var/www/html/trash /var/cache/genome - Alias /var/cache/genome /var/cache/genome - <Directory " ucsc-genome-browser "/html> - Options +Includes - #Options +Includes +FollowSymLinks +Indexes - AllowOverride None - <IfModule mod_authz_host.c> - Require all granted - SSILegacyExprParser on - </IfModule> - </Directory> - - ScriptAlias /cgi-bin " ucsc-genome-browser "/cgi-bin - <Directory " ucsc-genome-browser "/cgi-bin> - AllowOverride None - Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - #Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +Includes +FollowSymlinks - Order allow,deny - #SetHandler cgi-script - Require all granted - Allow from all - </Directory> - - <Directory /var/cache/genome> - Options MultiViews - AllowOverride None - Order allow,deny - Allow from all - </Directory> - # Upstream default location, possibly expected by software - <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 --share=/export/efraimf/UCSC_Genome/gbdb=/gbdb --share=/export/efraimf/UCSC_Genome/var-lib-mysql=/var/lib/mysql --share=/export/efraimf/UCSC_Genome/var-cache-genome=/var/cache/genome --share=/export/efraimf/UCSC_Genome/var-cache-genome=/var/www/html/trash -;; xdg-open http://localhost:4322 diff --git a/gn/services/gitea-README b/gn/services/gitea-README deleted file mode 100644 index 51be573..0000000 --- a/gn/services/gitea-README +++ /dev/null @@ -1,17 +0,0 @@ -SETUP: - -The setup process works like this: -Decide where you want the base directory for gitea - for example: /srv/services/gitea -# mkdir -p /srv/services -Make the directory itself writable -# chmod o+w /srv/services -Decide the user/group you want to own the directory and service and change the container -$ sed -i 's/1009/<insert-number>/g' gitea-container.scm - -for running the service: -see included gitea.service - -for upgrades: -# guix pull -# systemctl restart gitea.service diff --git a/gn/services/gitea-container.scm b/gn/services/gitea-container.scm deleted file mode 100644 index 397e6fb..0000000 --- a/gn/services/gitea-container.scm +++ /dev/null @@ -1,94 +0,0 @@ -(define-module (gn services gitea-container)) - -(use-modules (gnu) - (gn packages gitea) - (guix records) - (ice-9 match)) -(use-service-modules base networking shepherd) - -(define %GITEA_WORK_DIR "/var/lib/git/gitea") -(define-record-type* <gitea-configuration> - gitea-configuration - make-gitea-configuration - gitea-configuration? - (package gitea-configuration-package ; package - (default gitea)) - (work-dir gitea-configuration-work-dir ; string - (default %GITEA_WORK_DIR)) - (port gitea-configuration-port ; number - (default 3300))) - -(define gitea-activation - (match-lambda - (($ <gitea-configuration> package work-dir port) - #~(begin - (use-modules (guix build utils)) - (let ((%user (getpwnam "gitea"))) - ;; Prepare the environment for gitea: - ;; https://docs.gitea.io/en-us/install-from-binary/ - (unless (directory-exists? #$work-dir) - (mkdir-p #$work-dir) - ;; These two are supposed to be recursive. - (chown #$work-dir (passwd:uid %user) (passwd:gid %user)) - (chmod #$work-dir #o750))))))) - -(define gitea-shepherd-service - (match-lambda - (($ <gitea-configuration> package work-dir port) - (list (shepherd-service - (documentation "Run the Gitea server.") - (requirement '(networking)) - (provision '(gitea)) - (start #~(make-forkexec-constructor - (list - #$(file-append package "/bin/gitea") - "--port" #$(number->string port)) - #:environment-variables - (list (string-append "GITEA_WORK_DIR=" #$work-dir) - (string-append "HOME=" #$work-dir)) - #:user "gitea" - #:group "git")) - (stop #~(make-kill-destructor))))))) - -(define gitea-service-type - (service-type - (name 'gitea) - (extensions - (list (service-extension shepherd-root-service-type - gitea-shepherd-service) - (service-extension activation-service-type - gitea-activation))) - (description - "Run a Gitea server.") - (default-value (gitea-configuration)))) - - -(operating-system - (host-name "gitea") - (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 or containers. - (firmware '()) - - ;; The user and group names aren't important, but the user uid and group id - ;; NEED to match the directory outside of the container. - (users (cons (user-account - (name "gitea") - (group "gitea") - ;(system? #t) - (uid 1021)) - %base-user-accounts)) - - (groups (cons (user-group - (name "git") - ;(system? #t) - (id 998)) - %base-groups)) - - (services (list (service dhcp-service-type) - (service gitea-service-type)))) diff --git a/gn/services/gitea-dump.service b/gn/services/gitea-dump.service deleted file mode 100644 index c177334..0000000 --- a/gn/services/gitea-dump.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Backup Gitea git server -Wants=gitea.service - -[Service] -Type=oneshot -Environment="GITEA_COMMAND=/usr/local/guix-profiles/gitea/bin/gitea" -ExecStart=/bin/su -l gitea -c 'GITEA_WORK_DIR=/var/lib/git/gitea HOME=/var/lib/git/gitea ${GITEA_COMMAND} dump' - -[Install] -WantedBy=multi-user.target diff --git a/gn/services/gitea-dump.timer b/gn/services/gitea-dump.timer deleted file mode 100644 index 0fa0f29..0000000 --- a/gn/services/gitea-dump.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Backup Gitea git server timer - -[Timer] -OnBootSec=15m -OnUnitInactiveSec=1day - -[Install] -WantedBy=default.target diff --git a/gn/services/gitea-nocontainer.service b/gn/services/gitea-nocontainer.service deleted file mode 100644 index 6784e51..0000000 --- a/gn/services/gitea-nocontainer.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Gitea git server and web ui -Wants=guix-daemon.service - -[Service] -Environment="GITEA_COMMAND=/usr/local/guix-profiles/gitea/bin/gitea" -ExecStart=/bin/su -l gitea -c 'GITEA_WORK_DIR=/var/lib/git/gitea HOME=/var/lib/git/gitea ${GITEA_COMMAND} --port 3300' - -[Install] -WantedBy=multi-user.target diff --git a/gn/services/gitea.service b/gn/services/gitea.service deleted file mode 100644 index ee596dc..0000000 --- a/gn/services/gitea.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Gitea git server and web ui -Wants=guix-daemon.service - -[Service] -Environment="GITEA_COMMAND=$(/var/guix/profiles/per-user/efraimf/current-guix/bin/guix system container /home/efraimf/workspace/guix-bioinformatics/gn/services/gitea-container.scm --share=/var/lib/git=/var/lib/git --network)" -ExecStart=/bin/bash -c '${GITEA_COMMAND}' - -[Install] -WantedBy=multi-user.target diff --git a/gn/services/gn1-httpd-config.scm b/gn/services/gn1-httpd-config.scm deleted file mode 100644 index 6b2397d..0000000 --- a/gn/services/gn1-httpd-config.scm +++ /dev/null @@ -1,136 +0,0 @@ -(define-module (gn services gn1-httpd-config) - #:export (%default-httpd22-modules - GN1-httpd-config)) - -(use-modules (gnu) - (ice-9 match) - (gn packages genenetwork) - (past packages web)) -(use-service-modules web) - -(define %default-httpd22-modules - (map (match-lambda - ((name file) - (httpd-module - (name name) - (file file)))) - '(("authn_file_module" "modules/mod_authn_file.so") - ("authn_dbm_module" "modules/mod_authn_dbm.so") - ("authn_anon_module" "modules/mod_authn_anon.so") - ("authn_dbd_module" "modules/mod_authn_dbd.so") - ("authn_default_module" "modules/mod_authn_default.so") - ("authz_host_module" "modules/mod_authz_host.so") - ("authz_groupfile_module" "modules/mod_authz_groupfile.so") - ("authz_user_module" "modules/mod_authz_user.so") - ("authz_dbm_module" "modules/mod_authz_dbm.so") - ("authz_owner_module" "modules/mod_authz_owner.so") - ("authz_default_module" "modules/mod_authz_default.so") - ("auth_basic_module" "modules/mod_auth_basic.so") - ("auth_digest_module" "modules/mod_auth_digest.so") - ("dbd_module" "modules/mod_dbd.so") - ("dumpio_module" "modules/mod_dumpio.so") - ("reqtimeout_module" "modules/mod_reqtimeout.so") - ("ext_filter_module" "modules/mod_ext_filter.so") - ("include_module" "modules/mod_include.so") - ("filter_module" "modules/mod_filter.so") - ("substitute_module" "modules/mod_substitute.so") - ("log_config_module" "modules/mod_log_config.so") - ("logio_module" "modules/mod_logio.so") - ("env_module" "modules/mod_env.so") - ("mime_magic_module" "modules/mod_mime_magic.so") - ("expires_module" "modules/mod_expires.so") - ("headers_module" "modules/mod_headers.so") - ("ident_module" "modules/mod_ident.so") - ("setenvif_module" "modules/mod_setenvif.so") - ("version_module" "modules/mod_version.so") - ("ssl_module" "modules/mod_ssl.so") - ("mime_module" "modules/mod_mime.so") - ("dav_module" "modules/mod_dav.so") - ("status_module" "modules/mod_status.so") - ("autoindex_module" "modules/mod_autoindex.so") - ("asis_module" "modules/mod_asis.so") - ("info_module" "modules/mod_info.so") - ("cgi_module" "modules/mod_cgi.so") - ("dav_fs_module" "modules/mod_dav_fs.so") - ("vhost_alias_module" "modules/mod_vhost_alias.so") - ("negotiation_module" "modules/mod_negotiation.so") - ("dir_module" "modules/mod_dir.so") - ("imagemap_module" "modules/mod_imagemap.so") - ("actions_module" "modules/mod_actions.so") - ("speling_module" "modules/mod_speling.so") - ("userdir_module" "modules/mod_userdir.so") - ("alias_module" "modules/mod_alias.so") - ("rewrite_module" "modules/mod_rewrite.so")))) - -; Alternative setup -; (let* ((gn1-user "wrk") -; (gn1-source "/home/wrk/gn1-pjotr/gnshare/gn") -; (gn1-server "gn1-pjotr.genenetwork.org") -; (gn1-port "8043")) - - -(define GN1-httpd-config - (let* ((gn1-user "gn1") - (gn1-source (string-append "/home/" gn1-user "/production/gnshare/gn")) - (gn1-server "gn1.genenetwork.org") - (gn1-port "8042")) - (httpd-config-file - (server-name gn1-server) - ;; Defaults to httpd, should be same as 'package' above to launch service. - (server-root httpd22-with-mod-python) - (user gn1-user) - (group "users") - (pid-file (string-append "/tmp/guix-gn1/httpd-gn1-source-" gn1-port ".pid")) - (error-log (string-append "/tmp/guix-gn1/httpd-gn1-source-error-" gn1-port ".log")) - (listen `(,gn1-port)) - (modules (cons* - (httpd-module - (name "python_module") - (file "modules/mod_python.so")) - %default-httpd22-modules)) - (extra-config (list "\ -TypesConfig " httpd22-with-mod-python "/etc/httpd/mime.types -DefaultType application/octet-stream -# DocumentRoot MUST NOT be in the PythonPath. Because gn1-source must be in PythonPath we leave the document-root keyword above unset. -PythonPath \"sys.path+['/run/current-system/profile/lib/python2.4', '/run/current-system/profile/lib/python2.4/site-packages', '" gn1-source "/web/webqtl']\" -# same as 'listen' above -NameVirtualHost *:" gn1-port " -<VirtualHost *:" gn1-port "> - DocumentRoot "gn1-source "/web/ - Alias /images "gn1-source "/web/images/ - Alias /javascript "gn1-source "/web/javascript/ - Alias /css "gn1-source "/web/css/ - <Directory "gn1-source "/web/images> - AllowOverride None - Order allow,deny - Allow from all - </Directory> - <Directory "gn1-source "/web/javascript> - AllowOverride None - Order allow,deny - Allow from all - </Directory> - <Directory "gn1-source "/web/css> - AllowOverride None - Order allow,deny - Allow from all - </Directory> -</VirtualHost> -<Directory " gn1-source "/web/webqtl> - #what is the difference between these two? - AddHandler mod_python .py - #SetHandler python-program - #publisher has more debug information - PythonHandler " gn1-source "/web/webqtl/main.py - #PythonHandler mod_python.publisher - #PythonHandler mod_python.cgihandler - PythonOption mod_python.session.session_type FileSession - # only while debugging: - PythonDebug On -</Directory> -# only while debugging: -# <Location /mpinfo> -# SetHandler python-program -# PythonHandler mod_python.testhandler -# </Location>" -))))) diff --git a/gn/services/rn6-assembly-container.scm b/gn/services/rn6-assembly-container.scm deleted file mode 100644 index b0b5f1d..0000000 --- a/gn/services/rn6-assembly-container.scm +++ /dev/null @@ -1,24 +0,0 @@ -(define-module (gn services rn6-assembly-container)) - -(use-modules (gnu) - (gn packages bioinformatics) - (gn services rshiny)) - -(operating-system - (host-name "rn6-assembly") - (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 only need a few packages inside the container. - (packages '()) - - (services (list (service rshiny-service-type - (rshiny-configuration - (package rn6-assembly-error-app) - (binary "rn6-assembly-error-app")))))) diff --git a/gn/services/rshiny.scm b/gn/services/rshiny.scm deleted file mode 100644 index 90e4728..0000000 --- a/gn/services/rshiny.scm +++ /dev/null @@ -1,86 +0,0 @@ -(define-module (gn services rshiny) - #:export (<rshiny-configuration> - rshiny-configuration - rshiny-configuration? - rshiny-configuration-package - rshiny-configuration-binary - rshiny-shepherd-service - rshiny-service-type)) - -(use-modules (gnu) - (guix records) - (ice-9 match)) -(use-service-modules shepherd) -(use-package-modules cran) - -(define-record-type* <rshiny-configuration> - rshiny-configuration - make-rshiny-configuration - rshiny-configuration? - (package rshiny-configuration-package ; package - (default r-shiny)) - (binary rshiny-configuration-binary ; string - (default "rshiny"))) - -(define rshiny-shepherd-service - (match-lambda - (($ <rshiny-configuration> package binary) - (list - (shepherd-service - (documentation (string-append "R-Shiny service for " binary)) - (provision (list (symbol-append 'rshiny- (string->symbol - (string-take binary 9))))) - (requirement '(networking)) - (start - #~(exec-command - (list - #$(string-append "/run/current-system/profile/bin/" binary)) - ;#:log-file #$(string-append "/var/log/" binary ".log") ; kills shepherd - #:environment-variables - (list "R_LIBS_USER=/run/current-system/profile/site-library/"))) - ;; Now lets try it with fork+exec - ;; Outcome: shepherd says failed, runs in the background. - ;(start - ; #~(fork+exec-command - ; (list - ; #$(string-append "/run/current-system/profile/bin/" binary)) - ; #:environment-variables - ; (list "R_LIBS_USER=/run/current-system/profile/site-library/"))) - ;; More fork+exec trials, this time with a log file: - ;; Outcome: shepherd says failed, runs in the background, log populated. - ;(start - ; #~(fork+exec-command - ; (list - ; "/run/current-system/profile/bin/nohup" - ; #$(string-append "/run/current-system/profile/bin/" binary) "&") - ; #:log-file #$(string-append "/var/log/" binary ".log") - ; #:environment-variables - ; (list "R_LIBS_USER=/run/current-system/profile/site-library/"))) - ;; Now lets try it with make-forkexec: - ;; Outcome: Kills shepherd, does not run in the background. - ;(start - ; #~(make-forkexec-command - ; (list - ; "/run/current-system/profile/bin/nohup" - ; #$(string-append "/run/current-system/profile/bin/" binary) "&") - ; "/run/current-system/profile/bin/bash" "-c" - ; #$(string-append "/run/current-system/profile/bin/" binary)) - ; #:environment-variables - ; (list "R_LIBS_USER=/run/current-system/profile/site-library/"))) - (stop #~(make-kill-destructor))))))) - -(define rshiny-service-type - (service-type - (name 'rshiny) - (extensions - (list - (service-extension shepherd-root-service-type - rshiny-shepherd-service) - (service-extension profile-service-type - ;; We want the package installed so that it - ;; pulls in the propagated inputs as well. - (lambda (config) - (list - (rshiny-configuration-package config)))))) - (description - "Run an R-Shiny webapp as a Guix Service."))) diff --git a/gn/services/science.scm b/gn/services/science.scm deleted file mode 100644 index a28f7c5..0000000 --- a/gn/services/science.scm +++ /dev/null @@ -1,387 +0,0 @@ -(define-module (gn services science) - #:export (munge-configuration - munge-configuration? - munge-service-type - - slurm-configuration - slurm-configuration? - slurm-service-type)) - -(use-modules (gnu) - (guix records) - (ice-9 match)) -(use-service-modules shepherd) -(use-package-modules admin parallel) - -;; TODO: Make id/uid configurable -(define %munge-accounts - (list (user-group - (name "munge") - (id 900) - (system? #t)) - (user-account - (name "munge") - (group "munge") - (uid 900) - (system? #t) - (comment "Munge User") - (home-directory "/var/lib/munge") - (shell (file-append shadow "/sbin/nologin"))))) - -(define-record-type* <munge-configuration> - munge-configuration - make-munge-configuration - munge-configuration? - (package munge-configuration-package - (default munge)) - (socket munge-configuration-socket - (default "/var/run/munge/munge.socket.2")) - (pid-file munge-configuration-pid-file - (default "/var/run/munge/munged.pid")) - (log-file munge-configuration-log-file - (default "/var/log/munge/munged.log")) - (key munge-configuration-key - (default "/etc/munge/munge.key"))) - -(define (munge-activation config) - "Return the activation GEXP for CONFIG for the munge service." - (with-imported-modules '((guix build utils)) - #~(begin - (define %user (getpw "munge")) - (let* ((homedir (passwd:dir %user)) - (key #$(munge-configuration-key config)) - (etc-dir (dirname key)) - (run-dir (dirname #$(munge-configuration-pid-file config))) - (log-dir (dirname #$(munge-configuration-log-file config)))) - (for-each (lambda (dir) - (unless (file-exists? dir) - (mkdir-p dir)) - (chown dir (passwd:uid %user) (passwd:gid %user)) - (chmod dir #o700)) - (list homedir etc-dir log-dir)) - (unless (file-exists? key) - (invoke #$(file-append (munge-configuration-package config) - "/sbin/mungekey") - "--create" - (string-append "--bits=" (number->string (* 8 1024))) ; bits, not bytes - (string-append "--keyfile=" key))) - (chown key (passwd:uid %user) (passwd:gid %user)) - (chmod key #o400) - (unless (file-exists? run-dir) - (mkdir-p run-dir)) - (chown run-dir (passwd:uid %user) (passwd:gid %user)))))) - -(define munge-shepherd-service - (match-lambda - (($ <munge-configuration> package socket pid-file log-file key) - (list - (shepherd-service - (documentation "Munge server") - (provision '(munge)) - (requirement '(loopback user-processes)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/munged") - "--foreground" ; "--force" - (string-append "--socket=" #$socket) - (string-append "--key-file=" #$key) - (string-append "--pid-file=" #$pid-file) - (string-append "--log-file=" #$log-file)) - #:user "munge" - #:group "munge" - #:pid-file #$pid-file - #:log-file #$log-file)) - (stop #~(lambda _ - (not (and - (list #$(file-append package "/sbin/munged") - (string-append "--socket=" #$socket) - "--stop") - ;; This seems to not be removed by default. - (delete-file (string-append #$socket ".lock")))))) - (auto-start? #t)))))) - -(define munge-service-type - (service-type - (name 'munge) - (extensions - (list - (service-extension shepherd-root-service-type - munge-shepherd-service) - (service-extension activation-service-type - munge-activation) - (service-extension account-service-type - (const %munge-accounts)) - (service-extension profile-service-type - (compose list munge-configuration-package)))) - (default-value (munge-configuration)) - (description - "Run @url{https://dun.github.io/munge/,Munge}, an authentication service."))) - -;; Initial documentation for upstreaming: -;@subsubheading Munge -; -;The following example describes a Munge service with the default configuration. -; -;@lisp -;(service munge-service-type) -;@end lisp -; -;@deftp {Data Type} munge-configuration -;Data type representing the configuration for the @code{munge-service-type}. -; -;@table @asis -;@item @code{package} -;Munge package to use for the service. -; -;@item @code{socket} (default "/var/run/munge/munge.socket.2") -;The socket Munge should use. -; -;@item @code{pid-file} (default "/var/run/munge/munged.pid") -;The PID file which Munge should use. -; -;@item @code{log-file} (default "/var/log/munge/munged.log") -;The location of the log file Munge should write to. -; -;@item @code{key} (default "/etc/munge/munge.key") -;The location of the shared key Munge should use. Since this a shared secret key between the different nodes it should not be added to the store. -; -;@end table -;@end deftp - - -;; TODO: Make id/uid configurable -(define %slurm-accounts - (list (user-group - (name "slurm") - (id 901) - (system? #t)) - (user-account - (name "slurm") - (group "slurm") - (uid 901) - (system? #t) - (comment "Slurm User") - (home-directory "/var/lib/slurm")))) - -(define-record-type* <slurm-configuration> - slurm-configuration - make-slurm-configuration - slurm-configuration? - ;; As I understand it, all the services depend on also running slurmd on - ;; that machine. Therefore it makes sense to have one config section with - ;; "common" and "extended" options. With all the possible options and - ;; versions we only cover the ones which affect the services. - ;; We keep the capitalization used in the config files to make discovery easier. - (package slurm-configuration-package - (default slurm)) - (slurm-conf-file slurm-configuration-slurm-conf-file - (default "/etc/slurm/slurm.conf")) - (SlurmdLogFile slurm-configuration-slurmd-log-file - (default #f)) ; #f for syslog - (SlurmdPidFile slurm-configuration-slurmd-pidfile - (default "/var/run/slurmd.pid")) - - (SlurmdSpoolDir slurm-configuration-slurmd-spooldir - (default "/var/spool/slurmd")) - - (run-slurmctld? slurm-configuration-run-slurmctld - (default #f)) - (SlurmctldLogFile slurm-configuration-slurmctld-log-file - (default #f)) ; #f for syslog - (SlurmctldPidFile slurm-configuration-slurmctld-pidfile - (default "/var/run/slurmctld.pid")) - - (run-slurmdbd? slurm-configuration-run-slurmdbd - (default #f)) - (slurmdbd-conf-file slurm-configuration-slurmdbd-conf-file - (default "/etc/slurm/slurmdbd.conf")) - (slurmdbd-PidFile slurm-configuration-slurmdbd-pidfile - (default "/var/run/slurmdbd.pid")) - - (ClusterName slurm-configuration-clustername - (default #f)) ; string - (SlurmUser slurm-configuration-slurmuser - (default #f)) ; string - (SlurmctldHost slurm-configuration-slurmctldhost - (default #f)) ; list of strings - (slurm-extra-content slurm-configuration-slurm-extra-content - (default "")) - (cgroup-extra-content slurm-configuration-cgroup-extra-content - (default "")) - (DbdHost slurm-configuration-dbdhost - (default #f)) ; string - (StorageType slurm-configuration-storagetype - (default #f)) ; string - (slurmdbd-extra-content slurm-configuration-slurmdbd-extra-content - (default ""))) - - -(define (%slurm.conf config) - "Return a slurm.conf configuration file corresponding to CONFIG." - (computed-file - "slurm_conf" - #~(begin - (use-modules (srfi srfi-26)) - (call-with-output-file #$output - (lambda (port) - (display "# Generated by 'slurm-service'.\n" port) - (format port "ClusterName=~a\n" - #$(slurm-configuration-clustername config)) - (for-each - (cut format port "SlurmCtldHost=~a\n" <>) - '#$(slurm-configuration-slurmctldhost config)) - (format port "SlurmdSpoolDir=~a\n" - #$(slurm-configuration-slurmd-spooldir config)) - (format port "SlurmdPidFile=~a\n" - #$(slurm-configuration-slurmd-pidfile config)) - (when #$(slurm-configuration-slurmd-log-file config) - (format port "SlurmdLogFile=~a\n" - #$(slurm-configuration-slurmd-log-file config))) - (format port "SlurmctldPidFile=~a\n" - #$(slurm-configuration-slurmctld-pidfile config)) - (when #$(slurm-configuration-slurmctld-log-file config) - (format port "SlurmctldLogFile=~a\n" - #$(slurm-configuration-slurmctld-log-file config))) - (format port "SlurmUser=~a\n" - #$(slurm-configuration-slurmuser config)) - (format port "\n# Extra content here:\n~a\n" - #$(slurm-configuration-slurm-extra-content config)) - #t))))) - -(define (%cgroup.conf config) - "Return a cgroup.conf configuration file corresponding to CONFIG." - (computed-file - "cgroup_conf" - #~(begin - (call-with-output-file #$output - (lambda (port) - (display "# Generated by 'slurm-service'.\n" port) - (format port "~a\n" - #$(slurm-configuration-cgroup-extra-content config))))))) - -(define (%slurmdbd.conf config) - "Return a slurm.conf configuration file corresponding to CONFIG." - (computed-file - "slurmdbd_conf" - #~(begin - (call-with-output-file #$output - (lambda (port) - (display "# Generated by 'slurm-service'.\n" port) - (format port "DbdHost=~a\n" - #$(slurm-configuration-dbdhost config)) - (format port "StorageType=~a\n" - #$(slurm-configuration-storagetype config)) - (format port "SlurmUser=~a\n" - #$(slurm-configuration-slurmuser config)) - (format port "PidFile=~a\n" - #$(slurm-configuration-slurmdbd-pidfile config)) - (format port "\n# Extra content here:\n~a\n" - #$(slurm-configuration-slurmdbd-extra-content config)) - #t))))) - -(define (slurm-activation config) - "Return the activation GEXP for CONFIG for the slurm service." - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (let* ((%user (getpw "slurm")) - (spooldir #$(slurm-configuration-slurmd-spooldir config)) - (logdir (dirname (or #$(slurm-configuration-slurmd-log-file config) - #$(slurm-configuration-slurmctld-log-file config) - "/var/log/slurmd.log"))) - (piddir (dirname #$(slurm-configuration-slurmd-pidfile config)))) - (unless (file-exists? spooldir) - (mkdir-p spooldir)) - (chown spooldir (passwd:uid %user) (passwd:gid %user)) - (when logdir - (unless (file-exists? logdir) - (mkdir-p logdir)) - (when (> (string-length logdir) (string-length "/var/log")) - (chown logdir (passwd:uid %user) (passwd:gid %user)))) - (unless (file-exists? piddir) - (mkdir-p piddir))) - ;; /etc/slurm/slurm.conf needs to exist. - (file-exists? #$(slurm-configuration-slurm-conf-file config)) - ;; slurmdbd activation - (when #$(slurm-configuration-run-slurmdbd config) - (file-exists? - #$(slurm-configuration-slurmdbd-conf-file config)))))) - -(define slurmd-shepherd-service - (match-lambda - (($ <slurm-configuration> package slurm-conf-file _ slurmd-pidfile) - (list - (shepherd-service - (documentation "Slurmd server") - (provision '(slurmd)) - (requirement '(loopback munge)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/slurmd") - "-f" #$slurm-conf-file) - #:pid-file #$slurmd-pidfile)) - (stop #~(make-kill-destructor))))))) - -(define slurmctld-shepherd-service - (match-lambda - (($ <slurm-configuration> package slurm-conf-file _ _ _ run-slurmctld? _ slurmctld-pidfile) - (list - (shepherd-service - (documentation "Slurmctld server") - (provision '(slurmctld)) - (requirement '(loopback munge)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/slurmctld") - "-f" #$slurm-conf-file) - #:pid-file #$slurmctld-pidfile)) - (stop #~(make-kill-destructor)) - (auto-start? run-slurmctld?)))))) - -(define slurmdbd-shepherd-service - (match-lambda - (($ <slurm-configuration> package _ _ _ _ _ _ _ run-slurmdbd? _ slurmdbd-pidfile) - (list - (shepherd-service - (documentation "Slurmdbd server") - (provision '(slurmdbd)) - (requirement '(loopback munge)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/sbin/slurmdbd")) - #:pid-file #$slurmdbd-pidfile)) - (stop #~(make-kill-destructor)) - (auto-start? run-slurmdbd?)))))) - -(define (slurm-services-to-run config) - (append (slurmd-shepherd-service config) - (if (slurm-configuration-run-slurmctld config) - (slurmctld-shepherd-service config) - '()) - (if (slurm-configuration-run-slurmdbd config) - (slurmdbd-shepherd-service config) - '()))) - -(define (slurm-etc-service config) - (append - `(("slurm/slurm.conf" ,(%slurm.conf config)) - ("slurm/cgroup.conf" ,(%cgroup.conf config))) - (if (slurm-configuration-run-slurmdbd config) - `(("slurm/slurmdbd.conf" ,(%slurmdbd.conf config))) - '()))) - -(define slurm-service-type - (service-type - (name 'slurm) - (extensions - (list - (service-extension shepherd-root-service-type - slurm-services-to-run) - (service-extension activation-service-type - slurm-activation) - (service-extension etc-service-type - slurm-etc-service) - (service-extension account-service-type - (const %slurm-accounts)) - (service-extension profile-service-type - (compose list slurm-configuration-package)))) - (default-value (slurm-configuration)) - (description - "Run @url{https://slurm.schedmd.com/slurm.html,Slurm}, a workflow manager -service. Optionally also run @code{slurmctld} and @code{slurmdbd}."))) diff --git a/gn/services/singlecell-container.scm b/gn/services/singlecell-container.scm deleted file mode 100644 index 8190926..0000000 --- a/gn/services/singlecell-container.scm +++ /dev/null @@ -1,27 +0,0 @@ -;; Not ready for deployment yet -;; Warning: Error in <Anonymous>: error in evaluating the argument 'object' in selecting a method for function 'summary': - -(define-module (gn services singlecell-container)) - -(use-modules (gnu) - (gn packages bioinformatics) - (gn services rshiny)) - -(operating-system - (host-name "singlecell") - (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 only need a few packages inside the container. - (packages '()) - - (services (list (service rshiny-service-type - (rshiny-configuration - (package singlecellrshiny) - (binary "singlecellrshiny")))))) |
