compss icon indicating copy to clipboard operation
compss copied to clipboard

Funnyness and semantically void pip version specification on Dockerfile

Open alexbarcelo opened this issue 1 year ago • 1 comments

Level

MINOR

Component

Container creation

Description

Funnyness on version specification of pip on various Dockerfile (at least base/Dockerfile and tutorial/Dockerfile, maybe others).

The character > is used by bash to redirect output. The current Dockerfile tries to use several >= version specification on the pip command (e.g. on https://github.com/bsc-wdc/compss/blob/stable/utils/docker/base/Dockerfile#L53 ). But that is misconstrued due to the bash processing that.

The outcome is that the stdout of this command goes to the file =2.2.3 and so on. The pip command only "sees" the install matplotlib, not the >=2.2.3 (because it is interpreted by the shell). The final outcome is a container that contains several files =0.24.2, =1.0.2 and etc. which are a badge of shame of misconstructed pip install command (been there done that).

This should be solved escaping the > the pip command. Typically, pip install versions are always defined with quotes to avoid pitfalls and to ensure no funny business. So pip install "matplotlib>=2.2.3" "scipy>=..." etc. For == it is not necessary, but it does no harm, and is a good habit.

Fortunately the system does not break because by default pip will try to install last version. However, as it is, the Dockerfile installation is semantically incorrect and doing it wrong in general may result in unexpected behavior (e.g. if in the future, if some pip install requires a <=: not escaping that would result in more catastrophic failure).

Minimal example to reproduce

It is in plain sight on various COMPSs containers, and its files in the root (e.g. /=0.24.2).

alexbarcelo avatar Jul 30 '24 16:07 alexbarcelo

Fixed in upcoming Dockerfile version.

fjconejero avatar Aug 30 '24 14:08 fjconejero