Skip to content

Commit 5badef2

Browse files
committed
Update deployment instructions
1 parent 59f9794 commit 5badef2

File tree

1 file changed

+52
-27
lines changed

1 file changed

+52
-27
lines changed

README.md

Lines changed: 52 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,33 @@
33

44
A tool for visualizing and exploring multimodal features extracted from video.
55

6-
# Production
6+
## Deployment
77

8-
The application consists of two major components: the visualization tool (emo-spectre + database) and the data processing pipeline (erd-etl + cwltool + xenonflow). The global architecture is outlined in this image:
8+
The application consists of two major components: the visualization tool (emo-spectre + api + database) and the data processing pipeline (erd-etl + cwltool + xenonflow). The global architecture is outlined in this image:
99

1010
![](static/images/erd_deployment.png)
11+
TODO: update figure as xenonflow and cwltool are now running in a docker container and don't require local installation.
1112

12-
## Prerequisites
13+
For production, the application can be launched as a set of Docker containers. For development, see below.
1314

14-
* Docker + docker-compose
15-
* Java 11 (for xenon-flow)
16-
* Python 3 + cwltool (for data processing)
15+
Clone these repositories:
16+
* emo-spectre: https://github.com/emrecdem/emo-spectre
17+
* erd-etl: https://github.com/emrecdem/erd-etl
18+
* xenon-flow: https://github.com/emrecdem/xenon-flow and switch to the erd-changes branch.
1719

18-
## Deploy visualization tool
20+
### Configure emo-spectre
1921

20-
Clone the [emo-spectre](https://github.com/emrecdem/emo-spectre) repository and configure the variables in the .env file:
22+
Change the api keys and passwords from their default, and make sure that they are matching between configuration files.
23+
24+
Edit the .env file:
2125

2226
```
2327
XENON_API_KEY=in1uP28Y1Et9YGp95VLYzhm5Jgd5M1r0CKI7326RHwbVcHGa
2428
XENONFLOW_HOME=/home/peter/xenonflow
2529
26-
WEBAPP_PORT=9595
30+
DOCKER_NETWORK=emo-spectre_default
31+
32+
WEBAPP_PORT=3000
2733
WEBAPP_HOST=localhost
2834
WEBAPP_PROTOCOL=http
2935
@@ -32,48 +38,67 @@ PRODUCTION_POSTGRES_PASSWORD=postgrespassword
3238
PRODUCTION_HASURA_GRAPHQL_ADMIN_SECRET=adminpassword
3339
3440
ERD_ETL_PATH=/Users/peter/repos/esc/emrecdem/erd-etl
41+
42+
NODE_ENV=production
3543
```
3644

37-
`ERD_ETL_PATH` is the directory where the files for processing are stored. They are uploaded to `$ERD_ETL_PATH/upload`.
45+
`ERD_ETL_PATH` points to the erd-etl repository, which is also used as the directory where the files for processing are stored. The upload server, xenonflow and cwltool will create/use some directories under `$ERD_ETL_PATH` for temporary storage, namely `upload`, `running-jobs`, `output` and `tmp`.
3846

39-
**Start the docker containers**
47+
### Configure and build erd-etl
48+
49+
In erd-etl/merge_features.cwl, the database connection needs to be configured:
4050

4151
```
42-
docker-compose -f docker-compose.yml -f docker-compose-production.yml up -d
52+
DB_CONNECTION: postgresql://postgres:<pwd>@<ip address of database container>:5432/postgres
4353
```
4454

45-
**Initialize the database**
55+
**Build erd-etl**
56+
57+
This and below image are referred to by the CWL scripts that execute the data processing steps. They will be run by the Xenonflow container (as siblings).
4658
```
47-
docker exec -i erd-postgres psql --username postgres postgres < ./sql/seed.sql
59+
cd scripts
60+
docker build -t erd-etl .
61+
cd ..
62+
docker save erd-etl > erd-etl.tar
4863
```
49-
Note that the metadata for the Hasura container is auto-applied from ./hasura/metadata through the [cli-migrations Hasura image](https://hasura.io/docs/latest/graphql/core/migrations/config-v2/advanced/auto-apply-migrations.html#auto-apply-migrations-v2).
50-
## Deploy the dataprocessing pipeline
5164

52-
Clone the [erd-etl](https://github.com/emrecdem/erd-etl) repository.
65+
**Build erd-praat**
66+
```
67+
cd praat
68+
docker build -t erd-praat
69+
cd ..
70+
docker save erd-praat > erd-praat.tar
71+
```
5372

54-
**Install xenon-flow**
73+
### Configure and build xenon-flow
5574

56-
First install java and make sure `JAVA_HOME` is set. Then download and unpack the xenon-flow installation:
75+
In xenon-flow/config/application.properties, edit the following:
76+
* `xenonflow.http.auth-token` (should match XENON_API_KEY in emo-spectre/.env)
77+
* `spring.datasource.password`
78+
* `server.ssl.key-store-password`
5779

80+
Build xenon-flow:
5881
```
59-
wget https://github.com/xenon-middleware/xenon-flow/releases/download/1.0-rc1/xenonflow-v1.0-rc1.tar
60-
mkdir xenonflow
61-
tar -xf xenonflow-v1.0-rc1.tar -C xenonflow
82+
docker build -t xenonflow .
6283
```
6384

64-
**Install cwltool**
85+
## Start the docker containers
86+
87+
The command below executes two docker-compose files, one that launches Postgres and Hasura, the other launches Xenonflow, a simple upload server and the actual web application.
88+
6589
```
66-
pip3 install cwltool
90+
docker-compose -f docker-compose.yml -f docker-compose-production.yml up -d
6791
```
6892

69-
**Run xenon-flow**
93+
**Initialize the database**
7094
```
71-
./bin/xenonflow
95+
docker exec -i erd-postgres psql --username postgres postgres < ./sql/seed.sql
7296
```
97+
Note that the metadata for the Hasura container is auto-applied from ./hasura/metadata through the [cli-migrations Hasura image](https://hasura.io/docs/latest/graphql/core/migrations/config-v2/advanced/auto-apply-migrations.html#auto-apply-migrations-v2).
7398

7499
# Development
75100

76-
Requirements locally: `docker` and `Yarn`.
101+
Requirements locally: `docker` and `yarn`.
77102

78103
## First time setup
79104
```bash

0 commit comments

Comments
 (0)