Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

CI failing due to hot plug CPUs #250

Closed
jcvenegas opened this issue Apr 20, 2018 · 3 comments · Fixed by #257
Closed

CI failing due to hot plug CPUs #250

jcvenegas opened this issue Apr 20, 2018 · 3 comments · Fixed by #257
Assignees

Comments

@jcvenegas
Copy link
Member

Summarizing 4 Failures:

[Fail] Hot plug CPUs container with CPU period and quota [It] should have 3 CPUs
/home/jenkins/jenkins_slave/workspace/kata-containers-tests-ubuntu-17-10-PR/go/src/github.com/kata-containers/tests/integration/docker/cpu_test.go:91

[Fail] Hot plug CPUs container with CPU period and quota [It] should have 4 CPUs
/home/jenkins/jenkins_slave/workspace/kata-containers-tests-ubuntu-17-10-PR/go/src/github.com/kata-containers/tests/integration/docker/cpu_test.go:91

[Fail] Hot plug CPUs container with CPU constraint [It] should have 3 CPUs
/home/jenkins/jenkins_slave/workspace/kata-containers-tests-ubuntu-17-10-PR/go/src/github.com/kata-containers/tests/integration/docker/cpu_test.go:108

[Fail] Hot plug CPUs container with CPU constraint [It] should have 3 CPUs
/home/jenkins/jenkins_slave/workspace/kata-containers-tests-ubuntu-17-10-PR/go/src/github.com/kata-containers/tests/integration/docker/cpu_test.go:108

Ran 98 of 159 Specs in 543.348 seconds
FAIL! -- 94 Passed | 4 Failed | 0 Pending | 61 Skipped --- FAIL: TestIntegration (567.07s)
FAIL

@devimc devimc self-assigned this Apr 20, 2018
devimc pushed a commit to devimc/kata-tests that referenced this issue Apr 20, 2018

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
this patch is to ensure `nproc` is executed until the last
vCPU has been connected

fixes kata-containers#250

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/kata-tests that referenced this issue Apr 20, 2018

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
ensure `nproc` is executed until the last vCPU has been connected

fixes kata-containers#250

Signed-off-by: Julio Montes <[email protected]>
devimc pushed a commit to devimc/kata-tests that referenced this issue Apr 20, 2018

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
ensure `nproc` is executed until the last vCPU has been connected

fixes kata-containers#250

Signed-off-by: Julio Montes <[email protected]>
@devimc
Copy link

devimc commented Apr 20, 2018

Seems like this issue is more complex than I thought, now that our kernel supports cpuSet libcontainer places the container inside a CPU cgroup with the number of vCPUs available when it is created. VCPUs are hotplugged and connected asynchronously, not all vCPUs are available when the container is created causing this issue

devimc pushed a commit to devimc/kata-tests that referenced this issue Apr 20, 2018

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
when the container is created, it is placed inside a CPU cgroup
with the actual number of vCPUs, hence not all vCPU will be available
for the containers when they are created. For more info see kata-containers#250.

fixes kata-containers#252

Signed-off-by: Julio Montes <[email protected]>
@bergwolf
Copy link
Member

I think we should revisit the user experience to calculate CPU numbers. E.g., the tests uses

docker run --runtime kata --rm --cpu-quota 30000 --cpu-period 10000 -it busybox

which seems to require 3 vCPUs to me but we are actually plugging 4 vCPUs to the guest whereas libcontainer only represents 3 of them to the container process.

@devimc
Copy link

devimc commented Apr 23, 2018

@bergwolf we always start the containers with 1 vCPU (unless something different is specified in the configuration file), if --cpu-quota+--cpu-period or --cpus are used, then those vCPUs are hot added.

take a look https://github.com/clearcontainers/runtime/blob/master/docs/cpu-constraints.md

Before running containers without CPU constraint, consider that your containers are not running alone. Since your containers run inside a virtual machine other processes try to use the vCPUs as well (e.g. systemd and the Clear Container agent).

devimc pushed a commit to devimc/kata-tests that referenced this issue Apr 23, 2018

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
once all vCPUs have been connected, the agent updates the cpuset cgroup
of each container allowing them to access to these resources

Depends-on: github.com/kata-containers/agent#220

fixes kata-containers#250

Signed-off-by: Julio Montes <[email protected]>
@devimc devimc added the review label Apr 23, 2018
devimc pushed a commit to devimc/kata-tests that referenced this issue May 4, 2018

Verified

This commit was signed with the committer’s verified signature.
mikz Michal Cichra
once all vCPUs have been connected, the agent updates the cpuset cgroup
of each container allowing them to access to these resources

fixes kata-containers#250

Signed-off-by: Julio Montes <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants