aboutsummaryrefslogtreecommitdiff
path: root/qa-gn.scm
blob: 5c2b2816c7a1db4c9bf63694457bf6575594de8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
;;; qa-gn.scm ---
;;; Copyright © 2024 Munyoki Kilyungi <me@bonfacemunyoki.com>
;;; Copyright © 2024 Alexander Kabui <alexanderkabua@gmail.com>
;;; Copyright © 2024 John Nduli <rookie101@jnduli.co.ke>
;;;
;;; This file is part of genenetwork-machines.
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License
;;; as published by the Free Software Foundation; either version 3
;;; of the License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.

(use-modules (gnu)
	     ((gnu packages admin) #:select (shepherd))
	     ((gnu packages certs) #:select (nss-certs))
	     (gnu services databases)
	     (gnu build linux-container)
	     (genenetwork services genenetwork)
	     (gn services databases)
	     (guix packages)
	     (guix download)
	     (guix git)
	     (guix git-download)
	     (guix build-system python)
	     ((gn packages genenetwork) #:select (genenetwork2 genenetwork3 gn-auth))
	     (forge acme)
	     (forge nginx)
	     (forge socket))



(operating-system
  (host-name "qa-gn")
  (timezone "UTC")
  (locale "en_US.utf8")
  (bootloader (bootloader-configuration
	       (bootloader grub-bootloader)
	       (targets (list "/dev/sdX"))))
  (file-systems %base-file-systems)
  (sudoers-file
   (mixed-text-file "sudoers"
		    "@include " %sudoers-specification
		    "\nacme ALL = NOPASSWD: "
		    (file-append shepherd "/bin/herd")
		    " restart nginx\n"))
  (packages (cons (specification->package "nss-certs") %base-packages))
  (services
   (cons*
    (service genenetwork-service-type
	     (genenetwork-configuration
	      ;; Use the latest stable version of GN2/3 with the most
	      ;; recent LLM code.
	      (genenetwork2 (package
			      (inherit genenetwork2)
			      (name "genenetwork2")
			      (version "0")
			      (source
			       (git-checkout
				(branch "feature/gnqa-system")
				(url "https://github.com/genenetwork/genenetwork2.git")))))
	      (genenetwork3 (package
			      (inherit genenetwork3)
			      (name "genenetwork3")
			      (version "0")
			      (source
			       (git-checkout
				(branch "feature/gnqa-api")
				(url "https://github.com/genenetwork/genenetwork3.git")))))
	      (gn-auth (package
			 (inherit gn-auth)
			 (source
			  (origin
			    (method git-fetch)
			    (uri (git-reference
				  (url "https://git.genenetwork.org/gn-auth")
				  (commit "de4a7f6bfa870a0e5fc4b1f381cb452ab1250210")))
			    (hash
			     (content-hash
			      (base32
			       "0dxanpgwgjil3g0qlkar7gg8znm9dpizcwkgbyvj0h44qnv1346k")))))
			 (propagated-inputs
			  (modify-inputs (package-propagated-inputs genenetwork3)
			    (append nss-certs)))
			 (arguments
			  `(#:tests? #f))))
	      (server-name "qa.genenetwork.org")
	      (gn-auth-server-name "qa-auth.genenetwork.org")
	      ;; XXX: We probably need to use the production server
	      ;; for this
	      (gn2-port 10904)
	      (gn3-port 10905)
	      (gn-auth-port 10906)
	      (sql-uri "mysql://webqtlout:webqtlout@127.0.0.1:3307/db_webqtl")
	      (auth-db "/export/data/genenetwork-sqlite/auth-qa.db")
	      (xapian-db "/export/data/genenetwork-xapian")
	      (genotype-files "/export/data/genenetwork/genotype_files")
	      (sparql-endpoint "http://localhost:9082/sparql")
	      (gn3-data-directory "/export/data/genenetwork3")
	      (llm-db "/export/data/genenetwork-sqlite/llm-qa.db")))
    (service forge-nginx-service-type
	     (forge-nginx-configuration
	      (http-listen (forge-ip-socket
			    (ip "0.0.0.0")
			    (port 10907)))
	      (https-listen (forge-ip-socket
			     (ip "0.0.0.0")
			     (port 10908)))))
    (service acme-service-type
             (acme-configuration
              (email "arunisaac@systemreboot.net")))
    %base-services)))