From 05bcc3e88c33ca7b4f60c2e916d88b1e854d6f4e Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Mon, 5 Mar 2018 19:14:14 +0000 Subject: [PATCH] Update makefile and all integration test Signed-off-by: Lantao Liu --- .travis.yml | 16 ++-------- Makefile | 46 ++++++++++++++--------------- hack/install-deps.sh | 5 ++-- hack/release.sh | 18 ++++++++--- hack/test-cri.sh | 2 +- hack/test-e2e-node.sh | 2 +- hack/test-integration.sh | 12 ++------ hack/test-utils.sh | 45 ++++++---------------------- integration/container_stats_test.go | 1 - integration/test_utils.go | 9 +++--- 10 files changed, 59 insertions(+), 97 deletions(-) diff --git a/.travis.yml b/.travis.yml index 15e1479e6..9acfce780 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,27 +35,15 @@ jobs: - make install.tools - make .gitvalidation - make binaries - - make containerd go: "1.10" - stage: Test script: - make install.deps + - make containerd + - sudo make install-containerd - make test - make test-integration - make test-cri - after_script: - # Abuse travis to preserve the log. - - cat /tmp/test-integration/cri-containerd.log - - cat /tmp/test-integration/containerd.log - - cat /tmp/test-cri/cri-containerd.log - - cat /tmp/test-cri/containerd.log - go: "1.10" - - script: - - make install.deps - - make containerd - - sudo make install-containerd - - make test-integration STANDALONE_CRI_CONTAINERD=false - - make test-cri STANDALONE_CRI_CONTAINERD=false after_script: # Abuse travis to preserve the log. - cat /tmp/test-integration/containerd.log diff --git a/Makefile b/Makefile index 8b1f75eb1..2da939e8f 100644 --- a/Makefile +++ b/Makefile @@ -41,12 +41,14 @@ help: @echo "Usage: make " @echo @echo " * 'install' - Install binaries to system locations" - @echo " * 'binaries' - Build cri-containerd and ctrcri" - @echo " * 'static-binaries - Build static cri-containerd and ctrcri" + @echo " * 'binaries' - Build containerd and ctrcri" + @echo " * 'static-binaries - Build static containerd and ctrcri" + @echo " * 'ctrcri' - Build ctrcri" + @echo " * 'install-ctrcri' - Install ctrcri" + @echo " * 'containerd' - Build a customized containerd with CRI plugin for testing" + @echo " * 'install-containerd' - Install customized containerd to system location" @echo " * 'release' - Build release tarball" @echo " * 'push' - Push release tarball to GCS" - @echo " * 'containerd' - Build a customized containerd with CRI plugin for testing" - @echo " * 'install-containerd' - Install customized containerd to system location" @echo " * 'test' - Test cri-containerd with unit test" @echo " * 'test-integration' - Test cri-containerd with integration test" @echo " * 'test-cri' - Test cri-containerd with cri validation test" @@ -89,13 +91,6 @@ sync-vendor: update-vendor: sync-vendor sort-vendor -$(BUILD_DIR)/cri-containerd: $(SOURCES) - $(GO) build -o $@ \ - -tags '$(BUILD_TAGS)' \ - -ldflags '$(GO_LDFLAGS)' \ - -gcflags '$(GO_GCFLAGS)' \ - $(PROJECT)/cmd/cri-containerd - $(BUILD_DIR)/ctrcri: $(SOURCES) $(GO) build -o $@ \ -tags '$(BUILD_TAGS)' \ @@ -131,17 +126,25 @@ test-e2e-node: binaries clean: rm -rf $(BUILD_DIR)/* -binaries: $(BUILD_DIR)/cri-containerd $(BUILD_DIR)/ctrcri +binaries: $(BUILD_DIR)/containerd $(BUILD_DIR)/ctrcri static-binaries: GO_LDFLAGS += -extldflags "-fno-PIC -static" -static-binaries: $(BUILD_DIR)/cri-containerd $(BUILD_DIR)/ctrcri +static-binaries: $(BUILD_DIR)/containerd $(BUILD_DIR)/ctrcri -install: binaries - install -D -m 755 $(BUILD_DIR)/cri-containerd $(BINDIR)/cri-containerd +ctrcri: $(BUILD_DIR)/ctrcri + +install-ctrcri: ctrcri install -D -m 755 $(BUILD_DIR)/ctrcri $(BINDIR)/ctrcri +containerd: $(BUILD_DIR)/containerd + +install-containerd: containerd + install -D -m 755 $(BUILD_DIR)/containerd $(BINDIR)/containerd + +install: install-ctrcri install-containerd + uninstall: - rm -f $(BINDIR)/cri-containerd + rm -f $(BINDIR)/containerd rm -f $(BINDIR)/ctrcri $(BUILD_DIR)/$(TARBALL): static-binaries vendor.conf @@ -152,11 +155,6 @@ release: $(BUILD_DIR)/$(TARBALL) push: $(BUILD_DIR)/$(TARBALL) @BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/push.sh -containerd: $(BUILD_DIR)/containerd - -install-containerd: containerd - install -D -m 755 $(BUILD_DIR)/containerd $(BINDIR)/containerd - proto: @hack/update-proto.sh @@ -189,6 +187,10 @@ install.tools: .install.gitvalidation .install.gometalinter .PHONY: \ binaries \ static-binaries \ + ctrcri \ + install-ctrcri \ + containerd \ + install-containerd \ release \ push \ boiler \ @@ -198,8 +200,6 @@ install.tools: .install.gitvalidation .install.gometalinter help \ install \ lint \ - containerd \ - install-containerd \ test \ test-integration \ test-cri \ diff --git a/hack/install-deps.sh b/hack/install-deps.sh index 803d95701..76a73665f 100755 --- a/hack/install-deps.sh +++ b/hack/install-deps.sh @@ -133,8 +133,7 @@ fi # Install containerd checkout_repo ${CONTAINERD_PKG} ${CONTAINERD_VERSION} ${CONTAINERD_REPO} cd ${GOPATH}/src/${CONTAINERD_PKG} -# Build no_cri version and run standalone cri-containerd. -make BUILDTAGS="${BUILDTAGS} no_cri" +make BUILDTAGS="${BUILDTAGS}" # containerd make install requires `go` to work. Explicitly # set PATH to make sure it can find `go` even with `sudo`. ${sudo} sh -c "PATH=${PATH} make install -e DESTDIR=${CONTAINERD_DIR}" @@ -146,7 +145,7 @@ make crictl ${sudo} make install-crictl -e BINDIR=${CRICTL_DIR} GOPATH=${GOPATH} ${sudo} mkdir -p ${CRICTL_CONFIG_DIR} ${sudo} bash -c 'cat >'${CRICTL_CONFIG_DIR}'/crictl.yaml <