Skip to content

mrc-ide/wodin-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WODIN demo

Automatic deployment on wodin-dev or epimodels

First configure the proxy, this only needs doing once:

./wodin-deploy configure-proxy dev # or epimodels
./wodin-deploy pull # if needed, pull containers
./wodin-deploy down # if needed, stop existing deployment
./wodin-deploy up   # bring up the app

Deployment for testing, without the proxy

./wodin-deploy configure-proxy none
./wodin-deploy up

Deploying a different branch

Set the API_BRANCH and APP_BRANCH environment variables to the names of the branch (or git hash) to deploy

API_BRANCH=mrc-1234 APP_BRANCH=mrc-1237 ./wodin-deploy up

Manual deployment

Spin up the odin.api server on a docker private network, then bring up wodin pointing at our configuration directory

docker network create wodin-nw
docker run -d --pull=always --name odin.api --rm \
    --network=wodin-nw \
    mrcide/odin.api:main
docker run -d --name redis --rm --network=wodin-nw redis:6
docker run -d --pull=always --name wodin --rm \
    -p 3000:3000 --network=wodin-nw \
    -v $PWD/config:/config:ro \
    mrcide/wodin:main /config

The demo app will be available at http://localhost:3000

You can replace branch names on both components as required, but they must be compatible with one another (in terms of the code generated by odin.api and expected by wodin - main/main will always work, other combinations are possible).

In a production setting we would not expose port 3000 at all, but add a proxy to this network and expose everything over https.

On metal

We can also run wodin on metal, without a docker container, with a few tweaks.

Bring up odin.api much as before, but this time we expose odin.api port to the host

docker run -d --name odin.api --rm \
    -p 8001:8001 \
    mrcide/odin.api:main

You'll also need a copy of redis, also exposed to the host:

docker run -d --name redis --rm -p 6379:6379 redis:6

Edit the config/wodin.config.json to change the url of the odinAPI key to be http://127.0.0.1:8001, and the redisURL key to be redis://127.0.0.1:6379

{
    "courseTitle": "WODIN Example",
    "port": 3000,
    "appsPath": "apps",
    "odinAPI": "http://127.0.0.1:8001",
    "redisURL": "redis://127.0.0.1:6379"
}

Then run

npm install
run run serve

The demo app will be available at http://localhost:3000

This requires that the npm package has been updated recently (not currently part of our workflows).

Update local copy of configuration

Run

./update-config

to refresh the configuration in /config with that from the app, but with a sparkly new custom css and logo.