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

container: update real-time resources #33731

Merged
merged 1 commit into from Nov 24, 2017

Conversation

Projects
None yet
7 participants
@runcom
Member

runcom commented Jun 19, 2017

CPU real-time period and runtime are actually sent as part of an update
command via the cli:

https://github.com/docker/cli/blob/master/cli/command/container/update.go#L20-L21

This patch makes update effective because, until now, those settings
weren't actually updated in a container.

Tested in on a real-time kernel, this fixes the issue. Can't add a test
though as I don't think CI has rt kernels enabled.

Reproducer on a rt kernel:

root@xxx ~]# docker run -p 9090:9090 -itd --cpu-rt-runtime=790000
--ulimit rtprio=99 --cap-add=sys_nice mytest
[root@xxx ~]# docker exec -it awesome_edison /bin/bash
[root@451a1aa4fd46 /]# cat /sys/fs/cgroup/cpu/cpu.rt_runtime_us
790000

[root@xxx ~]# docker update --cpu-rt-runtime=810000 awesome_edison
awesome_edison
[root@xxx ~]# docker exec -it awesome_edison /bin/bash
[root@451a1aa4fd46 /]# cat /sys/fs/cgroup/cpu/cpu.rt_runtime_us
790000

[root@xxx ~]# echo 811000 >
/sys/fs/cgroup/cpu/system.slice/docker-451a1aa4fd468f3b67783c23d00e70558183456c775119484319c3f17d49e409.scope/cpu.rt_runtime_us
[root@xxx ~]# docker exec -it awesome_edison /bin/bash
[root@451a1aa4fd46 /]# cat /sys/fs/cgroup/cpu/cpu.rt_runtime_us
811000

Signed-off-by: Antonio Murdaca runcom@redhat.com

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@cpuguy83

LGTM

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 19, 2017

Member

wait, this is still missing containerd changes...

Member

runcom commented Jun 19, 2017

wait, this is still missing containerd changes...

@runcom runcom changed the title from container: update real-time resources to [WIP] container: update real-time resources Jun 19, 2017

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 19, 2017

Member

Sorry for the confusion, I had time now to create containerd/containerd#1031 - after that's merged I'll re-vendor containerd here for this PR

Member

runcom commented Jun 19, 2017

Sorry for the confusion, I had time now to create containerd/containerd#1031 - after that's merged I'll re-vendor containerd here for this PR

@runcom runcom changed the title from [WIP] container: update real-time resources to container: update real-time resources Jun 21, 2017

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 21, 2017

Member

@mlaventure @cpuguy83 good to go now

Member

runcom commented Jun 21, 2017

@mlaventure @cpuguy83 good to go now

@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Jun 21, 2017

Contributor

@runcom looks like the default spec generation needs to be updated. Process is now a pointer.

Contributor

mlaventure commented Jun 21, 2017

@runcom looks like the default spec generation needs to be updated. Process is now a pointer.

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 21, 2017

Member

Hopefully fixed

Member

runcom commented Jun 21, 2017

Hopefully fixed

@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Jun 21, 2017

Contributor

Looks like oom_score_adj is broken now:

17:33:07 ----------------------------------------------------------------------
17:33:07 FAIL: docker_cli_run_test.go:3830: DockerSuite.TestRunWithOomScoreAdj
17:33:07 
17:33:07 docker_cli_run_test.go:3837:
17:33:07     c.Fatalf("Expected oom_score_adj set to %q, got %q instead", expected, oomScoreAdj)
17:33:07 ... Error: Expected oom_score_adj set to "642", got "0" instead
17:33:07 
17:33:07 
17:33:07 ----------------------------------------------------------------------
Contributor

mlaventure commented Jun 21, 2017

Looks like oom_score_adj is broken now:

17:33:07 ----------------------------------------------------------------------
17:33:07 FAIL: docker_cli_run_test.go:3830: DockerSuite.TestRunWithOomScoreAdj
17:33:07 
17:33:07 docker_cli_run_test.go:3837:
17:33:07     c.Fatalf("Expected oom_score_adj set to %q, got %q instead", expected, oomScoreAdj)
17:33:07 ... Error: Expected oom_score_adj set to "642", got "0" instead
17:33:07 
17:33:07 
17:33:07 ----------------------------------------------------------------------
@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 22, 2017

Member

Looks like oom_score_adj is broken now:

bumped runc to take care of it I guess

Member

runcom commented Jun 22, 2017

Looks like oom_score_adj is broken now:

bumped runc to take care of it I guess

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 22, 2017

Member

alright, runc is still way to old wrt runtime-spec, I'm bumping it again...

Member

runcom commented Jun 22, 2017

alright, runc is still way to old wrt runtime-spec, I'm bumping it again...

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Jun 22, 2017

Member

looks like spec must be updated in containerd v0.2.x to use new runc....

Member

runcom commented Jun 22, 2017

looks like spec must be updated in containerd v0.2.x to use new runc....

@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Jul 4, 2017

Contributor

ping @runcom

12:36:24 ----------------------------------------------------------------------
12:36:24 FAIL: docker_cli_run_unix_test.go:564: DockerSuite.TestRunWithBlkioWeight
12:36:24 
12:36:24 docker_cli_run_unix_test.go:569:
12:36:24     c.Assert(strings.TrimSpace(out), checker.Equals, "300")
12:36:24 ... obtained string = "500"
12:36:24 ... expected string = "300"
12:36:24 
12:36:25 
12:36:25 ----------------------------------------------------------------------
Contributor

mlaventure commented Jul 4, 2017

ping @runcom

12:36:24 ----------------------------------------------------------------------
12:36:24 FAIL: docker_cli_run_unix_test.go:564: DockerSuite.TestRunWithBlkioWeight
12:36:24 
12:36:24 docker_cli_run_unix_test.go:569:
12:36:24     c.Assert(strings.TrimSpace(out), checker.Equals, "300")
12:36:24 ... obtained string = "500"
12:36:24 ... expected string = "300"
12:36:24 
12:36:25 
12:36:25 ----------------------------------------------------------------------
@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Sep 21, 2017

Member

ping @runcom what's the status on this one? Looks like it needs a rebase at least 😅

Member

thaJeztah commented Sep 21, 2017

ping @runcom what's the status on this one? Looks like it needs a rebase at least 😅

@coolljt0725

This comment has been minimized.

Show comment
Hide comment
@coolljt0725

coolljt0725 Nov 22, 2017

Contributor

ping @runcom what's the status on this pr? needs a rebase

Contributor

coolljt0725 commented Nov 22, 2017

ping @runcom what's the status on this pr? needs a rebase

@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom

runcom Nov 22, 2017

Member

looks like spec must be updated in containerd v0.2.x to use new runc....

need to take care of that but it wasn't trivial as many stuff have alerady been updated there...I'll re-work on this asap

Member

runcom commented Nov 22, 2017

looks like spec must be updated in containerd v0.2.x to use new runc....

need to take care of that but it wasn't trivial as many stuff have alerady been updated there...I'll re-work on this asap

container: update real-time resources
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@runcom

This comment has been minimized.

Show comment
Hide comment
@runcom
Member

runcom commented Nov 22, 2017

@coolljt0725

This comment has been minimized.

Show comment
Hide comment
@coolljt0725

coolljt0725 Nov 23, 2017

Contributor

LGTM

Contributor

coolljt0725 commented Nov 23, 2017

LGTM

@yongtang

LGTM

@yongtang yongtang merged commit dfe2c02 into moby:master Nov 24, 2017

6 checks passed

dco-signed All commits are signed
experimental Jenkins build Docker-PRs-experimental 37974 has succeeded
Details
janky Jenkins build Docker-PRs 46685 has succeeded
Details
powerpc Jenkins build Docker-PRs-powerpc 7098 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 18242 has succeeded
Details
z Jenkins build Docker-PRs-s390x 6913 has succeeded
Details

@runcom runcom deleted the runcom:rt-fix-update branch Nov 24, 2017

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