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

docker: requirements #543

Closed
paskino opened this issue May 21, 2021 · 3 comments
Closed

docker: requirements #543

paskino opened this issue May 21, 2021 · 3 comments
Labels
Milestone

Comments

@paskino
Copy link
Contributor

paskino commented May 21, 2021

If I understand correctly, the docker image uses miniconda python.

Dockerfile calls user_python-ubuntu.sh without parameters, which means that it's going to install to /opt/pyenv and use miniconda as default python.

It later uses requirements.txt to install via pip.

Probably, for the training we will need to add some additional dependencies for CIL, either via pip or conda.

@paskino paskino added this to the v3.1 milestone May 21, 2021
@KrisThielemans
Copy link
Member

In many cases, requirements.txt seems to be usable for both conda and pip, but not always (i.e. the --only-binary option doesn't work on conda , although I don't know why we use it for pip matplotlib).

I have no understanding of why it (dis)advantages of using pip in a conda install. I guess pip has more than conda, but I guess if conda packages are available it'd make sense to use them. Or maybe it's all the same...

See also discussion in #493 on how to avoid having to track the requirements separately (but would require CIL-demos to have a requirements.txt presumably

@paskino
Copy link
Contributor Author

paskino commented Oct 29, 2021

In the branch I used to create the docker image for the Fully3D training I stripped the --only-binary stuff and used conda to install.

https://github.com/paskino/SIRF-SuperBuild/blob/aa067e7609417fa216229ced22e4e55603e9f11e/docker/user_service-ubuntu.sh#L21-L34

#install SIRF-Exercises requirements
cd $INSTALL_DIR/SIRF-Exercises
if [ -f requirements.txt ]; then
   # uses only the requirement name not --only-binary and removes empty lines and comments
   awk '{if ($1!="#" && NF) {print $1} }'  requirements.txt > crequirements.txt


   while read in; do 
    conda install -c conda-forge -y ${in} || \
    pip install -U ${in}; done < crequirements.txt


  if [ -f crequirements.txt ] ; then
    rm crequirements.txt
  fi
fi

@KrisThielemans
Copy link
Member

done?

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

No branches or pull requests

2 participants