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

Apptainer is looking for libraries outside container | local environment may not be isolated properly within the container #30

Open
SamGuay opened this issue Sep 10, 2024 · 0 comments

Comments

@SamGuay
Copy link

SamGuay commented Sep 10, 2024

When I ran dmriqc_flow with scilus-1.5.0 on a cluster that loaded flexiblas automatically (Narval in my case), I unexpectedly discovered that Python (inside the container) looked through the host dir for flexiblas (BLAS and LAPACK) for some reason ( ~/.local/lib). It thus always ended up with the followring error:

ImportError: libflexiblas.so.3: cannot open shared object file: No such file or directory

I don't know whether it's a $PATH order error or something else.. See Nextflow's issue #248 for a similar issue on the matter.

One thing I know is that by setting the var env PYTHONNOUSERSITE to true, it prevents Python from using the Host's local cache and works flawlessly! That's the solution used by nf-core/rnaseq.

See last env var set in nextflow.config

env {
    ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1
    MRTRIX_NTHREADS=1
    OMP_NUM_THREADS=1
    OPENBLAS_NUM_THREADS=1
    PYTHONNOUSERSITE=1
}

Another potential solution that is probably more robust and safer for many reasons would be to enable autoMounts but to prevent mounting the host home dir. However there might be other implications I'm not aware but that would isolate properly the container env. Note that I haven't tested this solution.

process.containerOptions = "--no-home"

That being said, this problem only happens because it uses nextflow v21. It was fixed in v23.07.0+) See warning in official doc here.

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

No branches or pull requests

1 participant