-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow npipe volume type on stack file #1195
Conversation
9ba0a18
to
554830d
Compare
@simonferquel Could you take a look please? |
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.
Overall lgtm, just a single nitpicking on unknown mount types error message
cli/compose/convert/volume.go
Outdated
@@ -135,6 +155,8 @@ func convertVolumeToMount( | |||
return handleBindToMount(volume) | |||
case "tmpfs": | |||
return handleTmpfsToMount(volume) | |||
case "npipe": | |||
return handleNpipeToMount(volume) | |||
} | |||
return mount.Mount{}, errors.New("volume type must be volume, bind, or tmpfs") |
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.
Error message should now include npipe as a valid mount type.
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.
Good point. I included it to commit now.
Did not have time to review the moby/moby and swarmkit prs though |
de98345
to
8178403
Compare
@simonferquel swarmkit PR was just merged so can we also merge this one so I will be able to get that moby/moby done? |
@vdemeester can you please look this one too? After moby/moby#37400 is merged we will be able to use named pipes with docker service create but this one is needed to be able do same thing with stack. |
I think we should merge the moby side first |
@simonferquel @vdemeester @thaJeztah moby/moby#37400 have been merged so can we merge this one too? |
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.
LGTM
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.
LGTM 🐯
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.
Thanks! Overall looking good, but I think some more changes are needed 😅 🤗. I'll make a summary
Thanks @olljanat! Looks like some changes are needed to the compose-file schema. Given that this is a new option, and the 3.7 schema is now frozen, that would involve a new schema version (3.8), and changes to this section; https://github.com/docker/cli/blob/master/cli/compose/schema/data/config_schema_v3.7.json#L279-L317 Also ping @shin- for changes in docker compose 🤗 The compose-file reference in the documentation repository will also need a slight update; https://github.com/docker/docker.github.io/blob/master/compose/compose-file/index.md#long-syntax-3, and mention the new option (that's in the documentation repository, so will be a follow up, or separate PR) Some changes to the reference documentation are needed; the reference docs for Finally, we'll probably need some changes to the "storage" documentation for the new type; https://github.com/docker/docker.github.io/blob/master/storage/index.md That's also in the documentation repository, so can be done as a follow-up. Perhaps we need some assistance from the documentation team for that (we can make a tracking issue if needed) |
@thaJeztah It's already supported in Also AFAICT, this doesn't require any changes to the schema; since we don't do any validation on the mount |
@thaJeztah I added one commit which contains service create documentation and created PR docker/docs/pull/7427 of these two other page updates. Also please note that named pipes support have been originally added for non-swarm mode over year ago on moby/moby/pull/33852 so maybe you can also ask help from these Microsoft dudes if more detailed documentation of named pipes are needed. |
@shin- @olljanat doh! You're right; I got confused there; the section I was pointing to is for the volumes:
- type: tmpfs
tmpfs:
size: 12345 my bad! 😊 |
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.
Thanks for updating! Found some small issues in the documentation changes; could you also squash both commits? It's ok to have docs and code changes in the same commit for this PR.
<ul> | ||
<li><tt>volume</tt>: mounts a <a href="https://docs.docker.com/engine/reference/commandline/volume_create/">managed volume</a> | ||
into the container.</li> <li><tt>bind</tt>: | ||
bind-mounts a directory or file from the host into the container.</li> | ||
<li><tt>tmpfs</tt>: mount a tmpfs in the container</li> | ||
<li><tt>npipe</tt>: mounts named pide from the host into the container.</li> |
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.
😅 looks like you indented with a tab, instead of spaces here.
Also there's a typo; pide
instead of pipe
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.
Perhaps it's good to add (Windows containers only)
to the description
@@ -312,15 +314,16 @@ volumes in a service: | |||
<th>Description</th> | |||
</tr> | |||
<tr> | |||
<td><b>types</b></td> | |||
<td><b>type</b></td> |
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.
👍 nice catch
<ul> | ||
<li><tt>volume</tt>: mounts a <a href="https://docs.docker.com/engine/reference/commandline/volume_create/">managed volume</a> | ||
into the container.</li> <li><tt>bind</tt>: | ||
bind-mounts a directory or file from the host into the container.</li> | ||
<li><tt>tmpfs</tt>: mount a tmpfs in the container</li> | ||
<li><tt>npipe</tt>: mounts named pide from the host into the container.</li> | ||
</ul></p> | ||
</td> | ||
</tr> |
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.
Could you also update the required
column at line 332 below https://github.com/docker/cli/pull/1195/files#diff-d4779426535b6679e406cf721c9f9289R332 ?
It currently says;
<td>for <tt>type=bind</tt> only></td>
Which should now be;
<td>for <tt>type=bind</tt> and <tt>type=npipe</tt></td>
(Noticed there's a stray >
there as well)
@@ -291,6 +291,8 @@ You can back up or restore volumes using Docker commands. | |||
|
|||
A **tmpfs** mounts a tmpfs inside a container for volatile data. | |||
|
|||
A **npipe** mounts a named pide from the host into the 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.
whoops typo: pide
(should be pipe
)
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
f50136a
to
0704d9a
Compare
@thaJeztah requested changes should be in-place now. |
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.
LGTM, thanks!!
- What I did
Added volume type npipe to compose file handing.
- How to verify it
Can be tested together with docked from moby/moby#37400
Pre-requirement for moby/moby#37400 to be able to fix moby/moby#34795