.devcontainers for development #819
Replies: 3 comments
-
@Imraj-Singh now that SIRF-Exercises has this feature, I'd be interested in understanding what difficulties you had with it. Note that I did use the |
Beta Was this translation helpful? Give feedback.
-
Hi @KrisThielemans , my problems were borne-out of wanting to use SIRF with RDP and have access to my GPU in a docker container. STIR's RDP was only recently exposed in SIRF. Meaning that when I pulled an appropriate image for example: synerbi/sirf:service-gpu. I found that when I spun up a container, the container did not have access to RDP. So within the container I attempted to rebuild sirf with the latest version (by rebuilding with the SuperBuild). I found that when I tried to do this within the container there were a few issues with permissions. For example at some point I attempted to delete, re-clone and re-build the Superbuild (within a container), but I found that permissions prevented deleting some files. What I really wanted was a minimal install of Ubuntu with the packages pre-installed so that I have all the dependencies neccessary to build SIRF, then add more layers above that which installs SIRF as I like. That said I did try another route... I tried using the docker-compose files, to rebuild the image. By rebuilding my thought was that SIRF would be rebuilt with RDP as the docker compose uses the master branch. I tried this and couldn't get this working so abandoned this. In the end I defined my own "minimal" docker file: FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04 RUN apt-get update && apt-get install -y WORKDIR /app RUN adduser --disabled-password --gecos '' --shell /bin/bash user ENV HOME=/home/user RUN export DEBIAN_FRONTEND=noninteractive COPY build_essential-ubuntu.sh . ENV CONDA_AUTO_UPDATE_CONDA=True RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh COPY python_dependencies.sh . COPY build_sirf.sh . I don't think this is a neat or efficient, but it works and I uploaded the image here https://hub.docker.com/r/imrajs/sirf_base. The files "build_essential-ubuntu.sh", "build_sirf.sh" and "python_dependencies.sh" are roughly taken from the docker file in the SuperBuild. My plan is to use this image as a base image in my work, where ontop of this I layer installing pytorch etc. |
Beta Was this translation helpful? Give feedback.
-
I should note that I did notice at least one problem with that image. I sometimes get port conflicts when starting a Gadgetron server. There is probably a nice way of specifying a port for Gadgetron, on an image level and as a devcontainer. That said, I don't need Gadgetron, but built is as I think there is still that issue of interdependencies with the Superbuild meaning that Gadgetron is always built... Not sure if the "minimal" devcontainer would be a useful contribution for the superbuild? |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I struggle quite a lot when attempting to work with/on SIRF. I am a native Windows user (what can I say I like OneDrive...), and this makes building, testing and using rather difficult.
I am a fan of VScode, docker and the utility of .devcontainers. I did spend some time looking at the superbuild and the docker files there, but found them quite confusing. Furthermore, permissions seemed to get in the way... To this end, I set up a very minimal .devcontainer where I have lots of permissions. I did try simply defining the container from the development image (
synerbi/sirf:devel-service
) in the devcontainer.json, but, yeah, I had some permission issues.My aim is to also use this .devcontainer framework to ensure that my research is more reproducible.
Thanks,
Imraj
devcontainer.zip
Beta Was this translation helpful? Give feedback.
All reactions