Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,12 @@ jobs:
# Run tests
working_directory: /test
docker:
- image: continuumio/miniconda3
- image: esmvalgroup/esmvalcore:development
steps:
- checkout
- run:
command: |
# Create a file to checksum as cache key
date --rfc-3339 date > cache_key.txt
cat environment.yml >> cache_key.txt
- restore_cache:
key: deps3-{{ .Branch }}-{{ checksum "cache_key.txt" }}
- run:
# Update/Create Conda environment and run tests
command: |
. /opt/conda/etc/profile.d/conda.sh
# conda update -y conda
conda env update
conda activate esmvaltool
python setup.py test --addopts '-m "not installation"'
- save_cache:
key: deps3-{{ .Branch }}-{{ checksum "cache_key.txt" }}
paths:
- "/opt/conda/envs/esmvaltool"
- ".eggs"
- store_test_results:
path: test-reports/
- store_artifacts:
Expand Down Expand Up @@ -137,14 +120,14 @@ jobs:
- run:
command: |
. /opt/conda/etc/profile.d/conda.sh
set -x
mkdir /logs
# Install
# conda update -y conda > /logs/conda.txt 2>&1
conda env update >> /logs/conda.txt 2>&1
set +x; conda activate esmvaltool; set -x
conda install -yS r-base r-yaml ncl -c conda-forge
conda activate esmvaltool
pip install -e .[develop] > /logs/install.txt 2>&1
# install additional requirements for running all tests
conda install -yS r-base r-yaml ncl -c conda-forge
# Log versions
dpkg -l > /logs/versions.txt
conda env export > /logs/environment.yml
Expand Down
65 changes: 65 additions & 0 deletions doc/quickstart/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,71 @@ Once you have installed conda, you can install ESMValCore by running:
conda install -c esmvalgroup -c conda-forge esmvalcore


Using it through Docker
Comment thread
jvegreg marked this conversation as resolved.
Outdated
-----------------------

ESMValCore is also provided thorugh DockerHub in the form of docker containers.
Comment thread
jvegreg marked this conversation as resolved.
Outdated
See https://docs.docker.com/ for more info about docker containers and how to
run the
Comment thread
jvegreg marked this conversation as resolved.
Outdated

You can get the latest release with

.. code-block:: bash

docker pull esmvalgroup/esmvalcore:stable

If yoy want to use the current master branch, use
Comment thread
jvegreg marked this conversation as resolved.
Outdated

.. code-block:: bash

docker pull esmvalgroup/esmvalcore:latest

To run a container using those images, use:

.. code-block:: bash

docker run esmvalgroup/esmvalcore:stable esmvaltool -v

Comment thread
bouweandela marked this conversation as resolved.
.. warning::
Comment thread
jvegreg marked this conversation as resolved.
Outdated

The container does not see the data available in the host by default.
Comment thread
jvegreg marked this conversation as resolved.
Outdated
You can make host data available with `-v /path:/path/in/container`

Using it through Singularity
Comment thread
jvegreg marked this conversation as resolved.
Outdated
----------------------------

Docker is usually forbidden in clusters due to security reasons. However,
there is a more secure alternative to run containers that is usually available
on them: Singularity.

Singularity can use docker containers directly from DockerHub with the
following command

.. code-block:: bash

singularity run docker://esmvalgroup/esmvalcore:${DESIRED_TAG} -c ${PATH_TO_CONFIG_FILE} ${PATH_TO_RECIPE}

.. warning::
Comment thread
jvegreg marked this conversation as resolved.
Outdated

As with docker, The container does not see the data available in the host by default.
You can make host data available with `-B /path:/path/in/container`

Some clusters may not allow to connect to external services, in those cases
you can create a singularity image locally that can later be uploaded to the cluster.

.. code-block:: bash

singularity build esmvalcore_${TAG}.sif docker://esmvalgroup/esmvalcore:${TAG}

To run the container using the newly created image file use:

.. code-block:: bash

singularity run esmvalcore_${TAG}.sif -c ${PATH_TO_CONFIG_FILE} ${PATH_TO_RECIPE}




Development installation
------------------------

Expand Down
15 changes: 9 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# To build this container, go to ESMValCore root folder and execute :
# docker build -t ${TAG_OF_YOUR_CHOICE} . -f docker/Dockerfile
FROM continuumio/miniconda3

# update the conda packages
RUN conda update -y conda pip

# install development tools
RUN apt-get update -y && apt-get install -y \
build-essential \
curl \
unzip

# install environment packages
RUN conda install -c conda-forge -c esmvalgroup -c birdhouse esmvaltool
COPY . /home/root/source
WORKDIR /home/root/source
RUN ls
RUN conda env update --name base --file environment.yml
RUN pip install .
RUN conda clean --all -y
RUN rm -r /home/root/source

# run tests
RUN esmvaltool -h
Expand Down
20 changes: 20 additions & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To build this container, go to ESMValCore root folder and execute :
# docker build -t ${TAG_OF_YOUR_CHOICE} . -f docker/Dockerfile.dev
FROM continuumio/miniconda3

# update the conda packages
RUN conda update -y conda pip

# Copy source
COPY . /home/root/source
WORKDIR /home/root/source

# Install
RUN apt-get update
RUN conda env update --name base --file environment.yml
RUN pip install -e .[test]
RUN pip uninstall esmvalcore -y

# Clean up
RUN rm -r /home/root/source
RUN conda clean --all -y
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ channels:
- conda-forge

dependencies:
- compilers
- esmpy
- iris>=2.2.1
- graphviz
- gcc_linux-64
- libunwind # Needed for Python3.7+
- python>=3.6
- python-stratify