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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
;;; genenetwork-machines --- Guix configuration for genenetwork machines
;;; Copyright © 2022–2024 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2024 Frederick Muriuki Muriithi <fredmanglis@protonmail.com>
;;;
;;; This file is part of genenetwork-machines.
;;;
;;; genenetwork-machines 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.
;;;
;;; genenetwork-machines 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 genenetwork-machines. If not, see
;;; <https://www.gnu.org/licenses/>.
;;; This is the *fallback* GeneNetwork container. It runs the same
;;; service stack as production.scm (virtuoso, forge-nginx, acme,
;;; redis, genenetwork, gn-uploader) with the same container-side
;;; paths, so the only differences are
;;;
;;; - the host name (genenetwork-fallback), and
;;; - an SSH service on port 2226 for debugging, using the pinned
;;; ~/ssh-container-key and ~/hello-container-key like the other
;;; containers in this repository.
;;;
;;; Build it with fallback-deploy.sh, which creates the host-side
;;; directories and passes the --share/--expose options that match the
;;; paths used below. Roughly:
;;;
;;; guix system container --network \
;;; -L ../guix-bioinformatics -L . -L guix -L ../contrib/guix-forge/guix \
;;; --share=/export2/guix-containers/genenetwork-fallback/var/genenetwork=/var/genenetwork \
;;; ... fallback.scm
;;;
;;; On hosts that run the run-guix-system-container daemon this can be
;;; started with run-guix-container.rb and inspected over ssh:
;;;
;;; run-guix-container.rb --daemon 127.0.0.1:8989 <HASH>
;;; ssh -p 2226 -i ~/hello-container-key root@127.0.0.1
;;;
;;; or, for boot problems, look at the daemon's log:
;;;
;;; run-guix-container.rb --daemon 127.0.0.1:8989 --log <HASH>
(use-modules (gnu)
(genenetwork packages)
(genenetwork services container-ssh)
(genenetwork services genenetwork)
((gnu packages admin) #:select (shepherd))
(gn services databases)
(gnu services databases)
(gnu services shepherd)
(forge acme)
(forge nginx)
(forge socket))
(operating-system
(host-name "genenetwork-fallback")
(timezone "UTC")
(locale "en_US.utf8")
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sdX"))))
(file-systems %base-file-systems)
(users %base-user-accounts)
(sudoers-file
(mixed-text-file "sudoers"
"@include " %sudoers-specification
"\nacme ALL = NOPASSWD: " (file-append shepherd "/bin/herd") " restart nginx\n"))
(packages %base-packages)
;; Run PID 1 with shepherd's self-pipe signal handling: inside the
;; run-guix-container daemon's sandbox (nested containers) the
;; signalfd-based process monitor never wakes up, so any service
;; whose start waits on a child (nginx -t, invoke, system*) hangs in
;; "starting". See shepherd-for-containers. On a real host this is
;; merely the pre-signalfd code path, so the container behaves the
;; same under systemd.
(essential-services
(modify-services (operating-system-default-essential-services
this-operating-system)
(shepherd-root-service-type config =>
(shepherd-configuration
(inherit config)
(shepherd shepherd-for-containers)))))
(services
(append
(list (service virtuoso-service-type
(virtuoso-configuration
(server-port 9892)
(http-server-port 9893)
(dirs-allowed (list "/export/data/virtuoso"))
(number-of-buffers 680000)
(maximum-dirty-buffers 500000)
(database-file "/var/lib/virtuoso/genenetwork-virtuoso.db")
(transaction-file "/var/lib/virtuoso/genenetwork-virtuoso.trx")))
(service forge-nginx-service-type
(forge-nginx-configuration
(http-listen (forge-ip-socket
(ip "0.0.0.0")
(port 9890)))
(https-listen (forge-ip-socket
(ip "0.0.0.0")
(port 9891)))))
(service acme-service-type
(acme-configuration
(email "arunisaac@systemreboot.net")))
(service redis-service-type
(redis-configuration
(bind "127.0.0.1")
(port 6379)
(working-directory "/var/lib/redis")))
(service genenetwork-service-type
(genenetwork-configuration
(server-name "genenetwork.org")
(gn-auth-server-name "auth.genenetwork.org")
(gn2-port 9894)
(gn3-port 9895)
(gn-auth-port 9896)
(sql-uri
"mysql://webqtlout:webqtlout@localhost/db_webqtl?unix_socket=/run/mysqld/mysqld.sock&charset=utf8")
(xapian-db "/var/lib/xapian")
(sparql-endpoint "http://localhost:9893/sparql")
(gn3-data-directory "/var/genenetwork/data/genenetwork3")
(gn2-secrets "/etc/genenetwork/genenetwork2")
(gn3-secrets "/etc/genenetwork/genenetwork3/gn3-secrets.py")
(gn-auth-secrets "/etc/genenetwork/gn-auth")
(auth-db "/var/lib/genenetwork/sqlite/gn-auth/auth.db")
(llm-db-path "/var/lib/genenetwork/sqlite/genenetwork3/llm.db")
(gn3-alias-server-port 9800)
(gn-tmpdir "/opt/gn/tmp")
(gn-doc-remote-uri "git@git.genenetwork.org:/home/git/public/gn-docs")
(gn-guile-working-dir "/var/lib/genenetwork/gn-guile/")
(gn-docs-working-branch "gn2-production-branch")
(gn-guile-ssh-identity-file "/opt/home/gn-guile/.ssh/id-ed25519-gn2-production-on-tux04")
(log-level 'info)))
(service gn-uploader-service-type
(gn-uploader-configuration
(server-name "uploader.genenetwork.org")
(port 9897)
(secrets "/etc/genenetwork/gn-uploader/gn-uploader-secrets.py")
(sql-uri
"mysql://webqtlout:webqtlout@localhost/db_webqtl?unix_socket=/run/mysqld/mysqld.sock&charset=utf8")
(data-directory "/var/lib/genenetwork/uploader/data")
(auth-server-url "https://auth.genenetwork.org/")
(gn2-server-url "https://genenetwork.org")
(sqlite-databases-directory "/var/lib/genenetwork/sqlite/gn-uploader")
(log-level 'info))))
;; Debugging access (skills/guix-containers: every container gets
;; ssh). Port 2226 is unused by the other containers in this
;; repository (2222 hello/bnw, 2223 genecup, 2224 cgit, 2225
;; julia-notebook and gn-guile-webserver).
(container-ssh-service #:port-number 2226)
%base-services)))
|