aboutsummaryrefslogtreecommitdiff
path: root/genenetwork-development.scm
diff options
context:
space:
mode:
authorArun Isaac2022-07-01 01:02:44 +0530
committerArun Isaac2022-07-01 01:39:45 +0530
commitf43e156273cbe8d9b14ae05afcf2a0179ed3e23e (patch)
treefda3656831516645954b940a2aee1a6bda906376 /genenetwork-development.scm
parent818022fa60dfe963ed0ef91c27232d56a32ac36b (diff)
downloadgn-machines-f43e156273cbe8d9b14ae05afcf2a0179ed3e23e.tar.gz
Switch to new tissue configuration file.
* genenetwork-development.scm (<tissue-configuration>)[address, port, indexed-repository]: Delete fields. [listen, hosts]: New fields. * genenetwork-development.scm (<tissue-host>): New type. (tissue-conf-gexp): New function. (tissue-shepherd-service): Remove --address and --port arguments. Compute and pass tissue.conf configuration file. Create file system mappings for all hosts. (operating-system)[services]: Use new tissue-configuration fields.
Diffstat (limited to 'genenetwork-development.scm')
-rw-r--r--genenetwork-development.scm50
1 files changed, 35 insertions, 15 deletions
diff --git a/genenetwork-development.scm b/genenetwork-development.scm
index a087f01..dbbdfed 100644
--- a/genenetwork-development.scm
+++ b/genenetwork-development.scm
@@ -690,11 +690,16 @@ command to be executed."
(define-record-type* <tissue-configuration>
tissue-configuration make-tissue-configuration
tissue-configuration?
- (address tissue-configuration-address
- (default "127.0.0.1"))
- (port tissue-configuration-port
- (default 8080))
- (indexed-repository tissue-configuration-indexed-repository))
+ (listen tissue-configuration-listen
+ (default "127.0.0.1:8080"))
+ (hosts tissue-configuration-hosts
+ (default '())))
+
+(define-record-type* <tissue-host>
+ tissue-host make-tissue-host
+ tissue-host?
+ (name tissue-host-name)
+ (indexed-repository tissue-host-indexed-repository))
(define %tissue-accounts
(list (user-account
@@ -708,6 +713,17 @@ command to be executed."
(name "tissue")
(system? #t))))
+(define (tissue-conf-gexp config)
+ #~(begin
+ (call-with-output-file #$output
+ (lambda (port)
+ (write '((listen . #$(tissue-configuration-listen config))
+ (hosts . #$(map (lambda (host)
+ `(,(tissue-host-name host)
+ (indexed-repository . ,(tissue-host-indexed-repository host))))
+ (tissue-configuration-hosts config))))
+ port)))))
+
(define (tissue-shepherd-service config)
(shepherd-service
(documentation "Run tissue web server.")
@@ -721,18 +737,19 @@ command to be executed."
#~(make-forkexec-constructor/container
(list #$(file-append tissue "/bin/tissue")
"run-web"
- #$(string-append "--address=" (tissue-configuration-address config))
- #$(string-append "--port=" (number->string (tissue-configuration-port config))))
+ #$(computed-file "tissue.conf" (tissue-conf-gexp config)))
#:user "tissue"
#:group "tissue"
- #:directory #$(tissue-configuration-indexed-repository config)
- #:mappings (list (file-system-mapping
- (source #$(tissue-configuration-indexed-repository config))
- (target source))
- (file-system-mapping
+ #:mappings (cons (file-system-mapping
(source "/var/log/tissue.log")
(target source)
- (writable? #t)))
+ (writable? #t))
+ (map (lambda (directory)
+ (file-system-mapping
+ (source directory)
+ (target source)))
+ '#$(map tissue-host-indexed-repository
+ (tissue-configuration-hosts config))))
#:log-file "/var/log/tissue.log")))
(stop #~(make-kill-destructor))))
@@ -914,8 +931,11 @@ list of channel names for which a channels.scm should be published."
#:directories? #t)))))
(service tissue-service-type
(tissue-configuration
- (port 9088)
- (indexed-repository "/srv/http/issues-index")))
+ (listen "127.0.0.1:9088")
+ (hosts
+ (list (tissue-host
+ (name "issues.genenetwork.org")
+ (indexed-repository "/srv/http/issues-index"))))))
(service nginx-service-type
(nginx-configuration
(server-blocks