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

feat: add --volumes-from support in run command #2241

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

ningziwen
Copy link
Contributor

@ningziwen ningziwen force-pushed the volumes-from branch 2 times, most recently from 53bb0ec to 1ff9725 Compare May 19, 2023 19:32
@ningziwen ningziwen force-pushed the volumes-from branch 6 times, most recently from f74c353 to 967261c Compare June 1, 2023 19:51
@ningziwen
Copy link
Contributor Author

ningziwen commented Jun 1, 2023

Update: Fixed it and ready for review now. The Mounts are actually not consistent in spec. I misrecognized the nerdctl/mount in Annotations as Mounts. The missing Mounts is caused by missing appended opts.


Running into an issue that the spec of task is expected the but mount is not in destination container.

In containerd, are the mounts in one running container deterministic by the OCI spec of current task?

I used the commands to create the source container with a mount and another destination container to import the mount from the source container. I printed the task.Spec() before the task starts. https://github.com/containerd/nerdctl/pull/2241/files#diff-79f01a47e3272b4712676344123e9b763054e51f44d200a986193a7307c87204R364

sudo ./_output/nerdctl run -v /home/ubuntu/nerdctl:/dbdata --name dbstore ubuntu ls /dbdata 

sudo ./_output/nerdctl run --rm --volumes-from dbstore ubuntu ls /dbdata

However, the first one can display the correct directory but the second one returns:

ls: cannot access '/dbdata': No such file or directory

The mounts field in the printed spec of both run command are exactly same as this

mounts:[{"Type":"bind","Source":"/home/ubuntu/nerdctl","Destination":"/dbdata","Mode":"","RW":false,"Propagation":""}]

@ningziwen ningziwen force-pushed the volumes-from branch 3 times, most recently from 55558dd to 5300527 Compare June 30, 2023 07:48
Signed-off-by: Ziwen Ning <ningziwe@amazon.com>
@ningziwen ningziwen marked this pull request as ready for review June 30, 2023 08:15
@AkihiroSuda AkihiroSuda added this to the v1.5.0 milestone Jul 3, 2023
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 3652f45 into containerd:main Jul 16, 2023
21 checks passed
@ningziwen ningziwen deleted the volumes-from branch July 16, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants