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

host-ctr: all devices nodes allowed when superpowered #1037

Merged

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Aug 13, 2020

Issue number:
N/A

Description of changes:

Author: Erikson Tung <etung@amazon.com>
Date:   Thu Aug 13 09:44:14 2020 -0700

    host-ctr: all devices nodes allowed when superpowered
    
    Allow access to all devices nodes when a container is superpowered

Testing done:
No longer getting permission errors when trying to access the partition.

[ec2-user@ip-192-168-19-171 ~]$ sudo sheltie
bash-5.0# signpost status
OS disk: /dev/nvme0n1
Set A:   boot=/dev/nvme0n1p2 root=/dev/nvme0n1p3 hash=/dev/nvme0n1p4 priority=1 tries_left=0 successful=true
Set B:   boot=/dev/nvme0n1p6 root=/dev/nvme0n1p7 hash=/dev/nvme0n1p8 priority=0 tries_left=0 successful=false
Active:  Set A
Next:    Set A
bash-5.0# dd if=/dev/nvme0n1 of=/tmp/foo bs=4k count=8 
8+0 records in
8+0 records out
32768 bytes (33 kB, 32 KiB) copied, 6.5269e-05 s, 502 MB/s
bash-5.0# updog update -i 0.4.1 -r -n                  
Starting update to 0.4.1
Cannot schedule shutdown without logind support, proceeding with immediate shutdown.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@etungsten
Copy link
Contributor Author

Push above is for changes after go mod tidy

@etungsten etungsten changed the title host-ctr: add devices allowed when superpowered host-ctr: all devices nodes allowed when superpowered Aug 13, 2020
@etungsten
Copy link
Contributor Author

Push above addresses @bcressey and @jahkeup 's comments.

@etungsten etungsten marked this pull request as ready for review August 13, 2020 18:31
@etungsten
Copy link
Contributor Author

Separated out withAllDevicesAllowed to its file with a SPDX-License-Identifier at the top for Apache-2.0

Copy link
Contributor

@iliana iliana left a comment

Choose a reason for hiding this comment

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

OK with regards to attribution on all_devices_allowed.go

// withAllDevicesAllowed permits all access on all devices nodes for the container
// Taken from https://github.com/containerd/containerd/blob/25947db049b058fcbce291ef883b8b512e3ea440/oci/spec_opts.go#L1010
// which is not available in containerd v1.3.7
// TODO Once we move to containerd v1.4.0 remove this and use oci.WithAllDevicesAllowed
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this become an issue, and we can reference the issue ID here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/oci"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if we import this as "specs" then it will get rid of most of the delta from the source

Allow access to all devices nodes when a container is superpowered
@etungsten
Copy link
Contributor Author

etungsten commented Aug 13, 2020

Push above adds a comment describing the modification to withAllDevicesAllowed and changes runtimespec to spec to better align with original source.

Copy link
Member

@jahkeup jahkeup left a comment

Choose a reason for hiding this comment

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

If we're sticking with the drop-in function route, then.. ship it! 👍

@etungsten etungsten merged commit e8306ab into bottlerocket-os:develop Aug 13, 2020
@etungsten etungsten deleted the host-ctr-alldevicesallowed branch August 13, 2020 20:09
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.

5 participants