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

Commit

Permalink
vc: Deprecate CC proxy and shim
Browse files Browse the repository at this point in the history
Clear Containers proxy and shim are no longer supported. This
was mentioned in issue #1113. Their functionalities are thus
removed from the runtime.

Fixes #1419

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
  • Loading branch information
gabibeyer authored and Gabi Beyer committed Apr 2, 2019
1 parent f50f74a commit bf2899b
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 1,200 deletions.
4 changes: 2 additions & 2 deletions cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ func newTestRuntimeConfig(dir, consolePath string, create bool) (oci.RuntimeConf
HypervisorType: vc.QemuHypervisor,
HypervisorConfig: hypervisorConfig,
AgentType: vc.KataContainersAgent,
ProxyType: vc.CCProxyType,
ShimType: vc.CCShimType,
ProxyType: vc.KataProxyType,
ShimType: vc.KataShimType,
Console: consolePath,
}, nil
}
Expand Down
12 changes: 2 additions & 10 deletions pkg/katautils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ const (
qemuHypervisorTableType = "qemu"

// supported proxy component types
ccProxyTableType = "cc"
kataProxyTableType = "kata"

// supported shim component types
ccShimTableType = "cc"
kataShimTableType = "kata"

// supported agent component types
Expand Down Expand Up @@ -601,10 +599,7 @@ func updateRuntimeConfigProxy(configPath string, tomlConf tomlConfig, config *oc
}

for k, proxy := range tomlConf.Proxy {
switch k {
case ccProxyTableType:
config.ProxyType = vc.CCProxyType
case kataProxyTableType:
if k == kataProxyTableType {
config.ProxyType = vc.KataProxyType
}

Expand Down Expand Up @@ -653,10 +648,7 @@ func updateRuntimeConfigShim(configPath string, tomlConf tomlConfig, config *oci
}

for k, shim := range tomlConf.Shim {
switch k {
case ccShimTableType:
config.ShimType = vc.CCShimType
case kataShimTableType:
if k == kataShimTableType {
config.ShimType = vc.KataShimType
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/katautils/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func newTestRuntimeConfig(dir, consolePath string, create bool) (oci.RuntimeConf
HypervisorType: vc.QemuHypervisor,
HypervisorConfig: hypervisorConfig,
AgentType: vc.KataContainersAgent,
ProxyType: vc.CCProxyType,
ShimType: vc.CCShimType,
ProxyType: vc.KataProxyType,
ShimType: vc.KataShimType,
Console: consolePath,
}, nil
}
Expand Down
11 changes: 1 addition & 10 deletions virtcontainers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ VC_BIN_DIR := $(BIN_DIR)/virtcontainers/bin
TEST_BIN_DIR := $(VC_BIN_DIR)/test
HOOK_DIR := hook/mock
HOOK_BIN := hook
CC_SHIM_DIR := shim/mock/cc-shim
CC_SHIM_BIN := cc-shim
KATA_SHIM_DIR := shim/mock/kata-shim
KATA_SHIM_BIN := kata-shim
MK_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
Expand All @@ -36,13 +34,10 @@ build:
hook:
$(QUIET_GOBUILD)go build -o $(HOOK_DIR)/$@ $(HOOK_DIR)/*.go

cc-shim:
$(QUIET_GOBUILD)go build -o $(CC_SHIM_DIR)/$@ $(CC_SHIM_DIR)/*.go

kata-shim:
$(QUIET_GOBUILD)go build -o $(KATA_SHIM_DIR)/$@ $(KATA_SHIM_DIR)/*.go

binaries: hook cc-shim kata-shim
binaries: hook kata-shim

#
# Tests
Expand All @@ -55,7 +50,6 @@ check-go-static:

check-go-test:
bash $(MK_DIR)/../.ci/go-test.sh \
$(TEST_BIN_DIR)/$(CC_SHIM_BIN) \
$(TEST_BIN_DIR)/$(KATA_SHIM_BIN) \
$(TEST_BIN_DIR)/$(HOOK_BIN)

Expand All @@ -75,7 +69,6 @@ install:
@mkdir -p $(VC_BIN_DIR)
@mkdir -p $(TEST_BIN_DIR)
$(call INSTALL_TEST_EXEC,$(HOOK_DIR)/$(HOOK_BIN))
$(call INSTALL_TEST_EXEC,$(CC_SHIM_DIR)/$(CC_SHIM_BIN))
$(call INSTALL_TEST_EXEC,$(KATA_SHIM_DIR)/$(KATA_SHIM_BIN))

#
Expand All @@ -92,7 +85,6 @@ endef

uninstall:
$(call UNINSTALL_TEST_EXEC,$(HOOK_BIN))
$(call UNINSTALL_TEST_EXEC,$(CC_SHIM_BIN))
$(call UNINSTALL_TEST_EXEC,$(KATA_SHIM_BIN))

#
Expand All @@ -106,7 +98,6 @@ $(shell test -e "$(1)" && test "$(1)" != "/" && echo "$(1)")
endef

CLEAN_FILES += $(HOOK_DIR)/$(HOOK_BIN)
CLEAN_FILES += $(SHIM_DIR)/$(CC_SHIM_BIN)
CLEAN_FILES += $(SHIM_DIR)/$(KATA_SHIM_BIN)

clean:
Expand Down
110 changes: 0 additions & 110 deletions virtcontainers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ package virtcontainers
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"syscall"
"testing"
Expand Down Expand Up @@ -133,18 +131,6 @@ func TestCreateSandboxNoopAgentSuccessful(t *testing.T) {
}
}

var testCCProxySockPathTempl = "%s/cc-proxy-test.sock"
var testCCProxyURLUnixScheme = "unix://"

func testGenerateCCProxySockDir() (string, error) {
dir, err := ioutil.TempDir("", "cc-proxy-test")
if err != nil {
return "", err
}

return dir, nil
}

func TestCreateSandboxKataAgentSuccessful(t *testing.T) {
if os.Geteuid() != 0 {
t.Skip(testDisabledAsNonRoot)
Expand Down Expand Up @@ -1581,42 +1567,6 @@ func createNewSandboxConfig(hType HypervisorType, aType AgentType, aConfig inter
}
}

func createNewContainerConfigs(numOfContainers int) []ContainerConfig {
var contConfigs []ContainerConfig

envs := []types.EnvVar{
{
Var: "PATH",
Value: "/bin:/usr/bin:/sbin:/usr/sbin",
},
}

cmd := types.Cmd{
Args: strings.Split("/bin/ps -A", " "),
Envs: envs,
WorkDir: "/",
}

_, thisFile, _, ok := runtime.Caller(0)
if ok == false {
return nil
}

rootFs := RootFs{Target: filepath.Dir(thisFile) + "/utils/supportfiles/bundles/busybox/", Mounted: true}

for i := 0; i < numOfContainers; i++ {
contConfig := ContainerConfig{
ID: fmt.Sprintf("%d", i),
RootFs: rootFs,
Cmd: cmd,
}

contConfigs = append(contConfigs, contConfig)
}

return contConfigs
}

// createAndStartSandbox handles the common test operation of creating and
// starting a sandbox.
func createAndStartSandbox(ctx context.Context, config SandboxConfig) (sandbox VCSandbox, sandboxDir string,
Expand Down Expand Up @@ -1664,66 +1614,6 @@ func createStartStopDeleteSandbox(b *testing.B, sandboxConfig SandboxConfig) {
}
}

func createStartStopDeleteContainers(b *testing.B, sandboxConfig SandboxConfig, contConfigs []ContainerConfig) {
ctx := context.Background()

// Create sandbox
p, err := CreateSandbox(ctx, sandboxConfig, nil)
if err != nil {
b.Fatalf("Could not create sandbox: %s", err)
}

// Start sandbox
_, err = StartSandbox(ctx, p.ID())
if err != nil {
b.Fatalf("Could not start sandbox: %s", err)
}

// Create containers
for _, contConfig := range contConfigs {
_, _, err := CreateContainer(ctx, p.ID(), contConfig)
if err != nil {
b.Fatalf("Could not create container %s: %s", contConfig.ID, err)
}
}

// Start containers
for _, contConfig := range contConfigs {
_, err := StartContainer(ctx, p.ID(), contConfig.ID)
if err != nil {
b.Fatalf("Could not start container %s: %s", contConfig.ID, err)
}
}

// Stop containers
for _, contConfig := range contConfigs {
_, err := StopContainer(ctx, p.ID(), contConfig.ID)
if err != nil {
b.Fatalf("Could not stop container %s: %s", contConfig.ID, err)
}
}

// Delete containers
for _, contConfig := range contConfigs {
_, err := DeleteContainer(ctx, p.ID(), contConfig.ID)
if err != nil {
b.Fatalf("Could not delete container %s: %s", contConfig.ID, err)
}
}

// Stop sandbox
_, err = StopSandbox(ctx, p.ID())
if err != nil {
b.Fatalf("Could not stop sandbox: %s", err)
}

// Delete sandbox
_, err = DeleteSandbox(ctx, p.ID())
if err != nil {
b.Fatalf("Could not delete sandbox: %s", err)
}
}

func BenchmarkCreateStartStopDeleteSandboxQemuHypervisorNoopAgentNetworkNoop(b *testing.B) {
for i := 0; i < b.N; i++ {
sandboxConfig := createNewSandboxConfig(QemuHypervisor, NoopAgentType, nil)
Expand Down
47 changes: 0 additions & 47 deletions virtcontainers/cc_proxy.go

This file was deleted.

28 changes: 0 additions & 28 deletions virtcontainers/cc_proxy_test.go

This file was deleted.

49 changes: 0 additions & 49 deletions virtcontainers/cc_shim.go

This file was deleted.

Loading

0 comments on commit bf2899b

Please sign in to comment.