Skip to content

Commit f10b396

Browse files
committed
add docker tutorial
1 parent 509e4ec commit f10b396

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

tutorials/tutorials.030.docker.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
# Running ORE Under Docker
3+
4+
The ORE project includes support for Docker. You can build a docker container
5+
including ORE binaries and tests.
6+
7+
## Docker scripts
8+
9+
Below are the scripts which the ORE project includes in support of Docker:
10+
11+
```
12+
├───Docker/.env set environment variables
13+
14+
└───Docker/DockerfileRunORE.sh build all docker containers
15+
16+
├───Docker/docker-compose-ore.yml compose file for container env_ore
17+
│ │
18+
│ └────Docker/Dockerfile-ORE docker file for container env_ore
19+
20+
├───Docker/docker-compose-test.yml compose file for container env_ore_test
21+
│ │
22+
│ └───Docker/Dockerfile-Test docker file for container env_ore_test
23+
24+
└───Docker/docker-compose-ore-app.yml compose file for container ore_app
25+
26+
└───Docker/Dockerfile-ORE-App docker file for container ore_app
27+
```
28+
`env_ore` is a preliminary container for the build environment. `env_ore_test`
29+
is a preliminary container for the testing tools. The minimum essentials from
30+
these two containers are extracted into container `ore_app`, which is the final
31+
product supporting a working ORE environment.
32+
33+
## Building the Docker Container
34+
35+
If you are on a POSIX system (e.g. linux or MacOS), you can run:
36+
37+
Docker/DockerfileRunORE.sh
38+
39+
On Windows, you can replicate the behavior of the above script by running the
40+
following commands at a DOS prompt:
41+
42+
SET COMPOSE_DOCKER_CLI_BUILD=1
43+
SET DOCKER_BUILDKIT=1
44+
docker-compose --env-file Docker/.env -f Docker/docker-compose-ore.yml build
45+
docker-compose --env-file Docker/.env -f Docker/docker-compose-test.yml build
46+
docker-compose --env-file Docker/.env -f Docker/docker-compose-ore-app.yml build
47+
48+
This creates the docker images:
49+
50+
$ docker images
51+
REPOSITORY TAG IMAGE ID CREATED SIZE
52+
ore_app latest 1861c2dba528 7 seconds ago 2.02GB
53+
env_ore latest 9e016430d0dd 15 minutes ago 3.42GB
54+
env_ore_test latest 55b8da9c2c8a 2 months ago 1.15GB
55+
56+
## Run the Docker Container Interactively
57+
58+
Invoke the command below to run the docker container interactively:
59+
60+
docker run -it ore_app bash
61+
62+
Here are the commands to run the examples:
63+
64+
cd /ore/Examples
65+
python3 run_examples_testsuite.py --with-xunitmp --xunitmp-file=examples.xml --processes=8 --process-timeout=3600
66+
67+
Here are the commands to run all of the unit tests in parallel:
68+
69+
cd /ore
70+
PARAMS="--log_format=XML --log_level=test_suite --report_level=no --result_code=no"
71+
/ore/App/quantlib-test-suite --nProc=4 $PARAMS --log_sink=xunit_ql.xml &
72+
/ore/App/quantext-test-suite --nProc=6 $PARAMS --log_sink=xunit_qle.xml &
73+
/ore/App/ored-test-suite $PARAMS --log_sink=xunit_ored.xml -- --base_data_path=/ore/OREData/test &
74+
/ore/App/orea-test-suite --nProc=4 $PARAMS --log_sink=xunit_orea.xml -- --base_data_path=/ore/OREAnalytics/test &
75+
wait
76+

0 commit comments

Comments
 (0)