caracal-pipeline / caracal

Containerized Automated Radio Astronomy Calibration (CARACal) pipeline
GNU General Public License v2.0
28 stars 6 forks source link

Support for users changing sinularity command to add --cleanenv? #1594

Open ErikOsinga opened 1 month ago

ErikOsinga commented 1 month ago

Hi,

I have encountered this weird error trying to use caracal on my local cluster, where the pipeline crashes on whatever is the first step, because of the way the container is created. It gives this vague error Illegal option --

image

I found this error online https://forum.code-aster.org/public/d/26506-can-t-execute-salome-meca-with-the-singularity-container and apparently it's related to some host environment variables, though I am not sure which ones. In any case, it can be fixed by launching containers with `--cleanenv'.

After some digging around, I found that I could edit caracal_venv/lib64/python3.9/site-packages/stimela/singularity.py and change the line that launches the container to utils.xrun(f"{BINARY} run --cleanenv --workdir {self.execdir} --contain"

However, this is less than ideal. Would it be possible to add a user variable to the caracal command to enable launching the singularity containers with the --cleanenv command?

Perhaps something like

caracal --cleanenv -ct singularity -c strategy.yml

paoloserra commented 1 month ago

pinging @SpheMakh and @Athanaseus

Athanaseus commented 1 month ago

Hi @ErikOsinga thank you for reporting this.

Could you also provide the output/logs-20240717-212232/log-caracal.txt to see if it provides further details on the error?

This is more a stimela issue, and relates to https://github.com/ratt-ru/Stimela-classic/issues/598 requesting environmental variables passed on runtime. I think the currently implemented solution can be set as the default. @SpheMakh please comment, and we can push the changes.

Regards

ErikOsinga commented 1 month ago

Thanks for getting back to me so quickly! The full log-file is attached below.

log-caracal.txt