Unable to do package installations

Unable to do package installations  

  By: dj28 on Feb. 21, 2024, 6:46 p.m.

Unable to install python packages from tar.gz files. The python package refers to other dependencies and unable to build wheels for installation as well. (Network restrictions)

Unable to copy file from persistent-home to /home of the ubuntu-python-pytorch:latest-cuda to do custom installations. Can't use udocker for training process using prepared docker image as well (no option/examples showing how to utilize GPU with udocker within a jobman job) .

The ChaiMeleon environment seems to have bottlenecks at each and every step, half of the time is wasted in setting up the environment.

Everything is restricted.

 Last edited by: dj28 on Feb. 21, 2024, 6:46 p.m., edited 1 time in total.

Re: Unable to do package installations  

  By: alvaroparicio on Feb. 22, 2024, 10:55 a.m.

Hi, we'll try to answer every question.

Regarding this: Unable to install python packages from tar.gz files. The python package refers to other dependencies and unable to build wheels for installation as well. (Network restrictions) Here you have some general solutions: - Generate image locally with everything needed, upload and run on the platform with uDocker. - Generate the wheel locally, upload and install on the platform. To generate the package locally you can use: docker run --rm -it -v /tmp:/tmp/host-tmp python:3.10 bash. This way you will have the same python version as on the platform and the generated package will be compatible.

Regarding this: Unable to copy file from persistent-home to /home of the ubuntu-python-pytorch:latest-cuda to do custom installations. There's no restriction there, can you send a screenshot or the specific error please?

About this: Can't use udocker for training process using prepared docker image as well (no option/examples showing how to utilize GPU with udocker within a jobman job) . Here you have the uDocker example https://github.com/chaimeleon-eu/workstation-images/blob/main/usage-guide.md#running-an-image-with-udocker jobman submit -- "udocker load -i ~/persistent-home/alpine-3.9.tar.gz \ && udocker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets -v /mnt/datalake \ alpine:3.9 ls -lh /home/chaimeleon/persistent-home" To have GPU just add the option "-r " as shown in the GPU example: https://github.com/chaimeleon-eu/workstation-images/blob/main/usage-guide.md#jobman-client-tool jobman submit -i ubuntu-python:latest-cuda -r small-gpu -- nvidia-smi And joining the two examples: jobman submit -r small-gpu -- "udocker load -i ~/persistent-home/alpine-3.9.tar.gz \ && udocker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets -v /mnt/datalake \ alpine:3.9 ls -lh /home/chaimeleon/persistent-home"

No Internet connection is a restriction to install software, we know that, but it is a condition of the project that data cannot leave the platform (if we allow Internet connection, data could be uploaded to the Internet). Tools like pip make it very easy to install software when there is a direct Internet connection and much more difficult when there is not, but it is just a matter of uploading everything you need from your computer. There are several packages already uploaded to ~/persistent-shared-folder/pypi.org/, so you can install them that way: pip install --no-index --find-links ~/persistent-shared-folder/pypi.org pyradiomics pip install --no-index --find-links ~/persistent-shared-folder/pypi.org lifelines pip install --no-index --find-links ~/persistent-shared-folder/pypi.org catboost pip install --no-index --find-links ~/persistent-shared-folder/pypi.org pytorchvideo

Hope we could help!

Re: Unable to do package installations  

  By: dj28 on Feb. 22, 2024, 2:23 p.m.

Thanks for the detailed reply,

But the command you have shared doesn't work - jobman submit -r small-gpu -- "udocker load -i ~/persistent-home/alpine-3.9.tar.gz \ && udocker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets -v /mnt/datalake \ alpine:3.9 ls -lh /home/chaimeleon/persistent-home"

I have modified and run it for my own docker tar.gz. See below -
chaimeleon@jupyter-pytorch-testcolon-666c8c749c-8tk7t:~$ jobman submit -r small-gpu -- "udocker import ~/persistent-home/Dhananjay/chaimeleon_jobman_image.tar.gz chaimeleon_jobman_image:v1 \
&& udocker create --name=mycontainer_dj chaimeleon_jobman_image:v1 \
&& udocker setup --execmode=F3 --nvidia mycontainer_dj \
&& udocker setup mycontainer_dj
&& docker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets -v /mnt/datalake \ chaimeleon_jobman_image:latest ls -lh /home/chaimeleon/persistent-home"
Using image 'harbor.chaimeleon-eu.i3m.upv.es:5000/chaimeleon-library-batch/ubuntu-python:latest'
[SUCCESS] Job named 'jobman-f3811798-cb9b-4335.83de-Oe36eaeda4al' created successfully by user 'inclusterUser'

If you will see the output shared above. The jobman by default picks up 'harbor.chaimeleon-eu.i3m.upv.es:5000/chaimeleon-library-batch/ubuntu-python:latest' image instead of docker provided. The udocker commands are running in the "chaimeleon-library-batch/ubuntu-python:latest" image on kubernetes. And access to GPU through udocker fails.

It would be great if you could use a pytotch image from nvcr.io (nvcr.io/nvidia/pytorch:24.01-py3) and show it works on jobman submit job. the output of nvidia-smi should come out through this docker instead of base jobman image(ubuntu-python-pytorch).

 Last edited by: dj28 on Feb. 23, 2024, 8:41 a.m., edited 4 times in total.

Re: Unable to do package installations  

  By: dj28 on Feb. 23, 2024, 7:52 a.m.

Have tried using udocker within ubuntu-python-pytorch:latest-cuda jobman image as well. Have attached the code that I ran with the output -

jobman submit -i ubuntu-python-pytorch:latest-cuda -r small-gpu -- nvidia-smi

The above command runs jobman image - ubuntu-python-pytorch:latest-cuda and refers to init.sh script to run the further code -

init.sh code -
udocker --version
udocker import persistent-home/Dhananjay/chaimeleon_jobman_image.tar.gz chaimeleon_jobman_image:v1
udocker images
udocker create --name=mycontainer_dj chaimeleon_jobman_image:v1
udocker setup --execmode=F3 --nvidia mycontainer_ dj
udocker setup mycontainer_dj
udocker images
udocker run mycontainer_dj nvidia-smi

This gives the below output -

Please provide an example of a jobman job through which I can run my docker with GPU available for training through udocker.

Re: Unable to do package installations  

  By: alvaroparicio on Feb. 23, 2024, 1 p.m.

Hi, we have extended the documentation with practical cases of python package installation in this chapter: https://github.com/chaimeleon-eu/workstation-images/blob/main/usage-guide.md#upload-and-install-python-packages On the other hand, apologies because it is true that the example we gave you did not work properly. An example of launching with uDocker and GPU has been added in the next chapter: https://github.com/chaimeleon-eu/workstation-images/blob/main/usage-guide.md#running-an-image-with-udocker This example has been tested and works, just note that for openchallenge users you have to omit the "-v /mnt/datalake" part because this directory does not exist for you. Hope we could help!

Re: Unable to do package installations  

  By: dj28 on Feb. 23, 2024, 8:14 p.m.

Based on your comment and the github link shared I did the following -

  • got the nvcr.io/nvidia/cuda:11.8.0-runtime-ubuntu22.04 from here
  • If I run this docker image using docker on my local system with GPU it gives output for nvidia-smi
  • On running a tar.gz file on jobman it gives below output -

Command I ran -
jobman submit -r small-gpu -i ubuntu-python:latest-cuda
"udocker load -i ~/persistent-home/Dhananjay/nvidia_cuda_11_8_0_ubuntu_22_04.tar.gz nvidia/cuda
&& udocker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets nvidia/cuda:11.8.0-runtime-ubuntu22.04 nvidia-smi"

Output received from jobman logs -

Can you please share the exact nvidia/cuda:11.8.0-runtime-ubuntu22.04 tar.gz file you are using with this command, so that I can recreate it and confirm it is running fine. It would be great if you can share the tar.gz as a url in the github page, we can use the same to verify or modify it for our use case

 Last edited by: dj28 on Feb. 23, 2024, 8:32 p.m., edited 2 times in total.

Re: Unable to do package installations  

  By: alvaroparicio on Feb. 26, 2024, 9:15 a.m.

Hi, the network restrictions are imposed on us by the hospitals that have provided the data, for a data protection issue, as they must comply with the regulations set out in the GDPR framework.

On the other hand, you have an example in the documentation to launch with uDocker on a GPU.: https://github.com/chaimeleon-eu/workstation-images/blob/main/usage-guide.md

Re: Unable to do package installations  

  By: dj28 on Feb. 26, 2024, 9:45 a.m.

Hi,

That is fine i have no issues with network restrictions applied by hospitals.

But can you please share the exact nvidia/cuda:11.8.0-runtime-ubuntu22.04 tar.gz file you are using with this command, so that I can recreate it and confirm it is running fine.

It would be great if you can share the tar.gz as a url in the github page, we can use the same to verify or modify it for our use case. and use this as the base image for our docker file and then move it to the chaimeleon environment.

jobman submit -r small-gpu -i ubuntu-python:latest-cuda -- \ "udocker load -i ~/persistent-home/nvidia-cuda-11.8.0-runtime-ubuntu22.04.tar.gz nvidia/cuda \ && udocker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets -v /mnt/datalake \ nvidia/cuda:11.8.0-runtime-ubuntu22.04 nvidia-smi"

The command shared above on github is using nvidia-cuda-11.8.0-runtime-ubuntu22.04.tar.gz can you provide this image which obviously doesn't have any medical data.

Re: Unable to do package installations  

  By: alvaroparicio on Feb. 26, 2024, 12:46 p.m.

Hi, in the github page (the usage guide) it is explained:

Note for this example we use a custom image based on the official nvidia/cuda:11.8.0-runtime-ubuntu22.04, and just adding the missing apt package "nvidia-utils-525" in order to make available the command nvidia-smi. This is the docker file we used: FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04

RUN apt-get -y update && \ apt-get -y install --no-install-recommends nvidia-utils-525 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* It is the simplest image we made just for the example, and the idea is that you use your own with all the tools/libraries you require. But if you just want to "confirm it is running fine", the image generated with the previous dockerfile is now in ~/persistent-shared-folder/images/nvidia-cuda-11.8.0-runtime-ubuntu22.04.tar.gz You can't test with: jobman submit -r small-gpu -i ubuntu-python:latest-cuda -- \ "udocker load -i ~/persistent-shared-folder/images/nvidia-cuda-11.8.0-runtime-ubuntu22.04.tar.gz nvidia/cuda \ && udocker run --rm -v /home/chaimeleon/persistent-home -v /home/chaimeleon/datasets -v /mnt/datalake \ nvidia/cuda:11.8.0-runtime-ubuntu22.04 nvidia-smi"