(raylet) time=”2021-05-17T06:36:00Z” level=debug msg=”running conmon: /usr/bin/conmon” args=”[—api-version 1 -c 431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826 -u 431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826 -r /usr/bin/runc -b /var/lib/containers/storage/overlay-containers/431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826/userdata -p /tmp/ray/session_2021-05-17_06-35-49_671469_25413/container/d70693837441a080d961f34d99fc474d573fb18b6127ca53ae598766.txt -n optimistic_shaw —exit-dir /var/run/libpod/exits —full-attach -l k8s-file:/var/lib/containers/storage/overlay-containers/431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826/userdata/ctr.log —log-level debug —syslog —conmon-pidfile /var/run/containers/storage/overlay-containers/431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826/userdata/conmon.pid —exit-command /usr/bin/podman —exit-command-arg —root —exit-command-arg /var/lib/containers/storage —exit-command-arg —runroot —exit-command-arg /var/run/containers/storage —exit-command-arg —log-level —exit-command-arg debug —exit-command-arg —cgroup-manager —exit-command-arg cgroupfs —exit-command-arg —tmpdir —exit-command-arg /var/run/libpod —exit-command-arg —runtime —exit-command-arg runc —exit-command-arg —storage-driver —exit-command-arg overlay —exit-command-arg —storage-opt —exit-command-arg overlay.mountopt=nodev,metacopy=on —exit-command-arg —events-backend —exit-command-arg file —exit-command-arg —syslog —exit-command-arg container —exit-command-arg cleanup —exit-command-arg 431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826]”

libpod/container_api.go Container.Start

libpod/container_internal.go Container.prepareToStart

—》libpod/container_internal.go Container.Init

——》libpod/oci_conmon_linux.go ConmonOCIRuntime.CreateContainer

———》libpod/oci_conmon_linux.go ConmonOCIRuntime.createOCIContainer


//容器主进程pid
(raylet) time=”2021-05-17T06:36:00Z” level=debug msg=”Received: 25638”

// 从conmonPidfile读取到conmon进程pid
(raylet) time=”2021-05-17T06:36:00Z” level=info msg=”Got Conmon PID as 25625”

—》libpod/container_internal.go Container.Init

(raylet) time=”2021-05-17T06:36:00Z” level=debug msg=”Created container 431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826 in OCI runtime”

libpod/container_internal.go Container.start

(raylet) time=”2021-05-17T06:36:00Z” level=debug msg=”Starting container 431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826 with command [python -m ray.workers.default_worker —node-ip-address=192.168.121.61 —node-manager-port=44977 —object-store-name=/tmp/ray/session_2021-05-17_06-35-49_671469_25413/sockets/plasma_store —raylet-name=/tmp/ray/session_2021-05-17_06-35-49_671469_25413/sockets/raylet —redis-address=192.168.121.61:6379 —temp-dir=/tmp/ray —metrics-agent-port=58138 —logging-rotate-bytes=536870912 —logging-rotate-backup-count=5 —redis-password=5241590000000000]”

真正启动容器在这两行日志中间:libpod/oci_conmon_linux.go ociRuntime.StartContainer

libpod/container_internal.go Container.start

(raylet) time=”2021-05-17T06:36:00Z” level=debug msg=”Started container 431640990dead86c13db5a491fc1b3eea9cbb03214b6f8b19a7c8ed9b29e3826”

(raylet) time=”2021-05-17T06:36:00Z” level=debug msg=”Called run.PersistentPostRunE(podman run —log-level=debug -d -v /tmp/ray:/tmp/ray —cgroup-manager=cgroupfs —cap-drop SYS_ADMIN —network=host —pid=host —ipc=host —pidfile=/tmp/ray/session_2021-05-17_06-35-49_671469_25413/container/d70693837441a080d961f34d99fc474d573fb18b6127ca53ae598766.txt —env-host —env RAY_JOB_ID=01000000 —env SPT_NOENV=1 —entrypoint python ray -m ray.workers.default_worker —node-ip-address=192.168.121.61 —node-manager-port=44977 —object-store-name=/tmp/ray/session_2021-05-17_06-35-49_671469_25413/sockets/plasma_store —raylet-name=/tmp/ray/session_2021-05-17_06-35-49_671469_25413/sockets/raylet —redis-address=192.168.121.61:6379 —temp-dir=/tmp/ray —metrics-agent-port=58138 —logging-rotate-bytes=536870912 —logging-rotate-backup-count=5 —redis-password=5241590000000000)”