Skip to content

Conversation

@artqzn
Copy link

@artqzn artqzn commented Aug 17, 2021

Hi,
this is this is initial support of idmapped mount points in containerd. The original PR was published by @mauriciovasquezbernal here #4734.

Updates:

  • Original PR was rebased on top of latest containerd.
  • Idmapped mount support was reimplemented using in Go.
  • Small changes in error handling.
  • Added some comments.
  • Updated container start time performance measurement results (numbers are in seconds).
Image ID mapped mount WithRemappedSnapshot
BusyBox 00.135 04.964
Ubuntu 00.171 15.713
Fedora 00.143 38.799

In current patch set the only idmapped mount points functionality is implemented. I think that user namespace support for containerd should be integrated separately, please share your opinion, maybe I am wrong here. I don't know if anybody is working on it, if no I would like to work on user namespaces support also.

Dear reviewers, could you please check this PR.
Thank you in advance!

cc @alban @rata @mauriciovasquezbernal @AkihiroSuda

artqzn added 2 commits August 17, 2021 22:33
Previously the only fuse-overlayfs supports "--remap-labels" option.
Since idmapped mounts were landed to Linux kernel v5.12 it becomes
possible to use it with overlayfs via mount_setattr() system call.

The approach is the same that used in fuse-overlayfs snapshotter
https://github.com/containerd/fuse-overlayfs-snapshotter implemented
by Akihiro Suda <[email protected]>

The changes are based on experimental patchset published by
Mauricio Vásquez containerd#4734.

Signed-off-by: Mauricio Vásquez <[email protected]>
Signed-off-by: Artem Kuzin <[email protected]>
This patch introduce idmapped mounts support for
container rootfs. The only CTR tool is correnty supported
CRI wil be updated in scope of separate patchset.

The idmapped mounts support was merged in Linux kernel 5.12
torvalds/linux@7d6beb7.
This functionality allows to address chown overhead for containers that
use user namespace.

The changes are based on experimental patchset published by
Mauricio Vásquez containerd#4734.
Current version reiplements support of idmapped mounts using Golang.

Performance measurement results:
Image           idmapped mount  recurcive chown
BusyBox         00.135          04.964
Ubuntu          00.171          15.713
Fedora          00.143          38.799

Signed-off-by: Mauricio Vásquez <[email protected]>
Signed-off-by: Artem Kuzin <[email protected]>
@k8s-ci-robot
Copy link

Hi @artqzn. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@AkihiroSuda AkihiroSuda added kind/feature status/needs-discussion Needs discussion and decision from maintainers labels Aug 17, 2021
@AkihiroSuda AkihiroSuda added this to the 1.6 milestone Aug 17, 2021
@theopenlab-ci
Copy link

theopenlab-ci bot commented Aug 17, 2021

Build succeeded.

Copy link

@brauner brauner left a comment

Choose a reason for hiding this comment

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

Since idmapped mounts were landed to Linux kernel v5.12 it becomes
possible to use it with overlayfs via mount_setattr() system call.

Hello,

Thanks for continuing the work on this. I'm the author of the idmapped mount work. Note that idmapped mounts are not yet supported with overlayfs. I'm currently working on this but this will still take a little. Idmapped mounts can currently be created for:

  • ext4, fat, xfs starting with kernel 5.12
  • btrfs with kernel 5.15

@artqzn
Copy link
Author

artqzn commented Aug 17, 2021

Since idmapped mounts were landed to Linux kernel v5.12 it becomes
possible to use it with overlayfs via mount_setattr() system call.

Hello,

Thanks for continuing the work on this. I'm the author of the idmapped mount work. Note that idmapped mounts are not yet supported with overlayfs. I'm currently working on this but this will still take a little. Idmapped mounts can currently be created for:

  • ext4, fat, xfs starting with kernel 5.12
  • btrfs with kernel 5.15

Hello Christian.

Thank you for the comment. Yes, I know that idmapped mounts for overlayfs are currently unsupported by Linux kernel.
I backported your idmapped mounts patch set in my custom kernel and integrated overlayfs support. Performance measurement was done on top of it.

I think this changes shouldn't break anything. In case of Linux kernel doesn't have necessary support mount_setattr() will fail and container start will be aborted.

Thank you!

@artqzn artqzn closed this Aug 17, 2021
@artqzn artqzn deleted the idmapped_mounts branch August 17, 2021 17:14
@artqzn artqzn restored the idmapped_mounts branch August 17, 2021 17:14
@artqzn
Copy link
Author

artqzn commented Aug 17, 2021

Hi, unfortunately I've accidentally delete the branch and have to re-create the PR.
Very sorry for inconvenience :( The new PR is #5890

Thank you in advance!

@dmcgowan dmcgowan removed this from the 1.6 milestone Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature needs-ok-to-test status/needs-discussion Needs discussion and decision from maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants