user-cont / conu

conu - python API for your containers
http://conu.readthedocs.io/en/latest/
MIT License
164 stars 33 forks source link

image.run_via_binary_in_foreground raises conu.exceptions.CountExceeded #385

Open b10n1k opened 3 years ago

b10n1k commented 3 years ago

i have a problem when i try to create a container with run_via_binary_in_foreground

container = image.run_via_binary_in_foreground(volumes=(base_path, "/opt"),
                                                          additional_opts=["--net=host",
                                                                           "--pid=host",
                                                                           "--ipc=host",
                                                                           "-i",

                                                                           "--cap-add", "SYS_ADMIN",
                                                                           "--privileged",
                                                                           "-w=/opt"],
                                                          popen_params={"stdin": subprocess.PIPE,
                                                                        "stdout": subprocess.PIPE})

the trace is

tests/conftest.py:24:


../../../.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/backend/docker/image.py:540: in run_via_binary_in_foreground container_id, popen_instance = self._run_container(run_command_instance, callback) ../../../.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/backend/docker/image.py:396: in _run_container Probe(timeout=2, count=10, pause=0.1, fnc=get_cont_id).run() ../../../.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/utils/probes.py:54: in run return self._run()

i cant find anything in the documentation. Can someone help me understand what am i doing wrong?

dhodovsk commented 3 years ago

This error message means there was a timeout (might be set too low). How long does it take the image to run using CLI?

b10n1k commented 3 years ago

not long. ~1s 0.94s user 0.25s system 37% cpu 3.154 total

full output https://pastebin.com/vYxDJCTy

b10n1k commented 3 years ago

@dhodovsk any update on that?

b10n1k commented 3 years ago

i also tried with the example from the repo https://github.com/user-cont/conu/blob/master/docs/source/examples/check_env.py replacing the registry.fedoraproject.org/fedora with docker.io fedora and seems to have the same issue

❯ python3 check_env.py
14:17:18.229 backend.py        INFO   conu has initiated, welcome to the party!
14:17:18.283 __init__.py       INFO   docker environment info: 'Client: Docker Engine - Community\n Version:           20.10.5\n API version:       1.41\n Go version:        go1.13.15\n Git commit:        55c4c88\n Built:             Tue Mar  2 20:19:16 2021\n OS/Arch:           linux/amd64\n Context:           default\n Experimental:      true\n\nServer: Docker Engine - Community\n Engine:\n  Version:          20.10.5\n  API version:      1.41 (minimum version 1.12)\n  Go version:       go1.13.15\n  Git commit:       363e9a8\n  Built:            Tue Mar  2 20:16:56 2021\n  OS/Arch:          linux/amd64\n  Experimental:     false\n containerd:\n  Version:          1.4.4\n  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e\n runc:\n  Version:          1.0.0-rc93\n  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec\n docker-init:\n  Version:          0.19.0\n  GitCommit:        de40ad0\n'
14:17:18.301 image.py          INFO   run container via binary in foreground
docker: Error response from daemon: No command specified.
See 'docker run --help'.
14:17:19.335 probes.py         WARNING probe is unsuccessful: 
Traceback (most recent call last):
  File "/home/iob/Documents/Programming/test_conu_example/check_env.py", line 10, in <module>
    cont = image.run_via_binary_in_foreground(additional_opts=additional_opts, popen_params={"stdin": subprocess.PIPE})
  File "/home/iob/.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/backend/docker/image.py", line 540, in run_via_binary_in_foreground
    container_id, popen_instance = self._run_container(run_command_instance, callback)
  File "/home/iob/.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/backend/docker/image.py", line 396, in _run_container
    Probe(timeout=2, count=10, pause=0.1, fnc=get_cont_id).run()
  File "/home/iob/.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/utils/probes.py", line 54, in run
    return self._run()
  File "/home/iob/.virtualenvs/pytest_env/lib/python3.9/site-packages/conu/utils/probes.py", line 156, in _run
    raise e
conu.exceptions.CountExceeded
b10n1k commented 3 years ago

i am still looking for some help or documentation of how i can change the timeout properly and use the run_via_binary_in_foreground. is there a channel for communication/support?