usatlas / analysisbase-dask-uc

UC AF specific image building
https://hub.docker.com/r/sslhep/analysis-dask-uc/tags
2 stars 0 forks source link

End user should be given control over `/venv/` virtual environment #2

Closed matthewfeickert closed 1 year ago

matthewfeickert commented 1 year ago

The end user should be able to fully control the /venv/ virtual environment that gets picked up when . /release_setup.sh is activated. At the moment, it seems that there are issues with the ownership belonging to root:

[bash][feickert]:workarea > . /release_setup.sh 
Configured GCC from: /opt/lcg/gcc/11.2.0-8a51a/x86_64-centos7/bin/gcc
Configured AnalysisBase from: /usr/AnalysisBase/24.2.26/InstallArea/x86_64-centos7-gcc11-opt
(venv) [bash][feickert AnalysisBase-24.2.26]:workarea > python -m pip list | grep numpy
numpy                     1.26.1
(venv) [bash][feickert AnalysisBase-24.2.26]:workarea > python -m pip uninstall --yes numpy
Found existing installation: numpy 1.26.1
Uninstalling numpy-1.26.1:
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/AnalysisBaseExternals/24.2.26/InstallArea/x86_64-centos7-gcc11-opt/lib/python3.9/shutil.py", line 823, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/venv/bin/f2py' -> '/tmp/pip-uninstall-pthim6j_/f2py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
  File "/venv/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py", line 105, in run
    uninstall_pathset = req.uninstall(
  File "/venv/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 725, in uninstall
    uninstalled_pathset.remove(auto_confirm, verbose)
  File "/venv/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 381, in remove
    moved.stash(path)
  File "/venv/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 272, in stash
    renames(path, new_path)
  File "/venv/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 362, in renames
    shutil.move(old, new)
  File "/usr/AnalysisBaseExternals/24.2.26/InstallArea/x86_64-centos7-gcc11-opt/lib/python3.9/shutil.py", line 844, in move
    os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/venv/bin/f2py'
(venv) [bash][feickert AnalysisBase-24.2.26]:workarea > ls -lht /venv 
total 24K
drwxr-xr-x 2 atlas root 4.0K Nov  9 17:28 bin
drwxr-xr-x 6 atlas root 4.0K Nov  9 17:28 share
drwxr-xr-x 1 atlas root 4.0K Nov  9 17:28 etc
-rw-r--r-- 1 atlas root  136 Nov  9 17:27 pyvenv.cfg
drwxr-xr-x 2 atlas root 4.0K Nov  9 17:27 include
drwxr-xr-x 3 atlas root 4.0K Nov  9 17:27 lib
lrwxrwxrwx 1 atlas root    3 Nov  9 17:27 lib64 -> lib
(venv) [bash][feickert AnalysisBase-24.2.26]:workarea > 
ivukotic commented 1 year ago

should be fixed now.

matthewfeickert commented 1 year ago

Great and thanks, things are working as expected now! :+1:

[bash][feickert]:pycolumnarprototype > . /release_setup.sh 
Configured GCC from: /opt/lcg/gcc/11.2.0-8a51a/x86_64-centos7/bin/gcc
Configured AnalysisBase from: /usr/AnalysisBase/24.2.26/InstallArea/x86_64-centos7-gcc11-opt
(venv) [bash][feickert AnalysisBase-24.2.26]:pycolumnarprototype > python -m pip show numpy | grep Location
Location: /venv/lib/python3.9/site-packages
(venv) [bash][feickert AnalysisBase-24.2.26]:pycolumnarprototype > python -m pip uninstall --yes numpy
Found existing installation: numpy 1.26.1
Uninstalling numpy-1.26.1:
  Successfully uninstalled numpy-1.26.1
(venv) [bash][feickert AnalysisBase-24.2.26]:pycolumnarprototype > python -m pip --quiet install --pre --upgrade 'coffea==2023.10.0rc1'
(venv) [bash][feickert AnalysisBase-24.2.26]:pycolumnarprototype > python -m pip list | grep 'numpy\|coffea'
coffea                    2023.10.0rc1
numpy                     1.25.2
(venv) [bash][feickert AnalysisBase-24.2.26]:pycolumnarprototype >