-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Updated configuration files for docker creation (#525)
- Loading branch information
Showing
3 changed files
with
61 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters