reanahub / reana-demo-bsm-search

REANA example - BSM search
MIT License
6 stars 30 forks source link

docker: non-root user #14

Closed tiborsimko closed 4 years ago

tiborsimko commented 5 years ago

The BSM example does not work anymore because of permission troubles:

$ reana-client status -w bsm-search.serial
NAME                RUN_NUMBER   CREATED               STATUS   PROGRESS
bsm-search.serial   1            2019-09-13T14:53:17   failed   65/65

$ reana-client logs -w bsm-search.serial
[#0] WARNING:InputArguments -- RooAbsReal::createHistogram(L_x_qcd_channel1_overallSyst_x_Exp) WARNING extended mode requested for a non-pdf object, ignored
[#1] INFO:InputArguments -- RooAbsReal::createHistogram(L_x_qcd_channel1_overallSyst_x_Exp) INFO: Model has intrinsic binning definition, selecting that binning for the histogram
Traceback (most recent call last):
  File "/code/hepdata_export.py", line 53, in <module>
    main()
  File "/code/hepdata_export.py", line 45, in main
    with open('submission.yaml','w') as f:
IOError: [Errno 13] Permission denied: 'submission.yaml'
        zip warning: name not matched: submission.yaml
        zip warning: name not matched: data1.yaml

zip error: Nothing to do! (/var/reana/users/00000000-0000-0000-0000-000000000000/workflows/3d2508ae-c771-4cb5-be8f-b030a275dc23/hepdata/submission.zip)

This is perhaps because of default root container user:

$ docker run -i -t reanahub/reana-demo-bsm-search /bin/bash
root@24c08ceee045:/code# id
uid=0(root) gid=0(root) groups=0(root)

Should be similar issue as in https://github.com/reanahub/reana-demo-atlas-recast/issues/18

(stems from https://github.com/reanahub/reana-workflow-engine-yadage/pull/129)

dprelipcean commented 5 years ago

Apparently, we will have to install Python3 as well, since I get this error from building the image from the Dockerfile:

Step 3/7 : RUN pip install hftools
 ---> Running in 3b4b7d32b27f
Downloading/unpacking hftools
  Downloading hftools-0.0.6.tar.gz
  Running setup.py (path:/tmp/pip_build_root/hftools/setup.py) egg_info for package hftools

Downloading/unpacking click (from hftools)
Downloading/unpacking pyyaml (from hftools)
  Running setup.py (path:/tmp/pip_build_root/pyyaml/setup.py) egg_info for package pyyaml
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)

Downloading/unpacking numpy (from hftools)
  Running setup.py (path:/tmp/pip_build_root/numpy/setup.py) egg_info for package numpy
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/numpy/setup.py", line 31, in <module>
        raise RuntimeError("Python version >= 3.5 required.")
    RuntimeError: Python version >= 3.5 required.
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/numpy/setup.py", line 31, in <module>

    raise RuntimeError("Python version >= 3.5 required.")

RuntimeError: Python version >= 3.5 required.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/numpy
Storing debug log for failure in /root/.pip/pip.log
The command '/bin/sh -c pip install hftools' returned a non-zero code: 1