Skip to content

Commit

Permalink
chore: Updated configuration files for docker creation (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsopre authored Jul 15, 2024
1 parent ebcd050 commit 8960763
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 14 deletions.
27 changes: 27 additions & 0 deletions .config/docker_environment.yml
Original file line number Diff line number Diff line change
@@ -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
46 changes: 32 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
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"]
2 changes: 2 additions & 0 deletions docs/docker_and_cloud/argo_deployment.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _argo_deployment:

Deploying Argo Workflows with Helm on Amazon EKS
================================================

Expand Down

0 comments on commit 8960763

Please sign in to comment.