DUNE / dist-comp

Action items for DUNE distributed computing, and common scripts that are used.
2 stars 0 forks source link

Apptainer does not have kx509 #153

Open hschellman opened 6 months ago

hschellman commented 6 months ago

I tried running my normal job setup on a gpvm.

It failed in several places.

apptainer run -B /cvmfs,/exp/dune,/nashome,/pnfs/dune,/opt,/run/user --ipc --pid /cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7\:latest -- /bin/bash

The major ones were kx509 and not having six for fife_utils.

test -- kx509 bash: kx509: command not found

test -- setup fife_utils Traceback (most recent call last): File "/grid/fermiapp/products/common/db/../prd/cigetcert/v1_20_4/Linux64bit-3-10-2-17/python/cigetcert.py", line 63, in from OpenSSL import crypto File "/cvmfs/fermilab.opensciencegrid.org/products/common/prd/cigetcertlibs/v1_5/Linux64bit-3-10-2-17/python/OpenSSL/init.py", line 8, in from OpenSSL import rand, crypto, SSL File "/cvmfs/fermilab.opensciencegrid.org/products/common/prd/cigetcertlibs/v1_5/Linux64bit-3-10-2-17/python/OpenSSL/rand.py", line 9, in from six import integer_types as _integer_types ImportError: No module named six

kherner commented 6 months ago

Working on it...

kherner commented 6 months ago

The fundamental problem is that cigetcert ends up resetting the environment while it's running, so it doesn't use your PYTHONPATH, even if you have the right things in in. I pulled out the final command that is supposed to run, so if you do that standalone, with the proper environment already set up, you can get it to work:

dunegpvm16:~$ apptainer shell --shell=/bin/bash -B /cvmfs,/exp/dune,/nashome,/pnfs/dune,/opt,/run/user,/etc/hostname --ipc --pid /cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7\:latest
Apptainer> export UPS_OVERRIDE="-H Linux64bit+3.10-2.17"
Apptainer> . /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh

Setting up larsoft UPS area... /cvmfs/larsoft.opensciencegrid.org Setting up DUNE UPS area... /cvmfs/dune.opensciencegrid.org/products/dune/

Apptainer> setup six
Apptainer> setup kx509
Apptainer> export PYTHONPATH=${CIGETCERTLIBS_DIR}/python:$PYTHONPATH
Apptainer> export LD_LIBRARY_PATH=${CIGETCERTLIBS_DIR}/lib:$LD_LIBRARY_PATH
Apptainer> /usr/bin/python /cvmfs/fermilab.opensciencegrid.org/products/common/db//../prd/cigetcert/v1_20_4/Linux64bit-3-10-2-17/python/cigetcert.pyc -i 'Fermi National Accelerator Laboratory' -n

Checking if /tmp/x509up_u11469 can be reused ... no Authorizing ...... authorized Fetching certificate ..... fetched Storing certificate in /tmp/x509up_u11469 Your certificate is valid until: Mon Mar 25 23:12:18 2024

kherner commented 6 months ago

The fermilab-util_kx509 rpm is now installed in the container so that should catch most cases, and I believe python-six is set to be installed in the next update, so that should catch any of the remaining ones from when you might have the (now obsolete) kx509 from UPS set up.