mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Delete shim v1
gvisor-containerd-shim is not compatible with containerd 1.1 or earlier. Starting from containerd 1.2, shim v2 is the preferred interface. PiperOrigin-RevId: 351485556
This commit is contained in:
committed by
gVisor bot
parent
be2b9d75d7
commit
8b0f0b4d11
@@ -116,8 +116,7 @@ go_path(
|
||||
# binaries have been factored into a cli package, which is
|
||||
# a good practice in any case.
|
||||
"//runsc/cli",
|
||||
"//shim/v1/cli",
|
||||
"//shim/v2/cli",
|
||||
"//shim/cli",
|
||||
"//webhook/pkg/cli",
|
||||
|
||||
# Packages that are not dependencies of the above.
|
||||
|
||||
@@ -298,13 +298,9 @@ containerd-test-%: load-basic_alpine load-basic_python load-basic_busybox load-b
|
||||
@$(call sudo,tools/installers:shim)
|
||||
@$(call sudo,test/root:root_test,--runtime=$(RUNTIME) -test.v)
|
||||
|
||||
# Note that we can't run containerd-test-1.1.8 tests here.
|
||||
#
|
||||
# Containerd 1.1.8 should work, but because of a bug in loading images locally
|
||||
# (https://github.com/kubernetes-sigs/cri-tools/issues/421), we are unable to
|
||||
# actually drive the tests. The v1 API is tested exclusively through 1.2.13.
|
||||
# The shim builds with containerd 1.3.9 and it's not backward compatible. Test
|
||||
# with 1.3.9 and newer versions.
|
||||
containerd-tests: ## Runs all supported containerd version tests.
|
||||
containerd-tests: containerd-test-1.2.13
|
||||
containerd-tests: containerd-test-1.3.9
|
||||
containerd-tests: containerd-test-1.4.3
|
||||
|
||||
@@ -433,8 +429,7 @@ $(RELEASE_KEY):
|
||||
$(RELEASE_ARTIFACTS)/%:
|
||||
@mkdir -p $@
|
||||
@$(call copy,//runsc:runsc,$@)
|
||||
@$(call copy,//shim/v1:gvisor-containerd-shim,$@)
|
||||
@$(call copy,//shim/v2:containerd-shim-runsc-v1,$@)
|
||||
@$(call copy,//shim:containerd-shim-runsc-v1,$@)
|
||||
@$(call copy,//debian:debian,$@)
|
||||
|
||||
release: $(RELEASE_KEY) $(RELEASE_ARTIFACTS)/$(ARCH)
|
||||
|
||||
@@ -93,11 +93,10 @@ GO111MODULE=on go get gvisor.dev/gvisor/runsc@go
|
||||
CGO_ENABLED=0 GO111MODULE=on sudo -E go build -o /usr/local/bin/runsc gvisor.dev/gvisor/runsc
|
||||
```
|
||||
|
||||
Subsequently, you can build and install the shim binaries for `containerd`:
|
||||
Subsequently, you can build and install the shim binary for `containerd`:
|
||||
|
||||
```sh
|
||||
GO111MODULE=on sudo -E go build -o /usr/local/bin/gvisor-containerd-shim gvisor.dev/gvisor/shim/v1
|
||||
GO111MODULE=on sudo -E go build -o /usr/local/bin/containerd-shim-runsc-v1 gvisor.dev/gvisor/shim/v2
|
||||
GO111MODULE=on sudo -E go build -o /usr/local/bin/containerd-shim-runsc-v1 gvisor.dev/gvisor/shim
|
||||
```
|
||||
|
||||
Note that this branch is supported in a best effort capacity, and direct
|
||||
|
||||
Vendored
+1
-2
@@ -6,8 +6,7 @@ pkg_tar(
|
||||
name = "debian-bin",
|
||||
srcs = [
|
||||
"//runsc",
|
||||
"//shim/v1:gvisor-containerd-shim",
|
||||
"//shim/v2:containerd-shim-runsc-v1",
|
||||
"//shim:containerd-shim-runsc-v1",
|
||||
],
|
||||
mode = "0755",
|
||||
package_dir = "/usr/bin",
|
||||
|
||||
@@ -27,7 +27,7 @@ doc(
|
||||
name = "containerd_11",
|
||||
src = "containerd_11.md",
|
||||
category = "User Guide",
|
||||
include_in_menu = False,
|
||||
permalink = "/docs/user_guide/containerd/containerd_11/",
|
||||
subcategory = "Containerd",
|
||||
weight = "99",
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ option = "value"
|
||||
```
|
||||
|
||||
The set of options that can be configured can be found in
|
||||
[options.go](https://github.com/google/gvisor/blob/master/pkg/shim/v2/options.go).
|
||||
[options.go](https://cs.opensource.google/gvisor/gvisor/+/master:pkg/shim/options.go).
|
||||
Values under `[runsc_config]` can be used to set arbitrary flags to runsc.
|
||||
`flag = "value"` is converted to `--flag="value"` when runsc is invoked. Run
|
||||
`runsc flags` so see which flags are available
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Older Versions (containerd 1.1)
|
||||
|
||||
**WARNING: containerd 1.1 and shim v1 is no longer supported. The instructions
|
||||
below is kept just for reference in case you're dealing with an old version.
|
||||
It's highly recommended upgrading to the latest version.**
|
||||
|
||||
This document describes how to install and run the `gvisor-containerd-shim`
|
||||
using the untrusted workload CRI extension. This requires `containerd` 1.1 or
|
||||
later.
|
||||
|
||||
@@ -15,14 +15,12 @@ To download and install the latest release manually follow these steps:
|
||||
ARCH=$(uname -m)
|
||||
URL=https://storage.googleapis.com/gvisor/releases/release/latest/${ARCH}
|
||||
wget ${URL}/runsc ${URL}/runsc.sha512 \
|
||||
${URL}/gvisor-containerd-shim ${URL}/gvisor-containerd-shim.sha512 \
|
||||
${URL}/containerd-shim-runsc-v1 ${URL}/containerd-shim-runsc-v1.sha512
|
||||
sha512sum -c runsc.sha512 \
|
||||
-c gvisor-containerd-shim.sha512 \
|
||||
-c containerd-shim-runsc-v1.sha512
|
||||
rm -f *.sha512
|
||||
chmod a+rx runsc gvisor-containerd-shim containerd-shim-runsc-v1
|
||||
sudo mv runsc gvisor-containerd-shim containerd-shim-runsc-v1 /usr/local/bin
|
||||
chmod a+rx runsc containerd-shim-runsc-v1
|
||||
sudo mv runsc containerd-shim-runsc-v1 /usr/local/bin
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ require (
|
||||
github.com/containerd/continuity v0.0.0-20200928162600-f2cc35102c2a // indirect
|
||||
github.com/containerd/fifo v0.0.0-20191213151349-ff969a566b00 // indirect
|
||||
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328 // indirect
|
||||
github.com/containerd/ttrpc v0.0.0-20200121165050-0be804eadb15 // indirect
|
||||
github.com/containerd/typeurl v0.0.0-20200205145503-b45ef1f1f737 // indirect
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.0.0 // indirect
|
||||
|
||||
@@ -66,9 +66,6 @@ github.com/containerd/fifo v0.0.0-20191213151349-ff969a566b00/go.mod h1:jPQ2IAeZ
|
||||
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
|
||||
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328 h1:PRTagVMbJcCezLcHXe8UJvR1oBzp2lG3CEumeFOLOds=
|
||||
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
|
||||
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
|
||||
github.com/containerd/ttrpc v0.0.0-20200121165050-0be804eadb15 h1:+jgiLE5QylzgADj0Yldb4id1NQNRrDOROj7KDvY9PEc=
|
||||
github.com/containerd/ttrpc v0.0.0-20200121165050-0be804eadb15/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
||||
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
|
||||
github.com/containerd/typeurl v0.0.0-20200205145503-b45ef1f1f737 h1:HovfQDS/K3Mr7eyS0QJLxE1CbVUhjZCl6g3OhFJgP1o=
|
||||
github.com/containerd/typeurl v0.0.0-20200205145503-b45ef1f1f737/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
|
||||
|
||||
@@ -57,7 +57,7 @@ global:
|
||||
- "should not use underscores in Go names"
|
||||
exclude:
|
||||
# Generated: exempt all.
|
||||
- pkg/shim/v2/runtimeoptions/runtimeoptions_cri.go
|
||||
- pkg/shim/runtimeoptions/runtimeoptions_cri.go
|
||||
analyzers:
|
||||
asmdecl:
|
||||
external: # Enabled.
|
||||
|
||||
@@ -3,7 +3,7 @@ load("//tools:defs.bzl", "go_library")
|
||||
package(licenses = ["notice"])
|
||||
|
||||
go_library(
|
||||
name = "v2",
|
||||
name = "shim",
|
||||
srcs = [
|
||||
"api.go",
|
||||
"epoll.go",
|
||||
@@ -15,10 +15,10 @@ go_library(
|
||||
visibility = ["//shim:__subpackages__"],
|
||||
deps = [
|
||||
"//pkg/cleanup",
|
||||
"//pkg/shim/proc",
|
||||
"//pkg/shim/runsc",
|
||||
"//pkg/shim/v1/proc",
|
||||
"//pkg/shim/v1/utils",
|
||||
"//pkg/shim/v2/runtimeoptions",
|
||||
"//pkg/shim/runtimeoptions",
|
||||
"//pkg/shim/utils",
|
||||
"//runsc/specutils",
|
||||
"@com_github_burntsushi_toml//:go_default_library",
|
||||
"@com_github_containerd_cgroups//:go_default_library",
|
||||
@@ -13,7 +13,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package v2
|
||||
package shim
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/api/events"
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// +build linux
|
||||
|
||||
package v2
|
||||
package shim
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package v2
|
||||
package shim
|
||||
|
||||
const optionsType = "io.containerd.runsc.v1.options"
|
||||
|
||||
@@ -11,7 +11,7 @@ go_library(
|
||||
"init.go",
|
||||
"init_state.go",
|
||||
"io.go",
|
||||
"process.go",
|
||||
"proc.go",
|
||||
"types.go",
|
||||
"utils.go",
|
||||
],
|
||||
@@ -39,9 +39,6 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/shim/runsc"
|
||||
)
|
||||
|
||||
// InitPidFile name of the file that contains the init pid.
|
||||
const InitPidFile = "init.pid"
|
||||
|
||||
// Init represents an initial process for a container.
|
||||
type Init struct {
|
||||
wg sync.WaitGroup
|
||||
@@ -122,7 +119,8 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) (err error) {
|
||||
return fmt.Errorf("failed to create OCI runtime io pipes: %w", err)
|
||||
}
|
||||
}
|
||||
pidFile := filepath.Join(p.Bundle, InitPidFile)
|
||||
// pidFile is the file that will contain the sandbox pid.
|
||||
pidFile := filepath.Join(p.Bundle, "init.pid")
|
||||
opts := &runsc.CreateOpts{
|
||||
PidFile: pidFile,
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user