Skip to content

Commit fbe51f1

Browse files
committed
Merge pull request #1145 from UV-CDAT/docker
Adding Docker - Adding Dockerfiles for generating docker images
2 parents 46ffdce + a036acc commit fbe51f1

File tree

5 files changed

+111
-0
lines changed

5 files changed

+111
-0
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.git
2+
Packages/DV3D/demo
3+
Packages/visus/ext-libs
4+
Packa
5+
Packages/demo
6+
Packages/cmor/Test
7+
contrib/ZonalMeans/Test
8+
Packages/vcs_legacy
9+
Packages/WK/Test
10+
contrib/HDF5Tools/Examples
11+
Packages/cmor/Doc

CMake/dashboard/docker.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
set(CTEST_SOURCE_DIRECTORY /usr/src/uvcdat)
2+
set(CTEST_BINARY_DIRECTORY /tmp/uvcdat-build)
3+
4+
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
5+
set(CTEST_SITE "Docker Ubuntu:14.04")
6+
set(CTEST_BUILD_NAME "nogui-master")
7+
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
8+
9+
ctest_start("Experimental")
10+
ctest_configure(OPTIONS "-DCDAT_BUILD_WEB=ON;-DCDAT_BUILD_GUI=OFF;-DCDAT_BUILD_OSMESA=ON;-DCDAT_BUILD_OFFSCREEN=ON;-DCMAKE_INSTALL_PREFIX=/opt/uvcdat")
11+
ctest_build()
12+
ctest_test(PARALLEL_LEVEL 4 RETURN_VALUE res)
13+
ctest_coverage()
14+
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
15+
ctest_submit()
16+
17+
file(REMOVE "${CTEST_BINARY_DIRECTORY}/test_failed")
18+
if(NOT res EQUAL 0)
19+
file(WRITE "${CTEST_BINARY_DIRECTORY}/test_failed" "error")
20+
message(FATAL_ERROR "Test failures occurred.")
21+
endif()

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM uvcdat/ubuntu
2+
MAINTAINER UV-CDAT Developers <uvcdat-support@llnl.gov>
3+
4+
RUN mkdir -p /tmp/uvcdat-build
5+
ADD . /usr/src/uvcdat
6+
RUN cd /tmp/uvcdat-build && cmake -DCDAT_BUILD_WEB=ON -DCDAT_BUILD_GUI=OFF -DCDAT_BUILD_OSMESA=ON -DCDAT_BUILD_OFFSCREEN=ON -DCMAKE_INSTALL_PREFIX=/opt/uvcdat /usr/src/uvcdat && make && cd / && rm -fr /tmp/uvcdat-build
7+
8+
RUN useradd -d /data -m -U uvcdat
9+
10+
VOLUME /data
11+
WORKDIR /data
12+
USER uvcdat
13+
14+
ENV UVCDAT_SETUP_PATH /opt/uvcdat
15+
ENV PATH $UVCDAT_SETUP_PATH/bin:$UVCDAT_SETUP_PATH/Externals/bin:$PATH
16+
ENV PYTHONPATH $UVCDAT_SETUP_PATH/lib/python2.7/site-packages:$UVCDAT_SETUP_PATH/Externals/lib/python2.7/site-packages
17+
ENV LD_LIBRARY_PATH $UVCDAT_SETUP_PATH/lib:$UVCDAT_SETUP_PATH/Externals/lib
18+
ENV UVCDAT_ANONYMOUS_LOG no

docker/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
UV-CDAT Docker images
2+
=====================
3+
4+
Docker images of UV-CDAT are available at [docker hub](https://registry.hub.docker.com/u/uvcdat/uvcdat/). These
5+
images are built with offscreen rendering and no GUI support due to limitations in docker; however, it is possible
6+
to render images from UV-CDAT scripts or directly using the commandline interface. The primary motivation for
7+
the creation of these images is for easy deployment of visualization servers for CDATWeb, but users may find
8+
them useful for quick image generation or data exploration without needing to build and configure the UV-CDAT
9+
environment.
10+
11+
To try using the latest version of UV-CDAT, first [install](https://docs.docker.com/compose/install/) Docker
12+
for your platform. Note, Docker runs natively on Linux, but requires a lightweight virtual machine on Mac and
13+
Windows. The management of this virtual machine is handled through the `boot2docker` command. Typically,
14+
you will need to start up the virtual machine with `boot2docker start` and configure the environment with
15+
`$(boot2docker shellinit)`. See the docker installation guide for more information.
16+
17+
Running uvcdat once docker is set up is easy:
18+
```
19+
docker run -i -t uvcdat/uvcdat ipython
20+
```
21+
This will download the docker image, run it in a new container, and give an ipython shell inside the container.
22+
From here, you can import all python modules that are shipped with the CLI version of UV-CDAT.
23+
24+
Building the docker images
25+
--------------------------
26+
27+
The `Dockerfile` for building UV-CDAT is stored at the root level of this repository. It is built on top of
28+
a custom Ubuntu 14.04 install containing all necessary dependencies. Generally it will not be necessary to
29+
rebuild this base image, but if new packages are necessary from apt, they can be added to `docker/ubuntu/Dockerfile`
30+
and the image rebuilt with `docker build -t uvcdat/ubuntu`.
31+
32+
When updating master, a new `uvcdat/uvcdat:latest` should be generated and pushed to docker hub. The
33+
build should be initiated from a clean checkout of the repository to avoid adding unnecessary files to the
34+
image. From the top level of the repository, issue the following command to build the image.
35+
```
36+
docker build -t uvcdat/uvcdat .
37+
```
38+
Once it is built successfully you can test the image with ctest and upload the results to
39+
[CDash](https://open.cdash.org/index.php?project=UV-CDAT&display=project) with
40+
```
41+
docker run ctest -S /usr/src/uvcdat/CMake/dashboard/docker.cmake -VV
42+
```
43+
Finally, if you have push access to the docker hub account, you can push the image up to docker.
44+
```
45+
docker push uvcdat/uvcdat
46+
```
47+
48+
Note that UV-CDAT probably won't build with the standard VM setup by `boot2docker`. If you get build errors, you
49+
may need to increase the memory and disk size when initializing. For example, to create a VM with 4 GB of RAM and
50+
50 GB of disk space:
51+
```
52+
boot2docker --memory=4096 --disksize=50000
53+
```

docker/ubuntu/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:14.04
2+
MAINTAINER UV-CDAT Developers <uvcdat-support@llnl.gov>
3+
4+
RUN apt-get update && apt-get install -y git gfortran g++ libffi-dev libsqlite-dev libssl-dev libbz2-dev libexpat-dev ncurses-dev curl make wget libjpeg-dev libpng-dev
5+
6+
RUN curl http://www.cmake.org/files/v3.2/cmake-3.2.0-rc2-Linux-x86_64.tar.gz | tar -v -C /opt -zx
7+
8+
ENV PATH /opt/cmake-3.2.0-rc2-Linux-x86_64/bin:$PATH

0 commit comments

Comments
 (0)