Skip to content

Commit 2f1a7b6

Browse files
authored
Merge pull request #1502 from LLNL/docs/han12/local_docker
Docs for local Axom Docker container
2 parents 4a86f1b + 90ce6e8 commit 2f1a7b6

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

src/docs/sphinx/dev_guide/continuous_integration.rst

+101
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,107 @@ Axom's GitHub project is also configured to require pull requests to pass checks
2929
from our LC GitLab CI (as described below).
3030

3131

32+
Build and Test Axom in a Docker Container
33+
-----------------------------------------
34+
35+
1. Install Docker Desktop
36+
37+
* You can look at `dockerdocs <https://docs.docker.com/>`_ for tutorials on installing and using Docker.
38+
39+
2. Ensure the Docker Desktop application is running on your computer
40+
3. Open Terminal/Powershell/Command Line prompt of choice
41+
4. Pull the Docker image
42+
43+
.. code-block:: bash
44+
45+
docker pull <image name>
46+
47+
* Checkout Azure Pipelines `configuration file <https://github.com/LLNL/axom/blob/develop/azure-pipelines.yml>`_ for latest images (denoted by ``<Compiler>_IMAGENAME``).
48+
49+
.. code-block:: bash
50+
51+
docker images
52+
53+
* Verify you can see your image
54+
55+
5. Create a Docker volume to save your work
56+
57+
.. code-block:: bash
58+
59+
docker volume create <volume name>
60+
61+
* This allows you to save your progress once you exit the container
62+
63+
.. code-block:: bash
64+
65+
docker volume ls
66+
67+
* Verify you can see your volume
68+
69+
6. Run the Docker container with the volume mounted
70+
71+
.. code-block:: bash
72+
73+
docker run -it --mount source=<volume name>,target=/home/axom --name <name you want to give container> <image id>
74+
75+
* You can get the ``<image id>`` through the ``docker images`` command.
76+
* This will mount/attach your volume to the Docker image. When you exit your running Docker container, you will want to rerun this command to restart the container with your current progress.
77+
78+
.. note::
79+
80+
If you exit the container and attempt to restart, sometimes Docker will return a warning stating the initial container has not fully closed. Just run ``docker container prune`` command to cleanup the container and then you can reissue the run command.
81+
82+
7. In the running Docker container, clone the axom github repository
83+
84+
.. code-block:: bash
85+
86+
git clone https://github.com/LLNL/axom.git
87+
cd axom
88+
89+
8. (optional) Checkout your branch
90+
91+
.. code-block:: bash
92+
93+
git checkout <name of your branch>
94+
95+
9. Setup submodules
96+
97+
.. code-block:: bash
98+
99+
git submodule update --init
100+
101+
10. Configure Axom
102+
103+
.. code-block:: bash
104+
105+
python3 ./config-build.py -hc host-configs/docker/<CMake host-config for container> -bt Release -DENABLE_GTEST_DEATH_TESTS=ON -DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -DENABLE_BENCHMARKS:BOOL=ON
106+
107+
* The host-config for your Docker container can be found in the ``host-configs/docker/`` directory.
108+
* The CMake flags (marked with ``-D``) are derived from a job in the Azure Pipelines `configuration file <https://github.com/LLNL/axom/blob/develop/azure-pipelines.yml>`_. The CMake flags are for mimicking a specific job setup, but are not required to configure Axom.
109+
110+
11. Build Axom
111+
112+
.. code-block:: bash
113+
114+
cd <build-* directory>
115+
make -j 8
116+
117+
12. Run unit tests
118+
119+
You have several potential options:
120+
121+
.. code-block:: bash
122+
123+
# Run tests with verbose output using make
124+
make VERBOSE=1 test
125+
126+
# Run tests with verbose output using ctest
127+
ctest -VV
128+
129+
# Run specific tests with verbose output using ctest, filtering for tests that have a specific prefix
130+
ctest -VV -R "<some_test_prefix>*"
131+
132+
32133
.. _gitlab-label:
33134

34135
==========

0 commit comments

Comments
 (0)