Commit Graph

12181 Commits

Author SHA1 Message Date
Gabriel Adrian Samfira
1279ad880c Remove bind code path in mount()
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-03 23:18:44 -07:00
Samuel Karp
cbb2d08af0
Merge pull request #8342 from davidhsingyuchen/exit-status-typo 2023-04-03 11:04:12 -07:00
Gabriel Adrian Samfira
6a5b4c9c24 Remove "bind" code path from diff
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-03 08:11:35 -07:00
Akihiro Suda
76690706f4
CI: bump up crun to 1.8.3
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-04-03 14:30:15 +09:00
Gabriel Adrian Samfira
d373ebc4de Properly mount base layers
As opposed to a writable layer derived from a base layer, the volume
path of a base layer, once activated and prepared will not be a WCIFS
volume, but the actual path on disk to the snapshot. We cannot directly
mount this folder, as that would mean a client may gain access and
potentially damage important metadata files that would render the layer
unusabble.

For base layers we need to mount the Files folder which must exist in
any valid base windows-layer.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-02 08:35:34 -07:00
Gabriel Adrian Samfira
ca5605b4a2 Skip parent layer options on bind mounts
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-01 08:49:24 -07:00
Gabriel Adrian Samfira
7f82dd91f4 Add ReadOnly() function
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-01 08:43:14 -07:00
Hsing-Yu (David) Chen
157fe6a13a docs: fix typo in comment of ExitStatus.Exit(Code|Time)
Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
2023-04-01 00:48:26 -07:00
Gabriel Adrian Samfira
4012c1b853 Remove escalated privileges
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:17:35 -07:00
Gabriel Adrian Samfira
54f8abe553 Use DefaultSnapshotter
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:17:35 -07:00
Gabriel Adrian Samfira
47dd3dcffb use t.Fatal if we cannot enable process privileges
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:17:35 -07:00
Gabriel Adrian Samfira
e31bef15fa Update continuity
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:17:32 -07:00
Gabriel Adrian Samfira
95687a9324 Fix go.mod, simplify boolean logic, add logging
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:16:56 -07:00
Gabriel Adrian Samfira
7a36efd75e Ignore ERROR_NOT_FOUND error when removing mount
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:16:55 -07:00
Gabriel Adrian Samfira
db32798592 Update continuity, go-winio and hcsshim
Update dependencies and remove the local bindfilter files. Those have
been moved to go-winio.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:16:52 -07:00
Gabriel Adrian Samfira
00efd3e6d8 Remove unused function
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:15:19 -07:00
Gabriel Adrian Samfira
dc980b14a0 Grant needed privileges for snapshotter tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:15:19 -07:00
Gabriel Adrian Samfira
feb637f92d Fix layer comparison and enable read-only checks
fstest.CheckDirectoryEqual checks if any files in the diff matches a
list of known metadataFiles. This only happens if we specify the initial
layer as the first parameter and the mutated layer as the second.

This also enables the read-only view checks, as the bind filter allows
us to mount a layer as ro.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:15:18 -07:00
Gabriel Adrian Samfira
36dc2782c4 Use bind filer for mounts
The bind filter supports bind-like mounts and volume mounts. It also
allows us to have read-only mounts.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
d591bb0421 Enable TestSnapshotterClient on Windows
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
7b36becd2d Run Windows snapshotter through the test suite
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
ac30eabbdc Fix misspelling of 'Native' as 'Naive'
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
639c5799a2 Add paired 'mount' log for 'unmount'
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
8395e3a89a Don't use all-upper-case filenames in snapshot tests
NTFS, when presented with an all-caps filename, assumes you are just
being loud for no reason, and instead stores an all-lower-case filename.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
909730decb Skip tests that do not apply to WCOW on Windows
Filesystem permissions and ownership are not modifiable via an image
mount.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:18 -07:00
Paul "TBBle" Hampson
469c13997a Ensure mounts are unmounted before leaving the test
This is necessary on Windows, as it's not possible to delete a snapshot
while it is still mounted, even if the mount-point has been deleted.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:17 -07:00
Paul "TBBle" Hampson
84cc3e496b Unify testutil.Unmount on Windows and Unix
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:17 -07:00
Paul "TBBle" Hampson
474a257b16 Implement Windows mounting for bind and windows-layer mounts
Using symlinks for bind mounts means we are not protecting an RO-mounted
layer against modification. Windows doesn't currently appear to offer a
better approach though, as we cannot create arbitrary empty WCOW scratch
layers at this time.

For windows-layer mounts, Unmount does not have access to the mounts
used to create it. So we store the relevant data in an Alternate Data
Stream on the mountpoint in order to be able to Unmount later.

Based on approach in https://github.com/containerd/containerd/pull/2366,
with sign-offs recorded as 'Based-on-work-by' trailers below.

This also partially-reverts some changes made in #6034 as they are not
needed with this mounting implmentation, which no longer needs to be
handled specially by the caller compared to non-Windows mounts.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Based-on-work-by: Michael Crosby <crosbymichael@gmail.com>
Based-on-work-by: Darren Stahl <darst@microsoft.com>
2023-03-31 06:15:17 -07:00
Paul "TBBle" Hampson
34b07d3e2d Implement WCOW parentless active snapshots and view snapshots
The WCOW layer support does not support creating sandboxes with no
parent.  Instead, parentless scratch layers must be layed out as a
directory containing only a directory named 'Files', and all data stored
inside 'Files'. At commit-time, this will be converted in-place into a
read-only layer suitable for use as a parent layer.

The WCOW layer support also does not deal with making read-only layers,
i.e. layers that are prepared to be parent layers, visible in a
read-only manner. A bind-mount or junction point cannot be made
read-only, so a view must instead be a small sandbox layer that we can
mount via WCOW, and discard later, to protect the layer against
accidental or deliberate modification.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2023-03-31 06:15:17 -07:00
Fu Wei
988ee8ffef
Merge pull request #8208 from Iceber/fix_runtime_path
fix the task setting the runtime path
2023-03-31 12:38:08 +08:00
Samuel Karp
8f756bc8c2
Merge pull request #8309 from vinayakankugoyal/fixresolv
Add noexec nodev and nosuid to sandbox /etc/resolv.conf mount bind.
2023-03-30 17:34:08 -07:00
Vinayak Goyal
ac84bf7c89 Update sbserver to add noexec nodev and nosuid to /etc/resolv.conf mount bind.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2023-03-30 21:54:21 +00:00
Akihiro Suda
812111eb08
Merge pull request #8327 from mxpv/linux-mounts
Keep linux mounts for linux sandboxes on Windows/Darwin
2023-03-30 17:21:21 +09:00
Maksym Pavlenko
126ab72fea Keep linux mounts for linux sandboxes on Windows/Darwin
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-29 19:00:06 -07:00
Fu Wei
6682c63175
Merge pull request #8159 from mxpv/split
Initial split of sandboxed CRI service
2023-03-30 09:10:39 +08:00
Vinayak Goyal
990199a021 Test to ensure nosuid,nodev,noexec are set on /etc/reolv.conf mount.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2023-03-29 20:34:05 +00:00
Phil Estes
ca7be3e050
Merge pull request #8323 from AkihiroSuda/runc-1.1.5
update runc binary to v1.1.5
2023-03-29 10:54:41 -04:00
Akihiro Suda
96490734b7
update runc binary to v1.1.5
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-03-29 17:17:19 +09:00
Akihiro Suda
b55dad06aa
go.mod: github.com/opencontainers/runc v1.1.5
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-03-29 17:16:57 +09:00
Iceber Gu
c89438e834 integration: add container start test using abs runtime path
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-29 11:54:52 +08:00
Maksym Pavlenko
3557ac884b Extract image service from CRI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-28 20:37:26 -07:00
Iceber Gu
97064b0772 WithRuntimePath uses the TaskInfo.RuntimePath field
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-29 11:34:50 +08:00
Fu Wei
831b9a9ae8
Merge pull request #8278 from Iceber/cleanup_protobuild_config 2023-03-29 07:09:33 +08:00
Maksym Pavlenko
a47ac4a352
Merge pull request #8295 from samruddhikhandale/samruddhikhandale/add-dev-container
Adds dev container config and updates docs with Codespaces information
2023-03-28 12:18:16 -07:00
Phil Estes
662ff50b73
Merge pull request #8313 from mxpv/atomic
Use atomic.Bool from stdlib (and remove pkg/atomic)
2023-03-28 13:41:49 -04:00
Maksym Pavlenko
a6ac62f02e
Merge pull request #8315 from cpuguy83/devmapper_plugin_skip
devmapper plugin: skip plugin when not configured
2023-03-28 09:36:36 -07:00
Brian Goff
c56f54aa1e devmapper plugin: skip plugin when not configured
This is not really an error in most cases as most people do not use
devmapper, however this shows up as an error in the logs and in the
plugin service when querying the plugins.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-03-28 00:00:55 +00:00
Maksym Pavlenko
4a00e06034
Merge pull request #8312 from mxpv/oci
Defer uid lookups on Darwin
2023-03-27 15:34:32 -07:00
Maksym Pavlenko
a11e47b48c Use built in atomic.Bool
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-27 12:08:06 -07:00
Maksym Pavlenko
87346df54f Defer uid lookups on Darwin
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-27 10:24:01 -07:00