diff --git a/Dockerfile b/Dockerfile index 5f8f34b08..8420a0fbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,75 @@ # Dockerfile for dvmdostem project. # -# Uses a multi-stage build. If you want to only create one of the -# intermediate stages, then run something like: +# This file contains specifications for images that are useful for the dvmdostem +# project. The images described in this file are: # -# $ docker build --target cpp-dev --tag cpp-dev:0.0.1 . +# * cpp-dev general purpose C, C++ compilers, libraries, etc +# * dvmdostem-dev libraries, tools for developing dvmdostem +# * dvmdostem-build a standalone compile environment for dvmdostem +# * dvmdostem-run a standalone run-time environemnt for dvmdostem # -# Note trailing '.' specifying build context as current directory! +# There is an additional image for the project, dvmdostem-mapping-support, which +# has its own Dockerfile. # -# If you simply docker build the entire file, or one of the -# later stages you will end up with several un-named, un-tagged -# images from the preceeding stages (i.e. : in the output -# docker image ls). For this reason, it might -# be nicer to build and tag each stage successively, +# The intention is that most (all?) development and testing work will be done in +# containers based on the -dev image. The -build and -run images are intended +# for deployment of dvmdostem on a cloud system or within another system, such +# as PEcAn. +# +# This Dockerfile uses a multi-stage build. If you want to only create one of +# the intermediate stages, then run something like: +# +# $ docker build --target cpp-dev --tag cpp-dev:$(git describe) . +# +# NOTE: trailing '.' specifying build context as current directory! +# +# If you simply docker build the entire file, or one of the later stages you +# will end up with several un-named, un-tagged images from the preceeding stages +# (i.e. : in the output from docker image ls). For this reason, it +# might be nicer to build and tag each stage successively. +# +# See docker-build-wrapper.sh for more info and ideas about building and and +# tagging images. # -# General dev tools compilers, etc +# This is used for tagging images. In most cases, this value will be overridden +# by passing a --build-arg when running docker build to create your images. See +# docker-build-wrapper.sh for examples of this pattern in use. +ARG GIT_VERSION=latest + +# === IMAGE FOR GENERAL C++ DEVELOPMENT ======================================= +# General development tools, compilers, text editors, etc FROM ubuntu:focal as cpp-dev ENV DEBIAN_FRONTEND=noninteractive -# Might combine these two using &&, somwewhere I read that is better -RUN apt-get update -# general tools and dependencies for development -RUN apt-get install -y build-essential git gdb gdbserver doxygen vim -# docker build --target cpp-dev --tag cpp-dev:0.0.1 . +RUN apt-get update -y --fix-missing && apt-get install -y \ + build-essential \ + doxygen \ + gdb \ + gdbserver \ + git \ + vim \ + && rm -rf /var/lib/apt/lists/* -# More specific build stuff for compiling dvmdostem and -# running python scripts -FROM cpp-dev:0.0.1 as dvmdostem-build +# === IMAGE FOR GENERAL DVMDOSTEM DEVELOPMENT ================================= +# More specific build stuff for compiling dvmdostem and running the project's +# associated python scripts. +FROM cpp-dev:$GIT_VERSION as dvmdostem-dev # dvmdostem dependencies -RUN apt-get install -y libjsoncpp-dev libnetcdf-dev libboost-all-dev libreadline-dev liblapacke liblapacke-dev +RUN apt-get update -y --fix-missing && apt-get install -y \ + libboost-all-dev \ + libjsoncpp-dev \ + liblapacke \ + liblapacke-dev \ + libnetcdf-dev \ + libreadline-dev \ + && rm -rf /var/lib/apt/lists/* # Various command line netcdf tools -RUN apt-get install -y nco netcdf-bin +RUN apt-get update -y --fix-missing && apt-get install -y \ + nco \ + netcdf-bin \ + && rm -rf /var/lib/apt/lists/* # Make a developer user so as not to always be root RUN useradd -ms /bin/bash develop @@ -40,11 +78,25 @@ USER develop # Pyenv dependencies for building full Python with all extensions. USER root -RUN apt-get update -RUN apt-get install -y --fix-missing build-essential libssl-dev zlib1g-dev libbz2-dev \ -libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ -xz-utils tk-dev libffi-dev liblzma-dev python-openssl git - +RUN apt-get update --fix-missing -y && apt-get install -y \ + build-essential \ + curl \ + git \ + libffi-dev \ + libssl-dev \ + libbz2-dev \ + liblzma-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + llvm \ + python-openssl \ + tk-dev \ + wget \ + xz-utils \ + zlib1g-dev \ + && rm -rf /var/lib/apt/lists/* # Bare bones python approach might be to use system provided python, which in # ubuntu focal (20.4) means python3 and pip3, or installing python-is-python3 @@ -57,7 +109,7 @@ xz-utils tk-dev libffi-dev liblzma-dev python-openssl git # but never got it to work. Decided to use a separate image with gdal support # but pyenv might be useful for other packages in the future and is a nice # unified way to package and version manage our tooling that has been working -# well across macOS, Ubunut, CentOS, etc. +# well across macOS, Ubuntu, CentOS, etc. USER develop ENV HOME=/home/develop RUN git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv @@ -69,29 +121,145 @@ RUN pyenv global 3.8.6 RUN pyenv rehash RUN python --version RUN pip install -U pip pipenv -RUN pip install matplotlib numpy pandas bokeh netCDF4 commentjson -RUN pip install ipython -RUN pip install jupyter -RUN pip install lhsmdu -COPY --chown=develop:develop special_configurations/jupyter_notebook_config.py /home/develop/.jupyter/jupyter_notebook_config.py +COPY requirements_general_dev.txt . +RUN pip install -r requirements_general_dev.txt -#RUN pip install gdal ## Doesn't work... -#RUN pip install GDAL ## Doesn't work... -# docker build --target dvmdostem-build --tag dvmdostem-build:0.0.1 . +COPY --chown=develop:develop special_configurations/jupyter_notebook_config.py /home/develop/.jupyter/jupyter_notebook_config.py -# The final image that we will run as a container. -FROM dvmdostem-build:0.0.1 as dvmdostem-run -WORKDIR /work ENV SITE_SPECIFIC_INCLUDES="-I/usr/include/jsoncpp" ENV SITE_SPECIFIC_LIBS="-I/usr/lib" ENV PATH="/work:$PATH" ENV PATH="/work/scripts:$PATH" -# docker build --target dvmdostem-run --tag dvmdostem-run:0.0.1 . +WORKDIR /work +# or use command +#ENTRYPOINT [ "tail", "-f", "/dev/null" ] + + +# === IMAGE FOR BUILDING (COMPILING) DVMDOSTEM ================================ +# A stand-alone container that can be used to compile the dvmdostem binary +# without needing to mount volumes when the container is started. Here the +# required source files are copied directly to the image. This is in constrast +# to the dev image, where there is no source code present in the imag instead it +# must be provided by mounting a volume at container run-time. +FROM dvmdostem-dev:${GIT_VERSION} as dvmdostem-build +COPY src/ /work/src +COPY Makefile /work/Makefile +COPY include/ /work/include + +# Needed for running git describe w/in the Makefile. Without the config setting +# git gives an error about trusted directories. Possible security concern? +# There is probably a better way to handle this situation. Maybe pass the git +# version to the Makefile as an argument? +COPY .git /work/.git +RUN git config --global --add safe.directory /work + +COPY scripts/ /work/scripts +COPY calibration/ /work/calibration +COPY parameters/ /work/parameters +COPY config/ /work/config +USER root + +# During development, it can be faster to test by copying in the binary rather +# than waiting for it to build each time +#COPY dvmdostem /work/dvmdostem +RUN make + +USER develop +# Use this to keep container going when doing docker compose up +# CMD ["tail -f /dev/null"] + -# A production ready container... -# At some point we could trim down and selectively copy out only the -# required shared libraries needed for running dvmdostem... -#FROM dvmdostem-run as dvmdostem-lean +# === IMAGE FOR RUNNING (NOT DEVELOPING) DVMDOSTEM ============================ +# This is designed to be a production image: lightweight in size, and with +# minimal tools. Only the dvmdostem binary and required shared libraries, and +# python install are installed on top of a bare ubuntu installation. No tools +# (git, make, etc) are included. No source code. Just the compiled dvmdostem +# application and supporting libriaries are included. +# +# Note that excluding python could significantly reduce the image size! +# +# A container run from this images will need to have data supplied (i.e. one or +# more mounted volumes) in order to run dvmdostem. +# +FROM ubuntu:focal as dvmdostem-run + +WORKDIR /work + +COPY --from=dvmdostem-build /work/dvmdostem ./ + +COPY --from=dvmdostem-build /work/scripts ./scripts +COPY --from=dvmdostem-build /work/calibration ./calibration +COPY --from=dvmdostem-build /work/parameters ./parameters +COPY --from=dvmdostem-build /work/config ./config + +# This seems to gets the whole python install, although I expect at some +# point when an extension is needed, will have to find that shared lib and +# copy it in... +# ~800MB +COPY --from=dvmdostem-build /home/develop/.pyenv /home/develop/.pyenv + +# Discovered by using ldd on compiled binary in testing environment +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 /lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 /lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 /lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libboost_log.so.1.71.0 /lib/x86_64-linux-gnu/libboost_log.so.1.71.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libjsoncpp.so.1 /lib/x86_64-linux-gnu/libjsoncpp.so.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/liblapacke.so.3 /lib/x86_64-linux-gnu/liblapacke.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libtmglib.so.3 /lib/x86_64-linux-gnu/libtmglib.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100 /lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libhdf5_serial.so.103 /lib/x86_64-linux-gnu/libhdf5_serial.so.103 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libcurl-gnutls.so.4 /lib/x86_64-linux-gnu/libcurl-gnutls.so.4 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libgfortran.so.5 /lib/x86_64-linux-gnu/libgfortran.so.5 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libnetcdf.so.15 /lib/x86_64-linux-gnu/libnetcdf.so.15 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libreadline.so.8 /lib/x86_64-linux-gnu/libreadline.so.8 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libblas.so.3 /lib/x86_64-linux-gnu/libblas.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/liblapack.so.3 /lib/x86_64-linux-gnu/liblapack.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libblas.so.3 /lib/x86_64-linux-gnu/libblas.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/liblapack.so.3 /lib/x86_64-linux-gnu/liblapack.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libsz.so.2 /lib/x86_64-linux-gnu/libsz.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libnghttp2.so.14 /lib/x86_64-linux-gnu/libnghttp2.so.14 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/librtmp.so.1 /lib/x86_64-linux-gnu/librtmp.so.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libssh.so.4 /lib/x86_64-linux-gnu/libssh.so.4 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libpsl.so.5 /lib/x86_64-linux-gnu/libpsl.so.5 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libldap_r-2.4.so.2 libldap_r-2./lib/x86_64-linux-gnu/4.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/liblber-2.4.so.2 liblber-2./lib/x86_64-linux-gnu/4.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libbrotlidec.so.1 /lib/x86_64-linux-gnu/libbrotlidec.so.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libquadmath.so.0 /lib/x86_64-linux-gnu/libquadmath.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libldap_r-2.4.so.2 /lib/x86_64-linux-gnu/libldap_r-2.4.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/liblber-2.4.so.2 /lib/x86_64-linux-gnu/liblber-2.4.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libaec.so.0 /lib/x86_64-linux-gnu/libaec.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libcrypto.so.1.1 /lib/x86_64-linux-gnu/libcrypto.so.1.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libkrb5.so.3 /lib/x86_64-linux-gnu/libkrb5.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libk5crypto.so.3 /lib/x86_64-linux-gnu/libk5crypto.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libkrb5support.so.0 /lib/x86_64-linux-gnu/libkrb5support.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libbrotlicommon.so.1 /lib/x86_64-linux-gnu/libbrotlicommon.so.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libsasl2.so.2 /lib/x86_64-linux-gnu/libsasl2.so.2 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libgssapi.so.3 /lib/x86_64-linux-gnu/libgssapi.so.3 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libkeyutils.so.1 /lib/x86_64-linux-gnu/libkeyutils.so.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libheimntlm.so.0 /lib/x86_64-linux-gnu/libheimntlm.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libkrb5.so.26 /lib/x86_64-linux-gnu/libkrb5.so.26 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libasn1.so.8 /lib/x86_64-linux-gnu/libasn1.so.8 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libhcrypto.so.4 /lib/x86_64-linux-gnu/libhcrypto.so.4 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libroken.so.18 /lib/x86_64-linux-gnu/libroken.so.18 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libwind.so.0 /lib/x86_64-linux-gnu/libwind.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libwind.so.0 /lib/x86_64-linux-gnu/libwind.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libheimbase.so.1 /lib/x86_64-linux-gnu/libheimbase.so.1 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libhx509.so.5 /lib/x86_64-linux-gnu/libhx509.so.5 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libsqlite3.so.0 /lib/x86_64-linux-gnu/libsqlite3.so.0 +COPY --from=dvmdostem-dev /lib/x86_64-linux-gnu/libheimbase.so.1 /lib/x86_64-linux-gnu/libheimbase.so.1 + +# Make a developer user so as not to always be root +RUN useradd -ms /bin/bash develop +RUN echo "develop ALL=(ALL:ALL) ALL" >> /etc/sudoers +USER develop +ENV HOME=/home/develop +ENV PYENV_ROOT=$HOME/.pyenv +ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH + +# Set a few environemnt variables for ease of use... +ENV PATH="/work:$PATH" +ENV PATH="/work/scripts:$PATH" diff --git a/Dockerfile-mapping-support b/Dockerfile-mapping-support index 911ffab1e..11caa4122 100644 --- a/Dockerfile-mapping-support +++ b/Dockerfile-mapping-support @@ -4,7 +4,7 @@ # GDAL and Python working well together. # need this for netCDF -FROM osgeo/gdal:ubuntu-full-latest +FROM osgeo/gdal:ubuntu-full-3.2.2 # Might want this if workflow includes running interactive shell on # the container resulting from this image... @@ -20,10 +20,25 @@ USER develop # Pyenv dependencies USER root -RUN apt-get update -RUN apt-get install -y --fix-missing build-essential libssl-dev zlib1g-dev libbz2-dev \ -libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ -xz-utils tk-dev libffi-dev liblzma-dev python-openssl git +RUN apt-get update --fix-missing && apt-get install -y \ + build-essential \ + curl \ + git \ + libbz2-dev \ + libffi-dev \ + liblzma-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + llvm \ + python-openssl \ + tk-dev \ + wget \ + xz-utils \ + zlib1g-dev \ + && rm -rf /var/lib/apt/lists/* # Pyenv seems to work well for overall python versioning and packagemanagement. # Not sure how to best manage pip requirements.txt yet between this mapping @@ -39,8 +54,8 @@ RUN pyenv global 3.8.6 RUN pyenv rehash RUN python --version RUN pip install -U pip pipenv -COPY requirements.txt . -RUN pip install -r requirements.txt +COPY requirements_mapping.txt . +RUN pip install -r requirements_mapping.txt # or use this if not wanting to use requirements.txt... # Bug with ipython 7.19.0, so need to downgrade and pin jedi verison @@ -50,7 +65,6 @@ RUN pip install -r requirements.txt #RUN pip install jedi==0.17.2 WORKDIR /work -# docker build --tag dvmdostem-mapping-support:0.0.1 -f Dockerfile-mapping-support . ## EXAMPLES diff --git a/docker-build-wrapper.sh b/docker-build-wrapper.sh new file mode 100755 index 000000000..aa929b9ef --- /dev/null +++ b/docker-build-wrapper.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This script will build the docker images for the dvmdostem project. +# Note: Some steps may take a while, please be patient. + +# Note: You may try --no-cache with the docker build commands if they +# fail with various errors reccomending --fix-missing errors. + +# Here is a handy formulation for finding and deleting old docker images, +# adjust the grep commands as necessary: +# +# $ docker image ls | grep dvmdostem \ +# | grep v0.5.6-87-g | awk '{print $1,$2}' | sed -e 's/ /:/g' +# +# This can then be wrapped in a for loop that calls docker image rm to cleanup. + +GIT_VERSION=$(git describe) + +# IMAGE FOR GENERAL C++ DEVELOPMENT +# Makes a general development image with various dev tools installed: +# e.g. compiler, make, gdb, etc +docker build --build-arg GIT_VERSION=$GIT_VERSION \ + --target cpp-dev --tag cpp-dev:$GIT_VERSION . + +# IMAGE FOR GENERAL DVMDOSTEM DEVELOPMENT +# Makes the specific dvmdostem development image with dvmdostem specific +# dependencies installed, e.g: boost, netcdf, jsoncpp, etc. Intention is that +# your host machine's repo will be mounted as a volume at /work, and you can +# use this container as a compile time and run time environment. +docker build --build-arg GIT_VERSION=$GIT_VERSION \ + --target dvmdostem-dev --tag dvmdostem-dev:$GIT_VERSION . + +# IMAGE FOR BUILDING (COMPILING) DVMDOSTEM +# This is for a stand-alone container that can be used to compile the +# dvmdostem binary without needing to mount volumes when the container +# is started. The required files are copied directly to the image. +# The intention is to use this purely as a compile time environment +# used to create the dvmdostem binary so that it can be copied into +# the lean run image. +docker build --build-arg GIT_VERSION=$GIT_VERSION \ + --target dvmdostem-build --tag dvmdostem-build:$GIT_VERSION . + +# IMAGE FOR SIMPLY RUNNING DMVDOSTEM AND ASSOCIATED SCRIPTS +# A lean images with only the bare minimum stuff to run dvmdostem +# Does NOT have development tools, compilers, editors, etc +docker build --build-arg GIT_VERSION=$GIT_VERSION \ + --target dvmdostem-run --tag dvmdostem-run:$GIT_VERSION . + + +# IMAGE FOR WORKING WITH MAPPING TOOLS, SPECIFICALLY GDAL +# The bastard step child needed to run various gdal tools +docker build --build-arg GIT_VERSION=$GIT_VERSION \ + --tag dvmdostem-mapping-support:$GIT_VERSION \ + -f Dockerfile-mapping-support . diff --git a/docker-compose.yml b/docker-compose.yml index 4dc757714..dcddd297c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,41 +2,67 @@ version: '3.2' # Docker Compose file for coordinating several dvmdostem containers. # -# First you should build your images using the commands in the Dockerfiles. +# First you should build your images. This can be done individually or you can +# use the docker-build-wrapper.sh script. # # Next create a .env file where you set the following variables: # $ echo "DDT_INPUT_CATALOG=/some/path/to/your/input-catalog" >> .env # $ echo "DDT_WORKFLOWS=/some/path/to/your/workflows" >> .env +# $ echo "V_TAG=$(git describe)" >> .env # # Next start the containers: # $ docker compose up -d to start the containers # -# Then you can run various program inside the containers. -# See Examples below +# Then you can run various programs inside the containers, see examples below. services: + # Some general dev tools - not expected to be used directly cpp-dev: build: . - image: cpp-dev:0.0.1 - dvmdostem-build: + image: cpp-dev:${V_TAG} + + # The general dvmdostem dev enviorment. Intented to be used for + # most development work by mounting volumes of source code into + # the resulting container - essentially sharing the source code + # folders from the host to the container so they can be edited + # on the host and used w/in the container run-time. + dvmdostem-dev: + image: dvmdostem-dev:${V_TAG} build: . - image: dvmdostem-build:0.0.1 + tty: true volumes: - - sourcecode:/work + - sourcecode:/work + - inputcatalog:/data/input-catalog + - workflows:/data/workflows + + # This is more of a stand-alone image, just meant to serve as a + # compile time environment for creating the lean run image. + # Copies source code into the image so that it doesn't need + # volumes to run container and run make. Then once the dvmdostem + # binary exists in this image, it can be copied into the lean + # run image. + dvmdostem-build: + image: dvmdostem-build:${V_TAG} + build: . + #command: tail -F /dev/null # keeps container running + + # The lean production image dvmdostem-run: - tty: true + image: dvmdostem-run:${V_TAG} build: . - image: dvmdostem-run:0.0.1 + tty: true ports: - "8888:8888" volumes: - - sourcecode:/work - inputcatalog:/data/input-catalog - workflows:/data/workflows + + # Auxillary stuff that can't run on other container/images due to difficult + # build dependencies (GDAL mainly). dvmdostem-mapping-support: - tty: true + image: dvmdostem-mapping-support:${V_TAG} build: . - image: dvmdostem-mapping-support:0.0.1 + tty: true ports: - "5006:5006" volumes: diff --git a/docker-install.sh b/docker-install.sh deleted file mode 100644 index 07d1a0d02..000000000 --- a/docker-install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# This script will install the docker. -# Note: The installation could take a while, please be patient. - -docker build --target cpp-dev --tag cpp-dev:0.0.1 . -docker build --target dvmdostem-build --tag dvmdostem-build:0.0.1 . -docker build --target dvmdostem-run --tag dvmdostem-run:0.0.1 . -docker build --tag dvmdostem-mapping-support:0.0.1 -f Dockerfile-mapping-support . diff --git a/requirements_general_dev.txt b/requirements_general_dev.txt new file mode 100644 index 000000000..8b726745a --- /dev/null +++ b/requirements_general_dev.txt @@ -0,0 +1,10 @@ +matplotlib==3.5.2 +numpy==1.22.3 +pandas==1.4.2 +bokeh==2.4.2 +netCDF4==1.5.8 +commentjson==0.9.0 +ipython==8.3.0 +jupyter==1.0.0 +lhsmdu==1.1 + diff --git a/requirements.txt b/requirements_mapping.txt similarity index 100% rename from requirements.txt rename to requirements_mapping.txt