Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Implement containerd shim v2 API for Kata Containers #572

Merged
merged 22 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f0cb0c7
cli: refactor to align with katautils package
lifupan Nov 9, 2018
5e6cd00
containerd-shim-v2: add the shim v2 required vendors
lifupan Aug 7, 2018
d6c4ca5
container-shim-kata-v2: The init containerd shim v2 support
lifupan Aug 8, 2018
72fd6e0
containerd-shim-kata-v2: add the create service support
lifupan Nov 19, 2018
4c5b296
containerd-shim-kata-v2: add the start service support
lifupan Nov 19, 2018
269c940
containerd-shim-kata-v2: add the exec service support
lifupan Nov 19, 2018
fbaefc9
containerd-shim-kata-v2: add the service wait support
lifupan Nov 19, 2018
fd18b22
containerd-shim-kata-v2: add the service State support
lifupan Nov 19, 2018
a0e6456
containerd-shim-kata-v2: add the service Delete support
lifupan Nov 19, 2018
709bc9a
containerd-shim-kata-v2: add the service Cleanup support
lifupan Nov 19, 2018
8c95b75
containerd-shim-kata-v2: add the service Pids support
lifupan Nov 19, 2018
ec4f27b
containerd-shim-kata-v2: add the service CloseIO support
lifupan Nov 19, 2018
87f591a
containerd-shim-kata-v2: add the service Connect support
lifupan Nov 19, 2018
642231b
containerd-shim-kata-v2: add the service Shutdown support
lifupan Nov 19, 2018
47326f5
containerd-shim-kata-v2: add the service Update support
lifupan Nov 19, 2018
cd321a3
containerd-shim-kata-v2: add the service ResizePty support
ZeroMagic Aug 9, 2018
8df33d3
containerd-shim-kata-v2: add the service Pause support
ZeroMagic Aug 9, 2018
9ee53be
containerd-shim-kata-v2: add the service Resume support
ZeroMagic Aug 9, 2018
5cc016c
containerd-shim-kata-v2: add the service Kill support
ZeroMagic Aug 9, 2018
7951041
containerd-shim-kata-v2: add the service Stats support
ZeroMagic Aug 9, 2018
8199d10
containerd-shim-kata: add unit test cases
lifupan Sep 19, 2018
02f8b29
containerd-shim-kata-v2: add building of shimv2 into Makefile
lifupan Nov 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
114 changes: 113 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
name = "github.com/safchain/ethtool"
revision = "79559b488d8848b53a8e34c330140c3fc37ee246"

[[constraint]]
name = "github.com/containerd/containerd"
revision = "29eab28b8e4e18231b6b2f077ab653c719d25dd5"

[[override]]
branch = "master"
name = "github.com/hashicorp/yamux"
Expand Down
23 changes: 17 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ DEFHOTPLUGVFIOONROOTBUS := false
SED = sed

CLI_DIR = cli
SHIMV2 = containerd-shim-kata-v2
SHIMV2_OUTPUT = $(CURDIR)/$(SHIMV2)
SHIMV2_DIR = $(CLI_DIR)/$(SHIMV2)

SOURCES := $(shell find . 2>&1 | grep -E '.*\.(c|h|go)$$')
VERSION := ${shell cat ./VERSION}
COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
Expand Down Expand Up @@ -256,7 +260,9 @@ define SHOW_ARCH
$(shell printf "\\t%s%s\\\n" "$(1)" $(if $(filter $(ARCH),$(1))," (default)",""))
endef

all: runtime netmon
all: runtime containerd-shim-v2 netmon

containerd-shim-v2: $(SHIMV2_OUTPUT)

netmon: $(NETMON_TARGET_OUTPUT)

Expand Down Expand Up @@ -288,9 +294,6 @@ const project = "$(PROJECT_NAME)"
// prefix used to denote non-standard CLI commands and options.
const projectPrefix = "$(PROJECT_TYPE)"

// systemdUnitName is the systemd(1) target used to launch the agent.
const systemdUnitName = "$(PROJECT_TAG).target"

// original URL for this project
const projectURL = "$(PROJECT_URL)"

Expand Down Expand Up @@ -338,6 +341,9 @@ $(GENERATED_CONFIG): Makefile VERSION
$(TARGET_OUTPUT): $(EXTRA_DEPS) $(SOURCES) $(GENERATED_GO_FILES) $(GENERATED_FILES) Makefile | show-summary
$(QUIET_BUILD)(cd $(CLI_DIR) && go build $(BUILDFLAGS) -o $@ .)

$(SHIMV2_OUTPUT): $(TARGET_OUTPUT)
$(QUIET_BUILD)(cd $(SHIMV2_DIR)/ && go build -i -o $@ .)

.PHONY: \
check \
check-go-static \
Expand Down Expand Up @@ -416,11 +422,14 @@ check-go-static:
coverage:
$(QUIET_TEST).ci/go-test.sh html-coverage

install: default runtime install-scripts install-completions install-config install-bin install-bin-libexec
install: default runtime install-scripts install-completions install-config install-bin install-containerd-shim-v2 install-bin-libexec

install-bin: $(BINLIST)
$(foreach f,$(BINLIST),$(call INSTALL_EXEC,$f,$(BINDIR)))

install-containerd-shim-v2: $(SHIMV2)
$(call INSTALL_EXEC,$<,$(BINDIR))

install-bin-libexec: $(BINLIBEXECLIST)
$(foreach f,$(BINLIBEXECLIST),$(call INSTALL_EXEC,$f,$(PKGLIBEXECDIR)))

Expand All @@ -434,7 +443,7 @@ install-completions:
$(QUIET_INST)install --mode 0644 -D $(BASH_COMPLETIONS) $(DESTDIR)/$(BASH_COMPLETIONSDIR)/$(notdir $(BASH_COMPLETIONS));

clean:
$(QUIET_CLEAN)rm -f $(TARGET) $(NETMON_TARGET) $(CONFIG) $(GENERATED_GO_FILES) $(GENERATED_FILES) $(COLLECT_SCRIPT)
$(QUIET_CLEAN)rm -f $(TARGET) $(SHIMV2) $(NETMON_TARGET) $(CONFIG) $(GENERATED_GO_FILES) $(GENERATED_FILES) $(COLLECT_SCRIPT)

show-usage: show-header
@printf "• Overview:\n"
Expand Down Expand Up @@ -497,6 +506,8 @@ show-summary: show-header
@printf "\tbinaries to install :\n"
@printf \
"$(foreach b,$(sort $(BINLIST)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(BINDIR)/$(b))\\\n"))"
@printf \
"$(foreach b,$(sort $(SHIMV2)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(BINDIR)/$(b))\\\n"))"
@printf \
"$(foreach b,$(sort $(BINLIBEXECLIST)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(PKGLIBEXECDIR)/$(b))\\\n"))"
@printf \
Expand Down
15 changes: 15 additions & 0 deletions cli/containerd-shim-kata-v2/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2018 HyperHQ Inc.
//
// SPDX-License-Identifier: Apache-2.0
//

package main

import (
"github.com/containerd/containerd/runtime/v2/shim"
"github.com/kata-containers/runtime/containerd-shim-v2"
)

func main() {
shim.Run("io.containerd.kata.v2", containerdshim.New)
}
Loading