-
Notifications
You must be signed in to change notification settings - Fork 950
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
Conversation
@@ -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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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? 😄
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes
Oh, CI fails because of this case for many times.
|
Codecov Report
@@ 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
|
Signed-off-by: Ace-Tang <[email protected]>
LGTM |
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