summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-05-05 18:06:46 -0700
committerAdin Scannell <ascannell@google.com>2020-05-19 21:24:22 -0700
commit7f8172edf583e0d26bee5e06578a442c7507ba6f (patch)
tree05060a421333308720ced12c4dd72e95b500999f
parent104a0ad08c8346a17d56287beb9756b8d52f684f (diff)
Restructure shim packages for merging.
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml29
-rw-r--r--CODEOWNERS1
-rw-r--r--CONTRIBUTING.md28
-rw-r--r--LICENSE202
-rw-r--r--Makefile42
-rw-r--r--README.md26
-rw-r--r--cmd/containerd-shim-runsc-v1/main.go24
-rw-r--r--docs/README.md9
-rw-r--r--go.mod35
-rw-r--r--go.sum67
-rw-r--r--pkg/go-runsc/utils.go46
-rw-r--r--pkg/shim/runsc/runsc.go (renamed from pkg/go-runsc/runsc.go)30
-rw-r--r--pkg/shim/runsc/utils.go44
-rw-r--r--pkg/shim/v1/proc/deleted_state.go49
-rw-r--r--pkg/shim/v1/proc/exec.go (renamed from pkg/v1/proc/exec.go)30
-rw-r--r--pkg/shim/v1/proc/exec_state.go (renamed from pkg/v1/proc/exec_state.go)30
-rw-r--r--pkg/shim/v1/proc/init.go (renamed from pkg/v1/proc/init.go)30
-rw-r--r--pkg/shim/v1/proc/init_state.go (renamed from pkg/v1/proc/init_state.go)30
-rw-r--r--pkg/shim/v1/proc/io.go (renamed from pkg/v1/proc/io.go)30
-rw-r--r--pkg/shim/v1/proc/process.go37
-rw-r--r--pkg/shim/v1/proc/types.go (renamed from pkg/v1/proc/types.go)30
-rw-r--r--pkg/shim/v1/proc/utils.go (renamed from pkg/v1/proc/utils.go)30
-rw-r--r--pkg/shim/v1/shim/platform.go (renamed from pkg/v1/shim/platform.go)30
-rw-r--r--pkg/shim/v1/shim/service.go (renamed from pkg/v1/shim/service.go)30
-rw-r--r--pkg/shim/v1/utils/utils.go (renamed from pkg/v1/utils/utils.go)28
-rw-r--r--pkg/shim/v1/utils/volumes.go (renamed from pkg/v1/utils/volumes.go)28
-rw-r--r--pkg/shim/v1/utils/volumes_test.go (renamed from pkg/v1/utils/volumes_test.go)28
-rw-r--r--pkg/shim/v2/epoll.go (renamed from pkg/v2/epoll.go)31
-rw-r--r--pkg/shim/v2/options/options.go (renamed from pkg/v2/options/options.go)27
-rw-r--r--pkg/shim/v2/service.go (renamed from pkg/v2/service.go)31
-rw-r--r--pkg/shim/v2/service_linux.go (renamed from pkg/v2/service_linux.go)29
-rw-r--r--pkg/v1/proc/deleted_state.go54
-rw-r--r--pkg/v1/proc/process.go39
-rw-r--r--shim/README.md16
-rw-r--r--shim/configure-containerd-shim-runsc-v1.md (renamed from docs/configure-containerd-shim-runsc-v1.md)0
-rw-r--r--shim/configure-gvisor-containerd-shim.md (renamed from docs/configure-gvisor-containerd-shim.md)0
-rw-r--r--shim/runtime-handler-quickstart.md (renamed from docs/runtime-handler-quickstart.md)0
-rw-r--r--shim/runtime-handler-shim-v2-quickstart.md (renamed from docs/runtime-handler-shim-v2-quickstart.md)0
-rw-r--r--shim/untrusted-workload-quickstart.md (renamed from docs/untrusted-workload-quickstart.md)0
-rw-r--r--shim/v1/main.go26
-rw-r--r--shim/v2/config.go (renamed from cmd/gvisor-containerd-shim/config.go)28
-rw-r--r--shim/v2/main.go (renamed from cmd/gvisor-containerd-shim/main.go)30
-rwxr-xr-xtest/shim/containerd-install.sh (renamed from test/e2e/containerd-install.sh)0
-rwxr-xr-xtest/shim/crictl-install.sh (renamed from test/e2e/crictl-install.sh)0
-rwxr-xr-xtest/shim/run-container.sh (renamed from test/e2e/run-container.sh)0
-rwxr-xr-xtest/shim/runsc-install.sh (renamed from test/e2e/runsc-install.sh)0
-rwxr-xr-xtest/shim/runtime-handler-shim-v2/install.sh (renamed from test/e2e/runtime-handler-shim-v2/install.sh)0
-rwxr-xr-xtest/shim/runtime-handler-shim-v2/test.sh (renamed from test/e2e/runtime-handler-shim-v2/test.sh)0
-rwxr-xr-xtest/shim/runtime-handler-shim-v2/validate.sh (renamed from test/e2e/runtime-handler-shim-v2/validate.sh)0
-rwxr-xr-xtest/shim/runtime-handler/install.sh (renamed from test/e2e/runtime-handler/install.sh)0
-rwxr-xr-xtest/shim/runtime-handler/test.sh (renamed from test/e2e/runtime-handler/test.sh)0
-rwxr-xr-xtest/shim/runtime-handler/usage.sh (renamed from test/e2e/runtime-handler/usage.sh)0
-rwxr-xr-xtest/shim/runtimeclass-install.sh (renamed from test/e2e/runtimeclass-install.sh)0
-rwxr-xr-xtest/shim/shim-install.sh (renamed from test/e2e/shim-install.sh)0
-rwxr-xr-xtest/shim/untrusted-workload/install.sh (renamed from test/e2e/untrusted-workload/install.sh)0
-rwxr-xr-xtest/shim/untrusted-workload/test.sh (renamed from test/e2e/untrusted-workload/test.sh)0
-rwxr-xr-xtest/shim/untrusted-workload/usage.sh (renamed from test/e2e/untrusted-workload/usage.sh)0
-rwxr-xr-xtest/shim/validate.sh (renamed from test/e2e/validate.sh)0
59 files changed, 434 insertions, 901 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ae3c17260..000000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bin/
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index d9ef5e33f..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-dist: bionic
-sudo: required
-language: go
-go: "1.14.x"
-
-env:
- - CONTAINERD_VERSION=1.1.8 RUNSC_VERSION=release/20200219.0 TEST=untrusted-workload
- - CONTAINERD_VERSION=1.2.13 RUNSC_VERSION=release/20200219.0 TEST=untrusted-workload
- - CONTAINERD_VERSION=1.2.13 RUNSC_VERSION=release/20200219.0 TEST=runtime-handler
- - CONTAINERD_VERSION=1.2.13 RUNSC_VERSION=release/20200219.0 TEST=runtime-handler-shim-v2
- - CONTAINERD_VERSION=1.3.3 RUNSC_VERSION=release/20200219.0 TEST=runtime-handler
- - CONTAINERD_VERSION=1.3.3 RUNSC_VERSION=release/20200219.0 TEST=runtime-handler-shim-v2
-
-go_import_path: github.com/google/gvisor-containerd-shim
-
-addons:
- apt:
- packages:
- - socat
- - conntrack
- - ipset
- - libseccomp-dev
-
-before_install:
- - uname -r
-
-script:
- - make test
- - ./test/e2e/${TEST}/test.sh
diff --git a/CODEOWNERS b/CODEOWNERS
deleted file mode 100644
index 7bf84e6dd..000000000
--- a/CODEOWNERS
+++ /dev/null
@@ -1 +0,0 @@
-* @google/gvisor
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 939e5341e..000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# How to Contribute
-
-We'd love to accept your patches and contributions to this project. There are
-just a few small guidelines you need to follow.
-
-## Contributor License Agreement
-
-Contributions to this project must be accompanied by a Contributor License
-Agreement. You (or your employer) retain the copyright to your contribution;
-this simply gives us permission to use and redistribute your contributions as
-part of the project. Head over to <https://cla.developers.google.com/> to see
-your current agreements on file or to sign a new one.
-
-You generally only need to submit a CLA once, so if you've already submitted one
-(even if it was for a different project), you probably don't need to do it
-again.
-
-## Code reviews
-
-All submissions, including submissions by project members, require review. We
-use GitHub pull requests for this purpose. Consult
-[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
-information on using pull requests.
-
-## Community Guidelines
-
-This project follows [Google's Open Source Community
-Guidelines](https://opensource.google.com/conduct/).
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index abfadc1b5..000000000
--- a/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# Base path used to install.
-DESTDIR=/usr/local
-GC=go
-GO_BUILD_FLAGS=
-GO_TAGS=
-GO_LDFLAGS=-ldflags '-s -w -extldflags "-static"'
-SOURCES=$(shell find cmd/ pkg/ -name '*.go')
-DEPLOY_PATH=cri-containerd-staging/gvisor-containerd-shim
-VERSION=$(shell git rev-parse HEAD)
-GO_MODULE=on
-
-all: binaries
-
-binaries: bin/gvisor-containerd-shim bin/containerd-shim-runsc-v1
-
-bin/gvisor-containerd-shim: $(SOURCES)
- GO111MODULE=${GO_MODULE} CGO_ENABLED=0 ${GC} build ${GO_BUILD_FLAGS} -o bin/gvisor-containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/gvisor-containerd-shim
-
-bin/containerd-shim-runsc-v1: $(SOURCES)
- GO111MODULE=${GO_MODULE} CGO_ENABLED=0 ${GC} build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runsc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runsc-v1
-
-install: bin/gvisor-containerd-shim
- mkdir -p $(DESTDIR)/bin
- install bin/gvisor-containerd-shim $(DESTDIR)/bin
- install bin/containerd-shim-runsc-v1 $(DESTDIR)/bin
-
-uninstall:
- rm -f $(DESTDIR)/bin/gvisor-containerd-shim
- rm -f $(DESTDIR)/bin/containerd-shim-runsc-v1
-
-clean:
- rm -rf bin/*
-
-push: binaries
- gsutil cp ./bin/gvisor-containerd-shim gs://$(DEPLOY_PATH)/gvisor-containerd-shim-$(VERSION)
- gsutil cp ./bin/containerd-shim-runsc-v1 gs://$(DEPLOY_PATH)/containerd-shim-runsc-v1-$(VERSION)
- echo "$(VERSION)" | gsutil cp - "gs://$(DEPLOY_PATH)/latest"
-
-.PHONY: test
-
-test:
- GO111MODULE=${GO_MODULE} CGO_ENABLED=0 ${GC} test -v ./pkg/... ${SHIM_GO_LDFLAGS} ${GO_TAGS}
diff --git a/README.md b/README.md
deleted file mode 100644
index 40a474c4f..000000000
--- a/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# gvisor-containerd-shim
-
-[![Build Status](https://travis-ci.org/google/gvisor-containerd-shim.svg?branch=master)](https://travis-ci.org/google/gvisor-containerd-shim)
-[![Go Report Card](https://goreportcard.com/badge/github.com/google/gvisor-containerd-shim)](https://goreportcard.com/report/github.com/google/gvisor-containerd-shim)
-
-gvisor-containerd-shim is a containerd shim for [gVisor](https://github.com/google/gvisor/). It implements the containerd v1 shim API. It can be used as a drop-in replacement for [containerd-shim](https://github.com/containerd/containerd/tree/master/cmd/containerd-shim) (though containerd-shim must still be installed). It allows the use of both gVisor (runsc) and normal containers in the same containerd installation by deferring to the runc shim if the desired runtime engine is not runsc.
-
-## Requirements
-
-- gvisor (runsc) >= 2018-12-07
-- containerd, containerd-shim >= 1.1
-
-## Installation
-
-- [Untrusted Workload Quick Start (containerd >=1.1)](docs/untrusted-workload-quickstart.md)
-- [Runtime Handler/RuntimeClass Quick Start (containerd >=1.2)](docs/runtime-handler-quickstart.md)
-- [Runtime Handler/RuntimeClass Quick Start (shim v2) (containerd >=1.2)](docs/runtime-handler-shim-v2-quickstart.md)
-
-## Configuration
-
-- [Configure containerd-shim-runsc-v1 (shim v2) (containerd >= 1.3)](docs/configure-containerd-shim-runsc-v1.md)
-- [Configure gvisor-containerd-shim (shim v1) (containerd &lt;= 1.2)](docs/configure-gvisor-containerd-shim.md)
-
-# Contributing
-
-See [CONTRIBUTING.md](CONTRIBUTING.md).
diff --git a/cmd/containerd-shim-runsc-v1/main.go b/cmd/containerd-shim-runsc-v1/main.go
deleted file mode 100644
index ec73edbd2..000000000
--- a/cmd/containerd-shim-runsc-v1/main.go
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- Copyright The containerd Authors.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package main
-
-import (
- "github.com/containerd/containerd/runtime/v2/shim"
-
- runsc "github.com/google/gvisor-containerd-shim/pkg/v2"
-)
-
-func main() {
- shim.Run("io.containerd.runsc.v1", runsc.New)
-}
diff --git a/docs/README.md b/docs/README.md
deleted file mode 100644
index f1091f934..000000000
--- a/docs/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# gvisor-containerd-shim docs
-
-Everything you need to know about gvisor-containerd-shim
-
-- [Untrusted Workload Quick Start (containerd >=1.1)](untrusted-workload-quickstart.md)
-- [Runtime Handler Quick Start (containerd >=1.2)](runtime-handler-quickstart.md)
-- [Runtime Handler Quick Start (shim v2) (containerd >=1.2)](runtime-handler-shim-v2-quickstart.md)
-- [Configure containerd-shim-runsc-v1 (shim v2) (containerd >= 1.3)](configure-containerd-shim-runsc-v1.md)
-- [Configure gvisor-containerd-shim (shim v1) (containerd &lt;= 1.2)](configure-gvisor-containerd-shim.md)
diff --git a/go.mod b/go.mod
deleted file mode 100644
index f15f82998..000000000
--- a/go.mod
+++ /dev/null
@@ -1,35 +0,0 @@
-module github.com/google/gvisor-containerd-shim
-
-go 1.12
-
-require (
- github.com/BurntSushi/toml v0.3.0
- github.com/Microsoft/go-winio v0.4.14 // indirect
- github.com/Microsoft/hcsshim v0.8.6 // indirect
- github.com/containerd/cgroups v0.0.0-20190328223300-4994991857f9
- github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1
- github.com/containerd/containerd v0.0.0-20190510190154-d0319ec44af6
- github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 // indirect
- github.com/containerd/cri v0.0.0-20190308093238-8a0bd84b9a4c
- github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260
- github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3
- github.com/containerd/ttrpc v0.0.0-20190411181408-699c4e40d1e7
- github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd
- github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b // indirect
- github.com/docker/go-units v0.3.1 // indirect
- github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55 // indirect
- github.com/gogo/protobuf v1.0.0
- github.com/golang/protobuf v1.1.0 // indirect
- github.com/google/go-cmp v0.3.1 // indirect
- github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2 // indirect
- github.com/opencontainers/runc v1.0.0-rc8
- github.com/opencontainers/runtime-spec v0.0.0-20180909173843-eba862dc2470
- github.com/pkg/errors v0.8.1
- github.com/sirupsen/logrus v1.4.1
- golang.org/x/net v0.0.0-20170716174642-b3756b4b77d7 // indirect
- golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
- golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b
- google.golang.org/genproto v0.0.0-20170523043604-d80a6e20e776 // indirect
- google.golang.org/grpc v1.12.0
- gotest.tools v2.2.0+incompatible // indirect
-)
diff --git a/go.sum b/go.sum
deleted file mode 100644
index 93f2f1d29..000000000
--- a/go.sum
+++ /dev/null
@@ -1,67 +0,0 @@
-github.com/BurntSushi/toml v0.3.0 h1:e1/Ivsx3Z0FVTV0NSOv/aVgbUWyQuzj7DDnFblkRvsY=
-github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
-github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
-github.com/Microsoft/hcsshim v0.8.6 h1:ZfF0+zZeYdzMIVMZHKtDKJvLHj76XCuVae/jNkjj0IA=
-github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg=
-github.com/containerd/cgroups v0.0.0-20190328223300-4994991857f9 h1:LmZz7ns2YaWWJ6m17esVvIMNOfKcw+f/sCneqxKawB4=
-github.com/containerd/cgroups v0.0.0-20190328223300-4994991857f9/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI=
-github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1 h1:uict5mhHFTzKLUCufdSLym7z/J0CbBJT59lYbP9wtbg=
-github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
-github.com/containerd/containerd v0.0.0-20190510190154-d0319ec44af6 h1:BmZa1bGjKctYrIbyjbhZJlGvHceJASpdW5pIDSQcw1E=
-github.com/containerd/containerd v0.0.0-20190510190154-d0319ec44af6/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
-github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 h1:tN9D97v5A5QuKdcKHKt+UMKrkQ5YXUnD8iM7IAAjEfI=
-github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
-github.com/containerd/cri v0.0.0-20190308093238-8a0bd84b9a4c h1:+bW7GQb2q32/Liy0ZiR6pkpRXdDHShUXRoWg8OGVWZs=
-github.com/containerd/cri v0.0.0-20190308093238-8a0bd84b9a4c/go.mod h1:DavH5Qa8+6jOmeOMO3dhWoqksucZDe06LfuhBz/xPZs=
-github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260 h1:XGyg7oTtD0DoRFhbpV6x1WfV0flKC4UxXU7ab1zC08U=
-github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
-github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3 h1:esQOJREg8nw8aXj6uCN5dfW5cKUBiEJ/+nni1Q/D/sw=
-github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
-github.com/containerd/ttrpc v0.0.0-20190411181408-699c4e40d1e7 h1:SKDlsIhYxNE1LO0xwuOR+3QWj3zRibVQu5jWIMQmOfU=
-github.com/containerd/ttrpc v0.0.0-20190411181408-699c4e40d1e7/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
-github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd h1:JNn81o/xG+8NEo3bC/vx9pbi/g2WI8mtP2/nXzu297Y=
-github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
-github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b h1:+mtZ0WjVZwTX0RVrXMXDwuYVaNeHGvWBW1UwJeMR+2M=
-github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/docker/go-units v0.3.1 h1:QAFdsA6jLCnglbqE6mUsHuPcJlntY94DkxHf4deHKIU=
-github.com/docker/go-units v0.3.1/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
-github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55 h1:oIgNYSrSUbNH5DJh6DMhU1PiOKOYIHNxrV3djLsLpEI=
-github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
-github.com/gogo/protobuf v1.0.0 h1:2jyBKDKU/8v3v2xVR2PtiWQviFUyiaGk2rpfyFT8rTM=
-github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/golang/protobuf v1.1.0 h1:0iH4Ffd/meGoXqF2lSAhZHt8X+cPgkfn/cb6Cce5Vpc=
-github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2 h1:QhPf3A2AZW3tTGvHPg0TA+CR3oHbVLlXUhlghqISp1I=
-github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
-github.com/opencontainers/runc v1.0.0-rc8 h1:dDCFes8Hj1r/i5qnypONo5jdOme/8HWZC/aNDyhECt0=
-github.com/opencontainers/runc v1.0.0-rc8/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
-github.com/opencontainers/runtime-spec v0.0.0-20180909173843-eba862dc2470 h1:dQgS6CgSB2mBQur4Cz7kaEtXNSw56ZlRb7ZsBT70hTA=
-github.com/opencontainers/runtime-spec v0.0.0-20180909173843-eba862dc2470/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
-github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
-github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-golang.org/x/net v0.0.0-20170716174642-b3756b4b77d7 h1:FCqk7JXVeupwwnGVopQCC0a0xRK0Rj7SL5AyjjWo4pk=
-golang.org/x/net v0.0.0-20170716174642-b3756b4b77d7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA=
-golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-google.golang.org/genproto v0.0.0-20170523043604-d80a6e20e776 h1:wVJP1pATLVPNxCz4R2mTO6HUJgfGE0PmIu2E10RuhCw=
-google.golang.org/genproto v0.0.0-20170523043604-d80a6e20e776/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/grpc v1.12.0 h1:Mm8atZtkT+P6R43n/dqNDWkPPu5BwRVu/1rJnJCeZH8=
-google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
-gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
-gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
diff --git a/pkg/go-runsc/utils.go b/pkg/go-runsc/utils.go
deleted file mode 100644
index e4c3c937a..000000000
--- a/pkg/go-runsc/utils.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package runsc
-
-import (
- "bytes"
- "strings"
- "sync"
-)
-
-var bytesBufferPool = sync.Pool{
- New: func() interface{} {
- return bytes.NewBuffer(nil)
- },
-}
-
-func getBuf() *bytes.Buffer {
- return bytesBufferPool.Get().(*bytes.Buffer)
-}
-
-func putBuf(b *bytes.Buffer) {
- b.Reset()
- bytesBufferPool.Put(b)
-}
-
-// FormatLogPath parses runsc config, and fill in %ID% in the log path.
-func FormatLogPath(id string, config map[string]string) {
- if path, ok := config["debug-log"]; ok {
- config["debug-log"] = strings.Replace(path, "%ID%", id, -1)
- }
-}
diff --git a/pkg/go-runsc/runsc.go b/pkg/shim/runsc/runsc.go
index 364ff54bc..41ba9c3af 100644
--- a/pkg/go-runsc/runsc.go
+++ b/pkg/shim/runsc/runsc.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package runsc
diff --git a/pkg/shim/runsc/utils.go b/pkg/shim/runsc/utils.go
new file mode 100644
index 000000000..2732d5e98
--- /dev/null
+++ b/pkg/shim/runsc/utils.go
@@ -0,0 +1,44 @@
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package runsc
+
+import (
+ "bytes"
+ "strings"
+ "sync"
+)
+
+var bytesBufferPool = sync.Pool{
+ New: func() interface{} {
+ return bytes.NewBuffer(nil)
+ },
+}
+
+func getBuf() *bytes.Buffer {
+ return bytesBufferPool.Get().(*bytes.Buffer)
+}
+
+func putBuf(b *bytes.Buffer) {
+ b.Reset()
+ bytesBufferPool.Put(b)
+}
+
+// FormatLogPath parses runsc config, and fill in %ID% in the log path.
+func FormatLogPath(id string, config map[string]string) {
+ if path, ok := config["debug-log"]; ok {
+ config["debug-log"] = strings.Replace(path, "%ID%", id, -1)
+ }
+}
diff --git a/pkg/shim/v1/proc/deleted_state.go b/pkg/shim/v1/proc/deleted_state.go
new file mode 100644
index 000000000..0196c96dd
--- /dev/null
+++ b/pkg/shim/v1/proc/deleted_state.go
@@ -0,0 +1,49 @@
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package proc
+
+import (
+ "context"
+
+ "github.com/containerd/console"
+ "github.com/containerd/containerd/errdefs"
+ "github.com/containerd/containerd/runtime/proc"
+ "github.com/pkg/errors"
+)
+
+type deletedState struct{}
+
+func (*deletedState) Resize(ws console.WinSize) error {
+ return errors.Errorf("cannot resize a deleted process")
+}
+
+func (*deletedState) Start(ctx context.Context) error {
+ return errors.Errorf("cannot start a deleted process")
+}
+
+func (*deletedState) Delete(ctx context.Context) error {
+ return errors.Wrap(errdefs.ErrNotFound, "cannot delete a deleted process")
+}
+
+func (*deletedState) Kill(ctx context.Context, sig uint32, all bool) error {
+ return errors.Wrap(errdefs.ErrNotFound, "cannot kill a deleted process")
+}
+
+func (*deletedState) SetExited(status int) {}
+
+func (*deletedState) Exec(ctx context.Context, path string, r *ExecConfig) (proc.Process, error) {
+ return nil, errors.Errorf("cannot exec in a deleted state")
+}
diff --git a/pkg/v1/proc/exec.go b/pkg/shim/v1/proc/exec.go
index f02b73bb2..17199960e 100644
--- a/pkg/v1/proc/exec.go
+++ b/pkg/shim/v1/proc/exec.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/v1/proc/exec_state.go b/pkg/shim/v1/proc/exec_state.go
index e10954670..5416cb601 100644
--- a/pkg/v1/proc/exec_state.go
+++ b/pkg/shim/v1/proc/exec_state.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/v1/proc/init.go b/pkg/shim/v1/proc/init.go
index 5dbb1daab..fadfc9146 100644
--- a/pkg/v1/proc/init.go
+++ b/pkg/shim/v1/proc/init.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/v1/proc/init_state.go b/pkg/shim/v1/proc/init_state.go
index f56f6fe28..868646b6c 100644
--- a/pkg/v1/proc/init_state.go
+++ b/pkg/shim/v1/proc/init_state.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/v1/proc/io.go b/pkg/shim/v1/proc/io.go
index 4afa94cf2..2677b4e54 100644
--- a/pkg/v1/proc/io.go
+++ b/pkg/shim/v1/proc/io.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/shim/v1/proc/process.go b/pkg/shim/v1/proc/process.go
new file mode 100644
index 000000000..1bfa99f4c
--- /dev/null
+++ b/pkg/shim/v1/proc/process.go
@@ -0,0 +1,37 @@
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package proc
+
+import (
+ "github.com/pkg/errors"
+)
+
+// RunscRoot is the path to the root runsc state directory
+const RunscRoot = "/run/containerd/runsc"
+
+func stateName(v interface{}) string {
+ switch v.(type) {
+ case *runningState, *execRunningState:
+ return "running"
+ case *createdState, *execCreatedState:
+ return "created"
+ case *deletedState:
+ return "deleted"
+ case *stoppedState:
+ return "stopped"
+ }
+ panic(errors.Errorf("invalid state %v", v))
+}
diff --git a/pkg/v1/proc/types.go b/pkg/shim/v1/proc/types.go
index 1d7c8ade3..dcd43bcca 100644
--- a/pkg/v1/proc/types.go
+++ b/pkg/shim/v1/proc/types.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/v1/proc/utils.go b/pkg/shim/v1/proc/utils.go
index e770a6810..84bd702ab 100644
--- a/pkg/v1/proc/utils.go
+++ b/pkg/shim/v1/proc/utils.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package proc
diff --git a/pkg/v1/shim/platform.go b/pkg/shim/v1/shim/platform.go
index 10c54958f..86252c3f5 100644
--- a/pkg/v1/shim/platform.go
+++ b/pkg/shim/v1/shim/platform.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2019 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package shim
diff --git a/pkg/v1/shim/service.go b/pkg/shim/v1/shim/service.go
index e06a5562c..27e915c14 100644
--- a/pkg/v1/shim/service.go
+++ b/pkg/shim/v1/shim/service.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2019 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package shim
diff --git a/pkg/v1/utils/utils.go b/pkg/shim/v1/utils/utils.go
index 83840c047..7a400af1c 100644
--- a/pkg/v1/utils/utils.go
+++ b/pkg/shim/v1/utils/utils.go
@@ -1,18 +1,16 @@
-/*
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package utils
diff --git a/pkg/v1/utils/volumes.go b/pkg/shim/v1/utils/volumes.go
index 61adeaa54..7323e7245 100644
--- a/pkg/v1/utils/volumes.go
+++ b/pkg/shim/v1/utils/volumes.go
@@ -1,18 +1,16 @@
-/*
-Copyright 2019 Google LLC.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package utils
diff --git a/pkg/v1/utils/volumes_test.go b/pkg/shim/v1/utils/volumes_test.go
index 472cd6e86..4b2639545 100644
--- a/pkg/v1/utils/volumes_test.go
+++ b/pkg/shim/v1/utils/volumes_test.go
@@ -1,18 +1,16 @@
-/*
-Copyright 2019 Google LLC.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2019 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package utils
diff --git a/pkg/v2/epoll.go b/pkg/shim/v2/epoll.go
index 76c7b54d6..57a2c5452 100644
--- a/pkg/v2/epoll.go
+++ b/pkg/shim/v2/epoll.go
@@ -1,20 +1,19 @@
-// +build linux
-
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+// +build linux
package v2
diff --git a/pkg/v2/options/options.go b/pkg/shim/v2/options/options.go
index 34b002ac4..de09f2f79 100644
--- a/pkg/v2/options/options.go
+++ b/pkg/shim/v2/options/options.go
@@ -1,18 +1,17 @@
-/*
-Copyright 2018 Google LLC
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
package options
const OptionType = "io.containerd.runsc.v1.options"
diff --git a/pkg/v2/service.go b/pkg/shim/v2/service.go
index f99456f63..3d226e29c 100644
--- a/pkg/v2/service.go
+++ b/pkg/shim/v2/service.go
@@ -1,21 +1,16 @@
-// +build linux
-
-/*
- Copyright The containerd Authors.
- Copyright 2018 Google LLC
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package v2
diff --git a/pkg/v2/service_linux.go b/pkg/shim/v2/service_linux.go
index cbd431537..cd259cd44 100644
--- a/pkg/v2/service_linux.go
+++ b/pkg/shim/v2/service_linux.go
@@ -1,18 +1,19 @@
-/*
- Copyright The containerd Authors.
+// Copyright 2018 The containerd Authors.
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+// +build linux
package v2
diff --git a/pkg/v1/proc/deleted_state.go b/pkg/v1/proc/deleted_state.go
deleted file mode 100644
index b0233841d..000000000
--- a/pkg/v1/proc/deleted_state.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package proc
-
-import (
- "context"
-
- "github.com/containerd/console"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/runtime/proc"
- "github.com/pkg/errors"
-)
-
-type deletedState struct {
-}
-
-func (s *deletedState) Resize(ws console.WinSize) error {
- return errors.Errorf("cannot resize a deleted process")
-}
-
-func (s *deletedState) Start(ctx context.Context) error {
- return errors.Errorf("cannot start a deleted process")
-}
-
-func (s *deletedState) Delete(ctx context.Context) error {
- return errors.Wrap(errdefs.ErrNotFound, "cannot delete a deleted process")
-}
-
-func (s *deletedState) Kill(ctx context.Context, sig uint32, all bool) error {
- return errors.Wrap(errdefs.ErrNotFound, "cannot kill a deleted process")
-}
-
-func (s *deletedState) SetExited(status int) {
- // no op
-}
-
-func (s *deletedState) Exec(ctx context.Context, path string, r *ExecConfig) (proc.Process, error) {
- return nil, errors.Errorf("cannot exec in a deleted state")
-}
diff --git a/pkg/v1/proc/process.go b/pkg/v1/proc/process.go
deleted file mode 100644
index 7dbcd823d..000000000
--- a/pkg/v1/proc/process.go
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package proc
-
-import (
- "github.com/pkg/errors"
-)
-
-// RunscRoot is the path to the root runsc state directory
-const RunscRoot = "/run/containerd/runsc"
-
-func stateName(v interface{}) string {
- switch v.(type) {
- case *runningState, *execRunningState:
- return "running"
- case *createdState, *execCreatedState:
- return "created"
- case *deletedState:
- return "deleted"
- case *stoppedState:
- return "stopped"
- }
- panic(errors.Errorf("invalid state %v", v))
-}
diff --git a/shim/README.md b/shim/README.md
new file mode 100644
index 000000000..e446ec970
--- /dev/null
+++ b/shim/README.md
@@ -0,0 +1,16 @@
+# gvisor-containerd-shim
+
+gvisor-containerd-shim is a containerd shim. It implements the containerd v1
+shim API. It can be used as a drop-in replacement for
+[containerd-shim][containerd-shim]
+(though containerd-shim must still be installed). It allows the use of both
+gVisor (runsc) and normal containers in the same containerd installation by
+deferring to the runc shim if the desired runtime engine is not runsc.
+
+- [Untrusted Workload Quick Start (containerd >=1.1)](docs/untrusted-workload-quickstart.md)
+- [Runtime Handler/RuntimeClass Quick Start (containerd >=1.2)](docs/runtime-handler-quickstart.md)
+- [Runtime Handler/RuntimeClass Quick Start (shim v2) (containerd >=1.2)](docs/runtime-handler-shim-v2-quickstart.md)
+- [Configure containerd-shim-runsc-v1 (shim v2) (containerd >= 1.3)](docs/configure-containerd-shim-runsc-v1.md)
+- [Configure gvisor-containerd-shim (shim v1) (containerd &lt;= 1.2)](docs/configure-gvisor-containerd-shim.md)
+
+[containerd-shim]: https://github.com/containerd/containerd/tree/master/cmd/containerd-shim
diff --git a/docs/configure-containerd-shim-runsc-v1.md b/shim/configure-containerd-shim-runsc-v1.md
index 977ceacbd..977ceacbd 100644
--- a/docs/configure-containerd-shim-runsc-v1.md
+++ b/shim/configure-containerd-shim-runsc-v1.md
diff --git a/docs/configure-gvisor-containerd-shim.md b/shim/configure-gvisor-containerd-shim.md
index 40151da56..40151da56 100644
--- a/docs/configure-gvisor-containerd-shim.md
+++ b/shim/configure-gvisor-containerd-shim.md
diff --git a/docs/runtime-handler-quickstart.md b/shim/runtime-handler-quickstart.md
index 684390b55..684390b55 100644
--- a/docs/runtime-handler-quickstart.md
+++ b/shim/runtime-handler-quickstart.md
diff --git a/docs/runtime-handler-shim-v2-quickstart.md b/shim/runtime-handler-shim-v2-quickstart.md
index ca8336089..ca8336089 100644
--- a/docs/runtime-handler-shim-v2-quickstart.md
+++ b/shim/runtime-handler-shim-v2-quickstart.md
diff --git a/docs/untrusted-workload-quickstart.md b/shim/untrusted-workload-quickstart.md
index fb4441845..fb4441845 100644
--- a/docs/untrusted-workload-quickstart.md
+++ b/shim/untrusted-workload-quickstart.md
diff --git a/shim/v1/main.go b/shim/v1/main.go
new file mode 100644
index 000000000..bdcf4e6d4
--- /dev/null
+++ b/shim/v1/main.go
@@ -0,0 +1,26 @@
+// Copyright 2018 The containerd Authors.
+// Copyright 2019 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package main
+
+import (
+ "github.com/containerd/containerd/runtime/v2/shim"
+
+ runsc "github.com/google/gvisor-containerd-shim/pkg/v2"
+)
+
+func main() {
+ shim.Run("io.containerd.runsc.v1", runsc.New)
+}
diff --git a/cmd/gvisor-containerd-shim/config.go b/shim/v2/config.go
index f03690304..a72cc7754 100644
--- a/cmd/gvisor-containerd-shim/config.go
+++ b/shim/v2/config.go
@@ -1,18 +1,16 @@
-/*
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package main
diff --git a/cmd/gvisor-containerd-shim/main.go b/shim/v2/main.go
index ea26aa105..500bdddee 100644
--- a/cmd/gvisor-containerd-shim/main.go
+++ b/shim/v2/main.go
@@ -1,19 +1,17 @@
-/*
-Copyright The containerd Authors.
-Copyright 2018 Google LLC
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+// Copyright 2018 The containerd Authors.
+// Copyright 2019 The gVisor Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
package main
diff --git a/test/e2e/containerd-install.sh b/test/shim/containerd-install.sh
index 400819245..400819245 100755
--- a/test/e2e/containerd-install.sh
+++ b/test/shim/containerd-install.sh
diff --git a/test/e2e/crictl-install.sh b/test/shim/crictl-install.sh
index 1d63c889b..1d63c889b 100755
--- a/test/e2e/crictl-install.sh
+++ b/test/shim/crictl-install.sh
diff --git a/test/e2e/run-container.sh b/test/shim/run-container.sh
index 4595433c3..4595433c3 100755
--- a/test/e2e/run-container.sh
+++ b/test/shim/run-container.sh
diff --git a/test/e2e/runsc-install.sh b/test/shim/runsc-install.sh
index 420fe01e9..420fe01e9 100755
--- a/test/e2e/runsc-install.sh
+++ b/test/shim/runsc-install.sh
diff --git a/test/e2e/runtime-handler-shim-v2/install.sh b/test/shim/runtime-handler-shim-v2/install.sh
index af6b5be1e..af6b5be1e 100755
--- a/test/e2e/runtime-handler-shim-v2/install.sh
+++ b/test/shim/runtime-handler-shim-v2/install.sh
diff --git a/test/e2e/runtime-handler-shim-v2/test.sh b/test/shim/runtime-handler-shim-v2/test.sh
index e33655ec1..e33655ec1 100755
--- a/test/e2e/runtime-handler-shim-v2/test.sh
+++ b/test/shim/runtime-handler-shim-v2/test.sh
diff --git a/test/e2e/runtime-handler-shim-v2/validate.sh b/test/shim/runtime-handler-shim-v2/validate.sh
index b74a059ef..b74a059ef 100755
--- a/test/e2e/runtime-handler-shim-v2/validate.sh
+++ b/test/shim/runtime-handler-shim-v2/validate.sh
diff --git a/test/e2e/runtime-handler/install.sh b/test/shim/runtime-handler/install.sh
index ebe9d3580..ebe9d3580 100755
--- a/test/e2e/runtime-handler/install.sh
+++ b/test/shim/runtime-handler/install.sh
diff --git a/test/e2e/runtime-handler/test.sh b/test/shim/runtime-handler/test.sh
index 99f3565b6..99f3565b6 100755
--- a/test/e2e/runtime-handler/test.sh
+++ b/test/shim/runtime-handler/test.sh
diff --git a/test/e2e/runtime-handler/usage.sh b/test/shim/runtime-handler/usage.sh
index 350c720c2..350c720c2 100755
--- a/test/e2e/runtime-handler/usage.sh
+++ b/test/shim/runtime-handler/usage.sh
diff --git a/test/e2e/runtimeclass-install.sh b/test/shim/runtimeclass-install.sh
index 28abbcd00..28abbcd00 100755
--- a/test/e2e/runtimeclass-install.sh
+++ b/test/shim/runtimeclass-install.sh
diff --git a/test/e2e/shim-install.sh b/test/shim/shim-install.sh
index f98455d46..f98455d46 100755
--- a/test/e2e/shim-install.sh
+++ b/test/shim/shim-install.sh
diff --git a/test/e2e/untrusted-workload/install.sh b/test/shim/untrusted-workload/install.sh
index c4538aed1..c4538aed1 100755
--- a/test/e2e/untrusted-workload/install.sh
+++ b/test/shim/untrusted-workload/install.sh
diff --git a/test/e2e/untrusted-workload/test.sh b/test/shim/untrusted-workload/test.sh
index 6e312cf6d..6e312cf6d 100755
--- a/test/e2e/untrusted-workload/test.sh
+++ b/test/shim/untrusted-workload/test.sh
diff --git a/test/e2e/untrusted-workload/usage.sh b/test/shim/untrusted-workload/usage.sh
index db8206964..db8206964 100755
--- a/test/e2e/untrusted-workload/usage.sh
+++ b/test/shim/untrusted-workload/usage.sh
diff --git a/test/e2e/validate.sh b/test/shim/validate.sh
index b56b79d2a..b56b79d2a 100755
--- a/test/e2e/validate.sh
+++ b/test/shim/validate.sh