Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile for new pcrglob version #3

Open
BSchilperoort opened this issue Dec 21, 2023 · 0 comments
Open

Dockerfile for new pcrglob version #3

BSchilperoort opened this issue Dec 21, 2023 · 0 comments

Comments

@BSchilperoort
Copy link
Member

I worked on making the Docker image up to date with UU-Hydro/PCR-GLOBWB_model.

This is the current state:

Dockerfile
# DockerFile for PCR-GLOB model. The ini-file should be mounted as config.ini,
# the input data root directory should be mounted as /data
FROM alpine/git:latest as builder
LABEL maintainer="Bart Schilperoort <[email protected]>"
WORKDIR /opt
RUN git clone https://github.com/UU-Hydro/PCR-GLOBWB_model.git
WORKDIR /opt/PCR-GLOBWB_model

# Pick the branch/tag:
# RUN git checkout feature/arise_30sec_aqueduct_2022-04-14
RUN git checkout v2.4.0_alpha

FROM mambaorg/micromamba:1.3.1

ENV HOME=/home/$MAMBA_USER

COPY --chown=$MAMBA_USER:$MAMBA_USER --from=builder /opt/PCR-GLOBWB_model/conda_env/pcrglobwb_py3_standard.yml $HOME/pcrglobwb_py3_standard.yml
COPY --chown=$MAMBA_USER:$MAMBA_USER --from=builder /opt/PCR-GLOBWB_model $HOME/PCR-GLOBWB_model

WORKDIR $HOME/

# Install PCR-GLOB python environment
RUN micromamba install -y \
    -n base \
    -c conda-forge python=3.10 \
    --file pcrglobwb_py3_standard.yml

# Make sure the conda environment is activated for the remaining build
# instructions below
# (otherwise python will not be found)
ARG MAMBA_DOCKERFILE_ACTIVATE=1  

# Set Volumes
VOLUME /config.ini
VOLUME /data

WORKDIR $HOME/PCR-GLOBWB_model/model

# gcc is required for Cython. We already have micromamba, so we can do:
RUN micromamba install gcc -c conda-forge

# Install cython and compile the imagemean.pyx cython code
RUN pip install Cython
RUN python3 setup.py build_ext --inplace

# # Install GRPC4BMI
RUN pip install grpc4bmi==0.4.0

# # Default command should be to run GRPC4BMI server
# # Don't override micromamba's entrypoint as that activates conda!
CMD run-bmi-server \
    --path "/home/mambauser/PCR-GLOBWB_model/model" \
    --name "bmiPcrglobwb.BmiPCRGlobWB" \
    --bmi-version 0.2 \ 
    --port 55555 --debug

To make this image work with eWaterCycle the BMI has to be updated on the UU-Hydro repository. Additionally, the following setting has to be changed UU-Hydro/PCR-GLOBWB_model@master...BSchilperoort:PCR-GLOBWB_model:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant