Commit Graph

9017 Commits

Author SHA1 Message Date
Kevin Parsons
f8538b5e12 Fix error case in Windows layer cleanup
ForceRemoveAll has special logic on Windows for cleaning up a Windows
snapshotter directory. The logic was missing proper handling for an
error case that can be returned in some cases.

This fixes the CI failure seen in #5326.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2021-04-09 01:34:57 -07:00
Derek McGowan
6636e36182
Merge pull request #5257 from dmcgowan/prepare-1.5.0-rc.0
Prepare v1.5.0-rc.0
2021-04-08 22:30:44 -07:00
Derek McGowan
8e1a8ecd80
Prepare v1.5.0-rc.0
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-04-08 21:49:12 -07:00
Fu, Wei
d064140369
Merge pull request #5302 from mikebrow/toml-cri-defaults
shows our runc.v2 default options
2021-04-09 11:11:25 +08:00
Derek McGowan
01a39262e8
Merge pull request #5324 from thaJeztah/no_libcontainer_devices
cri/server: use containerd/oci instead of libcontainer/devices (remove libcontainer/devices dependency)
2021-04-08 16:32:08 -07:00
Sebastiaan van Stijn
9bc8d63c9f
cri/server: use containerd/oci instead of libcontainer/devices
Looks like we had our own copy of the "getDevices" code already, so use
that code (which also matches the code that's used to _generate_ the spec,
so a better match).

Moving the code to a separate file, I also noticed that the _unix and _linux
code was _exactly_ the same (baring some `//nolint:` comments), so also
removing the duplicated code.

With this patch applied, we removed the dependency on the libcontainer/devices
package (leaving only libcontainer/user).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-08 23:25:21 +02:00
Mike Brown
dd16b006e5 merge in the move to the new options type
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-08 14:09:59 -05:00
Mike Brown
9144ce9677 shows our runc.v2 default options in the containerd default config
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-08 14:09:59 -05:00
Michael Crosby
ceb08756a4
Merge pull request #5321 from thaJeztah/fix_oom_score_test
fix TestSetOOMScoreBoundaries and replace missing busybox image in CI
2021-04-08 14:54:50 -04:00
Derek McGowan
1645db33df
Merge pull request #5305 from thaJeztah/update_klauspost_compress
go.mod github.com/klauspost/compress v1.11.13
2021-04-08 11:30:41 -07:00
Mike Brown
7648ad289b
Merge pull request #5300 from adisky/fix-toml
Change the type of CRI runtime option
2021-04-08 10:14:45 -05:00
Sebastiaan van Stijn
3d20fa9309
fix TestSetOOMScoreBoundaries
(this was introduced in 44240116aa)

Setting the oom-score-adj to -1000 is only possible if the parent process
either has no score set, or if the score is set to -1000.

However, the current implementation of GetOOMScoreAdj conflates situations
where either _no_ oom-score is set, _or_ oom-score is set, but set to 0.

In the latter case, the test would fail:

    --- FAIL: TestSetOOMScoreBoundaries (0.01s)
        oom_linux_test.go:79: assertion failed: 0 (adjustment int) != -1000 (OOMScoreAdjMin int)
    FAIL

To prevent failures in this situation, skip that part of the test in the
above situation.

Also update the description of GetOOMScoreAdj to clarify its behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-08 13:14:04 +02:00
Aditi Sharma
4d4117415e Change CRI config runtime options type
Changing Runtime.Options type to map[string]interface{}
to correctly marshal it from go to JSON.
See issue: https://github.com/kubernetes-sigs/cri-tools/issues/728

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-04-08 15:11:33 +05:30
Wei Fu
21ebeef745 integration: use busybox:1.32.0 since latest is unavailable
```bash
curl -s https://mirror.gcr.io//v2/library/busybox/tags/list | jq '[.tags ]'
[
  [
    "1.26.2",
    "1.27.2",
    "1.28",
    "1.29",
    "1.29.2",
    "1.30",
    "1.30.1",
    "1.31",
    "1.31.0",
    "1.31.1",
    "1.32.0"
  ]
]
```

The latest is gone. I think we should setup image in github container
registry for CI if possible.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-04-08 17:35:08 +08:00
Maksym Pavlenko
1edab60723
Merge pull request #5253 from thaJeztah/refactor_oom
sys: refactor OOM utilities
2021-04-07 21:21:44 -07:00
Mike Brown
88880f0f2c
Merge pull request #5304 from mikebrow/cri-registry-doc-updates
remove mirrors from default; document the deprecation of registry.configs and registry.mirrors
merging based on LGTMs from https://github.com/containerd/containerd/pull/5304#pullrequestreview-628234110 and https://github.com/containerd/containerd/pull/5304#pullrequestreview-630478887 thanks!
2021-04-07 14:49:36 -05:00
Phil Estes
b52727342c
Merge pull request #5308 from AkihiroSuda/add-imgcrypt-bin
cri-cni-release: add imgcrypt binaries (v1.1.0)
2021-04-07 15:43:38 -04:00
Maksym Pavlenko
a4bc81779d
Merge pull request #5312 from AkihiroSuda/expose-WithoutRunMount
pkg/cri/opts.WithoutRunMount -> oci.WithoutRunMount
2021-04-07 12:06:10 -07:00
Mike Brown
f9bcf4a8a4 add section link
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-07 12:29:43 -05:00
Mike Brown
d4be6aa8fa rm mirror defaults; doc registry deprecations
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-07 12:29:43 -05:00
Sebastiaan van Stijn
7bb73da6b9
runtime/v2/shim: remove unused SetScore() and remove sys.OOMScoreMaxKillable
The shim.SetScore() utility was no longer used since 7dfc605fc6.

Checking for uses outside of this repository, I found only one external use of
this in gVisor; a9441aea27/pkg/shim/service.go (L262-L264)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:58 +02:00
Sebastiaan van Stijn
91e7d21ee8
sys: add AdjustOOMScore() utility
Handle the limits in this function so that consumers don't have to
perform the boundary checks.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:56 +02:00
Sebastiaan van Stijn
44240116aa
sys: add boundary checks to SetOOMScore()
Produce a more user-friendly error in the odd case we would try to set a
score out of range

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:55 +02:00
Sebastiaan van Stijn
ace1912bba
sys: use assert for error checks in OOM tests
Slightly easier to read, and we were already using assert in this file

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:53 +02:00
Sebastiaan van Stijn
6e72715226
sys: add missing pre-condition checks in tests
SetOOMScore requires both privileged (root) and non-user namespace,
for negative values, so adjust the pre-conditions accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:51 +02:00
Sebastiaan van Stijn
badd60d3f6
sys: un-export runningPrivileged(), remove runningUnprivileged()
These are currently only used inside this package, so we might
as well un-export them until we need them elsewhere.

Also updated SetOOMScore() to first check for privileged; check for privileged
looks to be the "faster" path, and checking it first could (in case of non-
privileged) save having to read and parse /proc/self/uid_map.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:49 +02:00
Sebastiaan van Stijn
21a175860d
go.mod github.com/klauspost/compress v1.11.13
full diff: https://github.com/klauspost/compress/compare/v1.11.3...v1.11.13

adds arm64 decompression support, various performance improvements

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:15:59 +02:00
Derek McGowan
8b00eafcaa
Merge pull request #5318 from mikebrow/update-cri-tools-k8s-staging 2021-04-07 09:59:17 -07:00
Mike Brown
58c5fd09e5 re-enable cri test
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-07 10:07:32 -05:00
Mike Brown
da998c81eb move to gcr.io/k8s-staging-cri-tools test images
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-07 10:04:02 -05:00
Akihiro Suda
8ba8533bde
pkg/cri/opts.WithoutRunMount -> oci.WithoutRunMount
Move `pkg/cri/opts.WithoutRunMount` function to `oci.WithoutRunMount`
so that it can be used without dependency on CRI.

Also add `oci.WithoutMounts(dests ...string)` for generality.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-07 21:25:36 +09:00
Akihiro Suda
92ea98eda5
cri-cni-release: add imgcrypt binaries (v1.1.0)
Add `ctd-decoder` and `ctr-enc`.

Close issue 5265

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-07 17:38:42 +09:00
Fu, Wei
85041ffe58
Merge pull request #5276 from aaronlehmann/tracker-false-positives
remotes/docker: Only return "already exists" on push when the upload was sucessful
2021-04-07 11:22:43 +08:00
Aaron Lehmann
4c1fa57194 remotes/docker: Only return "already exists" on push when the upload was successful
The `(dockerPusher).Push` method uses a `StatusTracker` to check if an
upload already happened, before repeating the upload. However, there is
no provision for failure handling. If a PUT request returns an error,
the `StatusTracker` will still see the upload as if it happened
successfully. Add a status boolean so that only successful uploads
short-circuit `Push`.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-04-06 19:45:24 -07:00
Fu, Wei
dc8af03baf
Merge pull request #5303 from mikebrow/cri-remove-deprecated-default-untrusted
remove two very old no longer used runtime options
2021-04-07 10:20:28 +08:00
Mike Brown
0186a329e9 remove two very old no longer used runtime options
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-06 20:41:09 -05:00
Fu, Wei
3db5af9b6a
Merge pull request #5315 from dmcgowan/disable-broken-cri-tools-critest
Temporarily disable cri-tools critest
2021-04-07 08:11:45 +08:00
Derek McGowan
58a07754a6
Temporarily disable cri-tools critest
cri-tools is hardcoded to use images which are broken
within their registry. Disable the tests to unblock
CI until fixed.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-04-06 11:05:34 -07:00
Fu, Wei
ff05d499e2
Merge pull request #5272 from thaJeztah/sync_test_replaces
synchronize replace rules in integration/client go.mod with main go.mod
2021-04-06 10:33:35 +08:00
Derek McGowan
261c107ffc
Merge pull request #5278 from mxpv/toml
Migrate TOML to github.com/pelletier/go-toml
2021-04-01 21:24:52 -07:00
Phil Estes
251e3d15de
Merge pull request #5299 from estesp/refkey-with-name
Add OCI ref.name to unique key in remotes handler
2021-04-01 17:22:03 -04:00
Phil Estes
7ae0a60fb5
Add OCI ref.name to unique key in remotes handler
This allows a pusher to be used for more than one tag without creating a
new resolver/pusher. The current implementation checks the ref key
tracker status based on type and hash and will skip the push even if the
repository reference is unique.

Signed-off-by: Phil Estes <estesp@amazon.com>
2021-04-01 14:20:30 -04:00
Maksym Pavlenko
5ada2f74a7 Keep host order as defined in TOML file
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-04-01 09:29:16 -07:00
Phil Estes
9a9bd09756
Merge pull request #5270 from kzys/remove-blockdev
Use os.File#Seek() to get the size of a block device
2021-03-31 14:33:45 -04:00
Maksym Pavlenko
1c05317a47
Merge pull request #5291 from ktock/generic-diff
images: use generic decompressor for calculating DiffID
2021-03-30 22:28:03 -07:00
Maksym Pavlenko
6866b36ab6 Add workaround to keep docker hosts structs private
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-30 22:20:14 -07:00
ktock
c54d92c79d image: use generic decompressor for calculating DiffID
Currently, `image.GetDiffID` cannot calculate DiffID of zstd layers because it
directly uses `compress/gzip` decompressor.
This commit fixes this issue by using the generic decompressor.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-03-31 10:21:47 +09:00
Sebastiaan van Stijn
1faca349ea
integration/client: rename package to "client"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-30 16:21:36 +02:00
Sebastiaan van Stijn
6fc9e45000
synchronize replace rules in integration/client go.mod with main go.mod
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

asdlkjasdlkj

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-30 16:21:28 +02:00
Maksym Pavlenko
9e19a29847 Fix hosts test on Windows
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-27 16:21:52 -07:00