summaryrefslogtreecommitdiff
path: root/topics/systems/gn-services.gmi
blob: 4215f68ac78a2eeb69a09ff0c32c16d0c79504f2 (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
# GN Services

# Tags

* type: documentation
* status: in progress
* keywords: gn services, documentation

# Description

First make sure to have a stable guix checkout. E.g.

```
gn3@tux01:~/production/gn-proxy$ /home/wrk/opt/guix-pull/bin/guix pull -p ~/opt/guix-pull
```

In addition to gn1 and gn2 we have 3 running gn3 services:

## gn-proxy - deployed as gn3 user in production

gn-proxy runs in systemd. See

=> https://github.com/genenetwork/gn-proxy/blob/master/.guix-run
=> https://github.com/genenetwork/gn-proxy/blob/master/extra/guix-gn-proxy.service

Test with

```
curl localhost:8080/version
{"version":"0.2.1"}
```

To deploy by hand use

```
su gn3
alias guix=~/opt/guix/bin/guix
gn3@tux01:~/production/gn-proxy
source .guix-deploy
raco pkg install --auto
env TMPDIR=/home/gn3/tmp SQL_USER=*** SQL_PASSWORD=*** racket -L info server/rest.rkt
```


## gn3 aliases

=> https://github.com/genenetwork/gn3/blob/master/.guix-run
=> https://github.com/genenetwork/gn3/blob/master/etc/gn3-aliases.service

Test with

```
curl http://localhost:8000/gene/aliases/BRCA2
["FACD","FAD","FANCD","BROVCA2","FAD1","FANCD1","BRCC2","GLM3","PNCA2","XRCC11"]

curl http://localhost:8000/
[ "Hello GeneNetwork3!"  ]

curl https://luna.genenetwork.org/gn3/
[ "Hello GeneNetwork3!"  ]
```

## genenetwork3 (python3)

If the menu does not load, this is the culprit. It should be an external API link.


```
gn3@tux02:~/production/genenetwork3$ env GUIX_PACKAGE_PATH=~/guix-bioinformatics/ ~/opt/guix-gn3/bin/guix shell -C -D --network --expose=/home/gn2/production/genotype_files/ -f guix.scm -- gunicorn --bind 0.0.0.0:8087 --workers 8 --keep-alive 6000 --max-requests 10 --max-requests-jitter 5 --timeout 1200 wsgi:app
```

Test with

```
curl localhost:8087/api/version
"1.0"
curl localhost:8087/api/menu/generate/json
...
curl https://genenetwork.org/api3/api/version
"1.0"
curl https://genenetwork.org/api3/api/menu/generate/json
tomato
curl -L https://luna.genenetwork.org/api3/version
"1.0"
```

note the menu is more recent GN3.

On epysode:

```
http://mars.genenetwork.org/gn3/api/version
"1.0"
http://gn2-fallback.genenetwork.org/gn3/api/menu/generate/json
tomato
```

## Notes

We track services now on

=> https://rabbit.genenetwork.org/sheepdog/index.html

## System container

```
systemctl stop genenetwork-development-container
mv /var/guix-containers /export2
systemctl start genenetwork-development-container
```

The commit that changes the mounts is at

=> https://github.com/genenetwork/genenetwork-machines/commit/8ce668562b0443ed7eb5b22225692f6f4383ea89

## See also

=> orchestration.gmi