|
| 1 | +[](https://github.com/jlab/bellmanscafe/actions/workflows/codestyle.yml) [](https://coveralls.io/github/jlab/bellmanscafe?branch=main) |
| 2 | + |
1 | 3 | # Bellman's Cafe |
2 | 4 |
|
3 | 5 | Interactive web-pages to explore Algebraic Dynamic Programming with live examples. Online version at [bellmanscafe.jlab.bio](http://bellmanscafe.jlab.bio) |
4 | 6 |
|
5 | 7 | # Install |
6 | 8 |
|
7 | 9 | 1. I suggest you follow the instructions of the Dockerfile to see what dependencies need to be installed. In summary (but this list might be incomplete), you need |
8 | | - - gapc (to compile ADP) |
9 | | - - time (for benchmarking) |
10 | | - - graphviz, texlive-latex-extra ghostscript (for grammar- and candidate tree drawings) |
11 | | - - gunicorn flask markdown (for the server) |
| 10 | + - gapc (to compile ADP) |
| 11 | + - time (for benchmarking) |
| 12 | + - graphviz, texlive-latex-extra ghostscript (for grammar- and candidate tree drawings) |
| 13 | + - gunicorn flask markdown (for the server) |
12 | 14 | 2. Once all dependencies have been installed, get some ADP example code, e.g. clone https://github.com/jlab/ADP_collection.git |
13 | 15 | 3. Adapt the configuration file. Start from `instance/example_secret_config.py` and create a copy `instance/config.py` and change variables to your needs, especially |
14 | | - - `bind`: try `'0.0.0.0:8000'` |
15 | | - - `workers`: try `1` (1 is nice for debugging as you avoid concurrency, otherwise use higher numbers) |
16 | | - - `accesslog` & `errorlog`: adapt the `DIR_LOGS` infix to an actually existing path |
17 | | - - `FP_CACHE`: also replace `DIR_CACHE` with an actual path |
18 | | - - `FP_GAPC_PROGRAMS`: should point to the ADP example code |
| 16 | + - `bind`: try `'0.0.0.0:8000'` |
| 17 | + - `workers`: try `1` (1 is nice for debugging as you avoid concurrency, otherwise use higher numbers) |
| 18 | + - `accesslog` & `errorlog`: adapt the `DIR_LOGS` infix to an actually existing path |
| 19 | + - `FP_CACHE`: also replace `DIR_CACHE` with an actual path |
| 20 | + - `FP_GAPC_PROGRAMS`: should point to the ADP example code |
19 | 21 | 4. start the server via `gunicorn -c instance/config.py Bellmansgap:app` |
| 22 | + |
| 23 | +# Host Server |
| 24 | + |
| 25 | +1. Hosting bellmanscafe should be easy as you "just" need to pull/build and than run the docker container. |
| 26 | + 1. **build**: sudo docker buildx build . -f Dockerfile -t bellmanscafe |
| 27 | + 2. **pull**: `docker pull janssenlab/bellmanscafe:latest` |
| 28 | +2. Once the image is available (through building or pulling), you can run it as an container via `sudo docker run -p 8000:8000 -it bellmanscafe` |
| 29 | + - note that you have to forward port 8000 from the container to your host. This port can be re-configured in the Dockerfile |
| 30 | + - to make debugging more easy, I suggest you mount two host directories to "/LOGS" and "/CACHE" directories, such that they become persistent even if you restart your container, e.g. by adding `-v /home/sjanssen/bellmanscafe/CACHE/:/CACHE/` and `-v /home/sjanssen/bellmanscafe/LOGS/:/LOGS/` to your `docker build` command. (You need to modify `/home/sjanssen/bellmanscafe` of course!) |
0 commit comments