Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose build pod name in Docker-in-Docker pod #1788

Open
rgaiacs opened this issue Oct 23, 2023 · 1 comment
Open

Expose build pod name in Docker-in-Docker pod #1788

rgaiacs opened this issue Oct 23, 2023 · 1 comment

Comments

@rgaiacs
Copy link
Contributor

rgaiacs commented Oct 23, 2023

Consider a running instance of BinderHub using Docker-in-Docker. The binderhub-dind pod has the follow processes

PID   USER     TIME  COMMAND
    1 root      0:05 docker-init -- dockerd --storage-driver=overlay2 -H unix:///var/run/dind/docker.sock --mtu=1000
  841 root     14h54 dockerd --storage-driver=overlay2 -H unix:///var/run/dind/docker.sock --mtu=1000
  877 root     28:12 containerd --config /var/run/docker/containerd/containerd.toml
604742 root      0:00 /usr/local/bin/containerd-shim-runc-v2 -namespace moby -id 63eb40b8384d9b3d9667c72c33078c9cdf5dbc4863e909aa96f9431b85051c7b -address /var/run/docker/containerd/containerd.sock
604760 1000      0:00 /bin/sh -c TIMEFORMAT='time: %3R' bash -c 'time ${MAMBA_EXE} env update -p ${NB_PYTHON_PREFIX} --file "environment.yml" && time ${MAMBA_EXE} clean --all -f -y && ${MAMBA_EXE} list -p ${NB_PYTHON_PREFIX} '
604781 1000      0:00 bash -c time ${MAMBA_EXE} env update -p ${NB_PYTHON_PREFIX} --file "environment.yml" && time ${MAMBA_EXE} clean --all -f -y && ${MAMBA_EXE} list -p ${NB_PYTHON_PREFIX}
604782 1000      1:06 {mamba} /srv/conda/bin/python /srv/conda/bin/mamba env update -p /srv/conda/envs/notebook --file environment.yml
604786 1000      0:00 /srv/conda/bin/python -c from multiprocessing.resource_tracker import main;main(6)
604789 root      0:00 sh -c clear; (bash || ash || sh)
604797 root      0:00 ash

How can I tell which build pod is related with the process 604781?

@manics
Copy link
Member

manics commented Oct 23, 2023

I think the processes associated with a container are also present on the host in a cgroups namespace:
https://stackoverflow.com/questions/34878808/finding-docker-container-processes-from-host-point-of-view
It might be more complicated due to three levels (build-pod - dind - host) instead of two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants