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

feature: support shm size #1542

Merged
merged 1 commit into from
Jun 20, 2018
Merged

feature: support shm size #1542

merged 1 commit into from
Jun 20, 2018

Conversation

Ace-Tang
Copy link
Contributor

Signed-off-by: Ace-Tang [email protected]

Ⅰ. Describe what this PR did

support run commond pouch run -d --shm-size 1g registry.hub.docker.com/library/busybox:latest top

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@@ -86,6 +91,10 @@ func setupMounts(ctx context.Context, c *Container, s *specs.Spec) error {

// TODO: support copy data.

if mp.Destination == "/dev/shm" && c.HostConfig.ShmSize != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ace-Tang , I checked the swagger and found If omitted, the system uses 64MB. Is it correct for the API side? or it's just for the CLI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the swagger readme is copy from something where, and 64m is not implement in code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. So could you mind to help us to update the description? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we just remove the comment ? In my test, container default shm size is 64M, but I do not know who set it for container.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah....containerd sets it to 64M.

https://github.com/containerd/containerd/blob/master/oci/spec_unix.go#L129-L133

So, we keep it on the swagger.

cli/container.go Outdated
@@ -172,6 +173,11 @@ func (c *container) config() (*types.ContainerCreateConfig, error) {
return nil, err
}

shmSize, err := opts.ParseShmSize(c.shmSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are missing the opts.ParseShmSize function 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes

@Ace-Tang
Copy link
Contributor Author

Oh, CI fails because of this case for many times.

FAIL: /go/src/github.com/alibaba/pouch/test/cli_restart_test.go:34: PouchRestartSuite.TestPouchRestart

@codecov-io
Copy link

codecov-io commented Jun 19, 2018

Codecov Report

Merging #1542 into master will increase coverage by 0.21%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1542      +/-   ##
==========================================
+ Coverage    41.1%   41.31%   +0.21%     
==========================================
  Files         266      267       +1     
  Lines       17313    17331      +18     
==========================================
+ Hits         7116     7161      +45     
+ Misses       9312     9280      -32     
- Partials      885      890       +5
Impacted Files Coverage Δ
cli/common_flags.go 0% <0%> (ø) ⬆️
daemon/mgr/container_utils.go 54.97% <0%> (-0.49%) ⬇️
cli/container.go 0% <0%> (ø) ⬆️
apis/opts/shm_size.go 100% <100%> (ø)
daemon/mgr/spec_mount.go 69.38% <50%> (-0.83%) ⬇️
daemon/mgr/container.go 49.41% <0%> (+0.15%) ⬆️
daemon/logger/jsonfile/utils.go 73.17% <0%> (+1.62%) ⬆️
ctrd/client.go 54.93% <0%> (+10.49%) ⬆️
ctrd/watch.go 75% <0%> (+10.93%) ⬆️
... and 1 more

@fuweid
Copy link
Contributor

fuweid commented Jun 20, 2018

LGTM

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

Successfully merging this pull request may close these issues.

4 participants