-
Notifications
You must be signed in to change notification settings - Fork 5
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
Container-in-a-container issues #434
Comments
Hi Sam, This seems pretty complete. I expect no issues with the local python models, so that should at least help you run a model with forcing generated using ESMValTool.
Yes, I hope that will work (not certain though). Otherwise, getting things to work would be become more complex, as explained in that Kubernetes issue. |
The docs still need to be improved & updated to explain how the local model can be used for HBV. But to run HBV local it essentially is:
|
The current doc's contain an updated example! |
Hey all, We managed to get the local version of the models running and have confirmed these issues are container-in-a-container issues. Our DataLabs developers have suggested using Podman instead of Docker/Apptainer. Is that something you guys have ever experimented with, and do you think it might be a way forward? Would it need modification to eWaterCycle itself, e.g. to deal with config options specifically for Podman? Using Cheers, |
Hi Sam, @sverhoeven has at some point been interested into using Podman, however that might not have gone anywhere due to our infrastructure provider not currently supporting it. We would probably have to write some code specific to Podman in grpc4bmi, just as we have for Docker and Apptainer. If we're lucky it's just writing very similar code for the Podman API instead of the Docker API. You can see some of the code here. It starts up a container, and bind mounts the right directories to it, maintaining the original folder structure. This is so a user can pass the path to a configuration file using |
Thanks Bart. Just having a quick look at the Podman Python docs and the API doesn't look too different to Docker's, though the devil is probably in the detail. I guess there would need to be some new code on the eWaterCycle side too (e.g. here)? |
Yeah, it seems straightforward but there will probably be some issues that are difficult to predict.
Yes, that would be step two. The first step is to make grpc4bmi work with podman. Then you should be able to spawn a new container and connect to it, like https://grpc4bmi.readthedocs.io/en/latest/container/usage.html#using-the-container-clients |
I did find this guide where a rootless podman can run a rootless podman:
This could be a good starting point to try to run a containerized model from inside podman (without writing any code for ewatercycle/grpc4bmi).
Next you can start a grpc4bmi server in headless mode: Then you should be able to open up python, connect to the running grpc4bmi server, and try to initialize the model 🤞 |
Oh nice, that sounds positive! We'll give that a go and see how far we get. I guess there isn't already an image with eWaterCycle installed available anywhere is there? |
Try the following 🤓 Details
Dockerfile (started from the podman container): FROM quay.io/podman/stable
RUN mkdir -p ~/miniconda3
RUN curl -o ~/miniconda3/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
RUN rm ~/miniconda3/miniconda.sh
RUN source ~/miniconda3/bin/activate
RUN curl -o conda-lock.yml https://raw.githubusercontent.com/eWaterCycle/ewatercycle/main/conda-lock.yml
RUN source ~/miniconda3/bin/activate; conda install mamba conda-lock -n base -c conda-forge -y
RUN source ~/miniconda3/bin/activate; conda-lock install --no-dev -n ewatercycle
RUN source ~/miniconda3/bin/activate; conda activate ewatercycle; pip install ewatercycle To build and run:
Could be more efficient (without the repeated |
@CansuUluseker & @mjhollaway I have managed to get a rootless podman container to sucessfully run a grpc4bmi model. The info and Dockerfiles are all here: https://github.com/eWaterCycle/nested-podman a todo for this repository is to support the podman Python SDK https://podman-py.readthedocs.io, however it seems it's basically a drop-in replacement of the Docker SDK so it shouldn't be too much work. |
We are using https://pypi.org/project/docker/ to interact with docker, it talks to a docker deamon so for podman we need a podman socket or switch to podman-py |
Hi all,
Thought I would open up an issue to discuss the container-in-a-container issues that we in UKCEH (@CansuUluseker and @mjhollaway) are having.
Our goal is to use eWaterCycle within a DataLab project, but this is generally relevant to any system built on containers.
Suggestions for us to focus on after our latest meeting:
setuid
privileges is an option within DataLabs (which might be more relevant discussed as an issue in this repo, if I understood correctly?). This issue might be of relevance: Kubernetes support grpc4bmi#27Did I forget anything important or get any of that wrong?
The text was updated successfully, but these errors were encountered: