diff options
author | Arun Isaac | 2022-09-06 21:48:14 +0530 |
---|---|---|
committer | Arun Isaac | 2022-09-08 23:03:20 +0530 |
commit | 45b672649e7282beb9c4cca9765c6b06cb83cd9c (patch) | |
tree | 4a9d01fdc8df19de186e2256bee1803b4f80272b | |
parent | 3661ab069ce317321a3048e42f089f3f3dc98c08 (diff) | |
download | gn-machines-45b672649e7282beb9c4cca9765c6b06cb83cd9c.tar.gz |
Expose continuously deployed genenetwork at cd.genenetwork.org.
* genenetwork-development.scm (%genenetwork2-port): New variable.
(genenetwork2-project): Use %genenetwork2-port.
(development-server-reverse-proxy-server-block): New function.
(operating-system)[services]: Use %genenetwork2-port. Add reverse
proxy block for cd.genenetwork.org.
-rw-r--r-- | genenetwork-development.scm | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/genenetwork-development.scm b/genenetwork-development.scm index a91ebfa..3e59160 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") +;; Port on which genenetwork2 is listening +(define %genenetwork2-port + 9092) + ;; Port on which genenetwork3 is listening (define %genenetwork3-port 9093) @@ -250,7 +254,7 @@ to be executed." this-forge-project (list "sh" "bin/genenetwork2" "./etc/default_settings.py" "-c" "../test/requests/test-website.py" - "--all" "http://localhost:9092"))) + "--all" (string-append "http://localhost:" (number->string %genenetwork2-port))))) (trigger? #f)))) (ci-jobs-trigger 'webhook))) @@ -727,6 +731,29 @@ should be included in the channels.scm file." (string-append %profile-directory "/current-guix"))))) port)))))) +(define (development-server-reverse-proxy-server-block listen gn2-port gn3-port) + "Return an <nginx-server-configuration> object listening on LISTEN to +reverse proxy the GeneNetwork development server. GN2-PORT and +GN3-PORT are the ports GeneNetwork2 and GeneNetwork3 are listening +on." + (nginx-server-configuration + (server-name '("cd.genenetwork.org")) + (listen (list listen)) + (locations + (list (nginx-location-configuration + ;; Reverse proxy genenetwork2. + (uri "/") + (body (list (string-append "proxy_pass http://localhost:" + (number->string gn2-port) ";") + "proxy_set_header Host $host;"))) + (nginx-location-configuration + ;; Reverse proxy genenetwork3. + (uri "/api3") + (body (list "rewrite /api3/(.*) /api/$1 break;" + (string-append "proxy_pass http://localhost:" + (number->string gn3-port) ";") + "proxy_set_header Host $host;"))))))) + ;; Port on which webhook is listening (define %webhook-port 9091) @@ -821,7 +848,7 @@ reverse proxy tissue." (service genenetwork2-service-type (development-server-configuration (inherit %default-genenetwork2-configuration) - (port 9092))) + (port %genenetwork2-port))) (service genenetwork3-service-type (development-server-configuration (inherit %default-genenetwork3-configuration) @@ -848,7 +875,9 @@ reverse proxy tissue." (service nginx-service-type (nginx-configuration (server-blocks - (list (laminar-reverse-proxy-server-block + (list (development-server-reverse-proxy-server-block + "9090" %genenetwork2-port %genenetwork3-port) + (laminar-reverse-proxy-server-block "9090" "localhost:9089" %webhook-port (list 'gn-bioinformatics)) (tissue-reverse-proxy-server-block "9090"))))) |