diff --git a/.config/docker_environment.yml b/.config/docker_environment.yml new file mode 100644 index 000000000..8980f48a6 --- /dev/null +++ b/.config/docker_environment.yml @@ -0,0 +1,27 @@ +name: ra2ce_env +channels: + - conda-forge + - nodefaults +dependencies: + - conda-forge::python=3.10 + - conda-forge::gdal=3.5.1 + # from here some dragons + - conda-forge::geopandas + - conda-forge::rasterio + - conda-forge::osmnx + - conda-forge::tqdm + - conda-forge::geopy + - conda-forge::momepy + - conda-forge::rasterstats + - conda-forge::ipywidgets + - conda-forge::pyarrow + # Install poetry 1.3.2 (1.4.*) gives issues. + # If this does not work then exclude it from the environment and install it manually + # with: conda install -c conda-forge poetry=1.3.2 + - conda-forge::poetry=1.3.2 + # install jupyterlab and notebook + - conda-forge::jupyterlab + - conda-forge::notebook + # install boto3 + - conda-forge::boto3 + - conda-forge::pandoc \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e2b1d693b..da29eaeff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,38 @@ -# 1. To build this docker run: -# `docker build -t ra2ce` +# Run with `docker build -t ra2ce .` +FROM mambaorg/micromamba:1.4-alpine AS full -FROM python:3.10 +# ENV_NAME is starting a bash inm this environment -RUN apt-get update && apt-get install -y libgdal-dev +ENV HOME=/home/mambauser +ENV ENV_NAME=ra2ce_env +ENV PYTHONPATH="/home/mambauser:$PYTHONPATH" -COPY .config/docker_requirements.txt requirements.txt -# The following step happens in the `workflow.yaml` -# COPY hackathon/hazard_overlay_cloud_run.py ./scripts/run_hazard_overlay.py +# Setting workspace vbriables -RUN pip install numpy -RUN pip install GDAL==3.5.1 -RUN pip install git+https://github.com/Deltares/ra2ce.git +WORKDIR ${HOME} +USER mambauser +# RUN apt-get -qq update && apt-get install --yes --no-install-recommends libgdal-dev libgeos-dev libproj-dev && apt-get -qq purge && apt-get -qq clean && rm -rf /var/lib/apt/lists/* +COPY .config/docker_environment.yml pyproject.toml README.md ${HOME}/ +RUN mkdir -p ${HOME}/.jupyter +COPY .config/jupyter/* ${HOME}/.jupyter -CMD ["python", "/script/run_race.py"] +# Creating ra2ce2_env -# 2. Make sure you push it to the deltares containers -# docker tag ra2ce containers.deltares.nl/ra2ce/ra2ce:latest -# docker push containers.deltares.nl/ra2ce/ra2ce:latest \ No newline at end of file +RUN micromamba create -f docker_environment.yml -y --no-pyc \ + && micromamba clean -ayf \ + && rm -rf ${HOME}/.cache \ + && find /opt/conda/ -follow -type f -name '*.a' -delete \ + && find /opt/conda/ -follow -type f -name '*.pyc' -delete \ + && find /opt/conda/ -follow -type f -name '*.js.map' -delete \ + && rm docker_environment.yml +COPY examples/ ${HOME}/examples +COPY ra2ce/ ${HOME}/ra2ce + +# Installing notabook and Jupyter lab +# this is now in the docker_environment.yml + +# Expose the Jupyter port +EXPOSE 8080 + +# Start Jupyter Notebook +CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8080", "--allow-root"] \ No newline at end of file diff --git a/docs/docker_and_cloud/argo_deployment.rst b/docs/docker_and_cloud/argo_deployment.rst index 6633a5172..f4a8a23cb 100644 --- a/docs/docker_and_cloud/argo_deployment.rst +++ b/docs/docker_and_cloud/argo_deployment.rst @@ -1,3 +1,5 @@ +.. _argo_deployment: + Deploying Argo Workflows with Helm on Amazon EKS ================================================