sclorg / container-common-scripts

Apache License 2.0
21 stars 45 forks source link

Traceback in cgroupt-limits #319

Closed phracek closed 1 year ago

phracek commented 1 year ago

I don't know how the traceback was propagated to master. We have PR here #317.

Directly to master via this commit https://github.com/sclorg/container-common-scripts/commit/c1f47bc61c24400336552f1ffe47e18d757a2817

We have now two tracebacks: For RHEL 7:

Testing 'docker run' usage...
Testing 'cgroup limits' usage...
  The test is running as root, all tests for cgroup limits will be run
  Testing 'limited memory' usage...
Traceback (most recent call last):
  File "/usr/bin/cgroup-limits", line 180, in <module>
    "NUMBER_OF_CORES": get_number_of_cores()
  File "/usr/bin/cgroup-limits", line 97, in get_number_of_cores
    limits = [l for l in [_read_cpu_quota(), _read_cpuset_size(), _read_nproc()] if l]
  File "/usr/bin/cgroup-limits", line 172, in _read_nproc
    except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
MEMORY_LIMIT_IN_BYTES=

In case of CentOS Stream 8 we have a traceback:

Testing 'cgroup limits' usage...
  The test is running as root, all tests for cgroup limits will be run
  Testing 'limited memory' usage...
Traceback (most recent call last):
  File "/usr/bin/cgroup-limits", line 180, in <module>
    "NUMBER_OF_CORES": get_number_of_cores()
  File "/usr/bin/cgroup-limits", line 97, in get_number_of_cores
    limits = [l for l in [_read_cpu_quota(), _read_cpuset_size(), _read_nproc()] if l]
  File "/usr/bin/cgroup-limits", line 171, in _read_nproc
    return int(subprocess.run('nproc', capture_output=True).stdout)
  File "/usr/lib64/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
MEMORY_LIMIT_IN_BYTES=
test/run: line 25: [: : integer expression expected
phracek commented 1 year ago

We need to add s2i-base-container to testing as well. It uses cgroup-limits.