Skip to content

Commit 6b75197

Browse files
author
andrewb147
committed
Added doc to run SemEHR in new NSH (SHSv2)
1 parent d5a33b8 commit 6b75197

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

doc/annotation_service_SMI.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Annotation Service installation in SMI
2+
3+
The database host is `smi-edris-db01` and the web service host is `smi-webs01`
4+
5+
# Database
6+
7+
The database host is configured using ansible
8+
https://git.ecdf.ed.ac.uk/SMI/deploy/-/blob/main/playbooks/postgres.yml
9+
10+
The service will need a database called `semehr`.
11+
12+
The roles (groups and logins) are specific to this host and are configured by ansible
13+
https://git.ecdf.ed.ac.uk/SMI/deploy/-/blob/main/inventories/nsh/host_vars/smi-edris-db01.nsh.loc/db_config.yml
14+
The admin role is `semehr` and the read-only role is `semehr-api` (note the dash).
15+
16+
The rest of the database configuration is done manually, see `postgres_init_01.sh`
17+
18+
The database is populated by editing the postgres password in `semehr_to_postgres.py`
19+
and running `semehr_zip_to_postgres.sh` with the zip files stored in `/mnt/beegfs/sr-nlp/annotations/complete_set_2`
20+
21+
# Web service
22+
23+
Create the container using the `docker/Dockerfile2`:
24+
```
25+
docker build -t howff/semehr:2 -f Dockerfile2 --build-arg GIT_DATE=$(date +%N) --progress=plain .
26+
```
27+
28+
Import the container to `smi-webs01` as the `agans-smi` user:
29+
```
30+
ces-pull USER USERKEY ghcr.io/howff/semehr:2
31+
podman images
32+
```
33+
34+
Create/edit the configuration file, containing the postgres password for the `semehr-api` user
35+
in this file `/localhome/agans-smi/src/smi/CogStack-SemEHR/docker/settings.json`
36+
37+
```
38+
{
39+
"mappings": [
40+
],
41+
"mappings_dir": "./mappings_dir",
42+
"transaction_dir": "./transactions",
43+
"training_dir": "./training",
44+
"passphrase": "^dr,rjt^",
45+
"webdata_path": "/Users/honghan.wu/Documents/working/SemEHR-Working/working_dermatology",
46+
"MRREL_path": "../umls/MRREL.csv",
47+
"MRCONSO_path": "../umls/MRCONSO.csv",
48+
"databaseBackend": "postgreSQL",
49+
"postgreSQL": {
50+
"host": "smi-edris-db01.nsh.loc",
51+
"port": 5432,
52+
"user": "semehr-api",
53+
"password": "***EDIT THIS***",
54+
"db": "semehr",
55+
"schema": "semehr",
56+
"ann_collection": "semehr_results",
57+
"text_collection": "text_collection",
58+
}
59+
}
60+
```
61+
62+
Test running the service:
63+
64+
```
65+
podman run --replace --rm -d --name smi-semehr \
66+
-p 8485:8485 \
67+
-v ~/src/smi/CogStack-SemEHR/docker/settings.json:/CogStack-SemEHR/RESTful_service/conf/settings.json \
68+
ghcr.io/howff/semehr:2
69+
```
70+
71+
Create the user-level systemd unit file `.config/systemd/user/container-smi-rgo.service`
72+
73+
```
74+
[Unit]
75+
Description=SMI Researcher Generated Outputs Service
76+
Documentation=man:podman-generate-systemd(1)
77+
Wants=network-online.target
78+
After=network-online.target
79+
RequiresMountsFor=%t/containers
80+
81+
[Service]
82+
Environment=PODMAN_SYSTEMD_UNIT=%n
83+
Restart=on-failure
84+
ExecStart=/usr/bin/podman run \
85+
--cidfile=%t/%n.ctr-id \
86+
--cgroups=no-conmon \
87+
--sdnotify=conmon \
88+
--pull=never \
89+
--replace \
90+
--rm \
91+
-d \
92+
-p 8485:8485 \
93+
--name smi-semehr \
94+
-v /localhome/agans-smi/src/smi/CogStack-SemEHR/docker/settings.json:/CogStack-SemEHR/RESTful_service/conf/settings.json \
95+
ghcr.io/howff/semehr:2
96+
ExecStop=/usr/bin/podman stop \
97+
--ignore \
98+
-t 10 \
99+
--cidfile=%t/%n.ctr-id
100+
ExecStopPost=/usr/bin/podman rm \
101+
-f \
102+
--ignore \
103+
--cidfile=%t/%n.ctr-id
104+
Type=notify
105+
NotifyAccess=all
106+
107+
[Install]
108+
WantedBy=default.target
109+
```

0 commit comments

Comments
 (0)