synching up a bit with containerd Makefile
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
parent
bb020275cb
commit
00b18fd728
108
Makefile
108
Makefile
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2017 The Kubernetes Authors.
|
# Copyright 2018 The containerd Authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (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 not use this file except in compliance with the License.
|
||||||
@ -15,6 +15,8 @@
|
|||||||
GO := go
|
GO := go
|
||||||
GOOS := $(shell $(GO) env GOOS)
|
GOOS := $(shell $(GO) env GOOS)
|
||||||
GOARCH := $(shell $(GO) env GOARCH)
|
GOARCH := $(shell $(GO) env GOARCH)
|
||||||
|
WHALE = "+"
|
||||||
|
ONI = "-"
|
||||||
EPOCH_TEST_COMMIT := f9e02affccd51702191e5312665a16045ffef8ab
|
EPOCH_TEST_COMMIT := f9e02affccd51702191e5312665a16045ffef8ab
|
||||||
PROJECT := github.com/containerd/cri
|
PROJECT := github.com/containerd/cri
|
||||||
BINDIR := ${DESTDIR}/usr/local/bin
|
BINDIR := ${DESTDIR}/usr/local/bin
|
||||||
@ -33,128 +35,124 @@ INTEGRATION_SOURCES := $(shell find integration/ -name '*.go')
|
|||||||
|
|
||||||
all: binaries
|
all: binaries
|
||||||
|
|
||||||
default: help
|
help: ## this help
|
||||||
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9._-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
|
||||||
|
|
||||||
help:
|
verify: lint gofmt boiler check-vendor ## execute the source code verification tools
|
||||||
@echo "Usage: make <target>"
|
|
||||||
@echo
|
|
||||||
@echo " * 'install' - Install binaries to system locations"
|
|
||||||
@echo " * 'binaries' - Build containerd"
|
|
||||||
@echo " * 'static-binaries - Build static containerd"
|
|
||||||
@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 " * 'test' - Test cri with unit test"
|
|
||||||
@echo " * 'test-integration' - Test cri with integration test"
|
|
||||||
@echo " * 'test-cri' - Test cri with cri validation test"
|
|
||||||
@echo " * 'test-e2e-node' - Test cri with Kubernetes node e2e test"
|
|
||||||
@echo " * 'clean' - Clean artifacts"
|
|
||||||
@echo " * 'verify' - Execute the source code verification tools"
|
|
||||||
@echo " * 'proto' - Update protobuf of the cri plugin api"
|
|
||||||
@echo " * 'install.tools' - Install tools used by verify"
|
|
||||||
@echo " * 'install.deps' - Install dependencies of cri (Note: BUILDTAGS defaults to 'seccomp apparmor' for runc build)"
|
|
||||||
@echo " * 'uninstall' - Remove installed binaries from system locations"
|
|
||||||
@echo " * 'version' - Print current cri plugin release version"
|
|
||||||
@echo " * 'update-vendor' - Syncs containerd/vendor.conf -> vendor.conf and sorts vendor.conf"
|
|
||||||
|
|
||||||
verify: lint gofmt boiler check-vendor
|
version: ## print current cri plugin release version
|
||||||
|
|
||||||
version:
|
|
||||||
@echo $(VERSION)
|
@echo $(VERSION)
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@echo "checking lint"
|
@echo "$(WHALE) $@"
|
||||||
@./hack/verify-lint.sh
|
@./hack/verify-lint.sh
|
||||||
|
|
||||||
gofmt:
|
gofmt:
|
||||||
@echo "checking gofmt"
|
@echo "$(WHALE) $@"
|
||||||
@./hack/verify-gofmt.sh
|
@./hack/verify-gofmt.sh
|
||||||
|
|
||||||
boiler:
|
boiler:
|
||||||
@echo "checking boilerplate"
|
@echo "$(WHALE) $@"
|
||||||
@./hack/verify-boilerplate.sh
|
@./hack/verify-boilerplate.sh
|
||||||
|
|
||||||
check-vendor:
|
check-vendor:
|
||||||
@echo "detecting dirty vendor"
|
@echo "$(WHALE) $@"
|
||||||
@./hack/verify-vendor.sh
|
@./hack/verify-vendor.sh
|
||||||
|
|
||||||
.PHONY: sort-vendor sync-vendor update-vendor
|
.PHONY: sort-vendor sync-vendor update-vendor
|
||||||
|
|
||||||
sort-vendor:
|
sort-vendor:
|
||||||
@echo "sorting vendor.conf"
|
@echo "$(WHALE) $@"
|
||||||
@./hack/sort-vendor.sh
|
@./hack/sort-vendor.sh
|
||||||
|
|
||||||
sync-vendor:
|
sync-vendor:
|
||||||
@echo "syncing vendor.conf from containerd"
|
@echo "$(WHALE) $@ from containerd"
|
||||||
@./hack/sync-vendor.sh
|
@./hack/sync-vendor.sh
|
||||||
|
|
||||||
update-vendor: sync-vendor sort-vendor
|
update-vendor: sync-vendor sort-vendor ## Syncs containerd/vendor.conf -> vendor.conf and sorts vendor.conf
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
|
||||||
$(BUILD_DIR)/containerd: $(SOURCES) $(PLUGIN_SOURCES)
|
$(BUILD_DIR)/containerd: $(SOURCES) $(PLUGIN_SOURCES)
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
$(GO) build -o $@ \
|
$(GO) build -o $@ \
|
||||||
-tags '$(BUILD_TAGS)' \
|
-tags '$(BUILD_TAGS)' \
|
||||||
-ldflags '$(GO_LDFLAGS)' \
|
-ldflags '$(GO_LDFLAGS)' \
|
||||||
-gcflags '$(GO_GCFLAGS)' \
|
-gcflags '$(GO_GCFLAGS)' \
|
||||||
$(PROJECT)/cmd/containerd
|
$(PROJECT)/cmd/containerd
|
||||||
|
|
||||||
test:
|
test: ## unit test
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
$(GO) test -timeout=10m -race ./pkg/... \
|
$(GO) test -timeout=10m -race ./pkg/... \
|
||||||
-tags '$(BUILD_TAGS)' \
|
-tags '$(BUILD_TAGS)' \
|
||||||
-ldflags '$(GO_LDFLAGS)' \
|
-ldflags '$(GO_LDFLAGS)' \
|
||||||
-gcflags '$(GO_GCFLAGS)'
|
-gcflags '$(GO_GCFLAGS)'
|
||||||
|
|
||||||
$(BUILD_DIR)/integration.test: $(INTEGRATION_SOURCES)
|
$(BUILD_DIR)/integration.test: $(INTEGRATION_SOURCES)
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
$(GO) test -c $(PROJECT)/integration -o $(BUILD_DIR)/integration.test
|
$(GO) test -c $(PROJECT)/integration -o $(BUILD_DIR)/integration.test
|
||||||
|
|
||||||
test-integration: $(BUILD_DIR)/integration.test binaries
|
test-integration: $(BUILD_DIR)/integration.test binaries ## integration test
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
@./hack/test-integration.sh
|
@./hack/test-integration.sh
|
||||||
|
|
||||||
test-cri: binaries
|
test-cri: binaries ## critools CRI validation test
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
@./hack/test-cri.sh
|
@./hack/test-cri.sh
|
||||||
|
|
||||||
test-e2e-node: binaries
|
test-e2e-node: binaries ## e2e node test
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
@VERSION=$(VERSION) ./hack/test-e2e-node.sh
|
@VERSION=$(VERSION) ./hack/test-e2e-node.sh
|
||||||
|
|
||||||
clean:
|
clean: ## cleanup binaries
|
||||||
rm -rf $(BUILD_DIR)/*
|
@echo "$(WHALE) $@"
|
||||||
|
@rm -rf $(BUILD_DIR)/*
|
||||||
|
|
||||||
binaries: $(BUILD_DIR)/containerd
|
binaries: $(BUILD_DIR)/containerd ## build a customized containerd (same result as make containerd)
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
|
||||||
static-binaries: GO_LDFLAGS += -extldflags "-fno-PIC -static"
|
static-binaries: GO_LDFLAGS += -extldflags "-fno-PIC -static"
|
||||||
static-binaries: $(BUILD_DIR)/containerd
|
static-binaries: $(BUILD_DIR)/containerd ## build static containerd
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
|
||||||
containerd: $(BUILD_DIR)/containerd
|
containerd: $(BUILD_DIR)/containerd ## build a customized containerd with CRI plugin for testing
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
|
||||||
install-containerd: containerd
|
install-containerd: containerd ## installs customized containerd to system location
|
||||||
install -D -m 755 $(BUILD_DIR)/containerd $(BINDIR)/containerd
|
@echo "$(WHALE) $@"
|
||||||
|
@install -D -m 755 $(BUILD_DIR)/containerd $(BINDIR)/containerd
|
||||||
|
|
||||||
install: install-containerd
|
install: install-containerd ## installs customized containerd to system location
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
|
||||||
uninstall:
|
uninstall: ## remove containerd from system location
|
||||||
rm -f $(BINDIR)/containerd
|
@echo "$(WHALE) $@"
|
||||||
|
@rm -f $(BINDIR)/containerd
|
||||||
|
|
||||||
$(BUILD_DIR)/$(TARBALL): static-binaries vendor.conf
|
$(BUILD_DIR)/$(TARBALL): static-binaries vendor.conf
|
||||||
@BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/release.sh
|
@BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/release.sh
|
||||||
|
|
||||||
release: $(BUILD_DIR)/$(TARBALL)
|
release: $(BUILD_DIR)/$(TARBALL) ## build release tarball
|
||||||
|
|
||||||
push: $(BUILD_DIR)/$(TARBALL)
|
push: $(BUILD_DIR)/$(TARBALL) ## push release tarball to GCS
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
@BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/push.sh
|
@BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/push.sh
|
||||||
|
|
||||||
proto:
|
proto: ## update protobuf of the cri plugin api
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
@API_PATH=pkg/api/v1 hack/update-proto.sh
|
@API_PATH=pkg/api/v1 hack/update-proto.sh
|
||||||
@API_PATH=pkg/api/runtimeoptions/v1 hack/update-proto.sh
|
@API_PATH=pkg/api/runtimeoptions/v1 hack/update-proto.sh
|
||||||
|
|
||||||
.PHONY: install.deps
|
.PHONY: install.deps
|
||||||
|
|
||||||
install.deps:
|
install.deps: ## install dependencies of cri (default 'seccomp apparmor' BUILDTAGS for runc build)
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
@./hack/install/install-deps.sh
|
@./hack/install/install-deps.sh
|
||||||
|
|
||||||
.PHONY: .gitvalidation
|
.PHONY: .gitvalidation
|
||||||
# When this is running in travis, it will only check the travis commit range.
|
# When this is running in travis, it will only check the travis commit range.
|
||||||
# When running outside travis, it will check from $(EPOCH_TEST_COMMIT)..HEAD.
|
# When running outside travis, it will check from $(EPOCH_TEST_COMMIT)..HEAD.
|
||||||
.gitvalidation:
|
.gitvalidation:
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
ifeq ($(TRAVIS),true)
|
ifeq ($(TRAVIS),true)
|
||||||
git-validation -q -run DCO,short-subject
|
git-validation -q -run DCO,short-subject
|
||||||
else
|
else
|
||||||
@ -163,16 +161,20 @@ endif
|
|||||||
|
|
||||||
.PHONY: install.tools .install.gitvalidation .install.gometalinter .install.vndr
|
.PHONY: install.tools .install.gitvalidation .install.gometalinter .install.vndr
|
||||||
|
|
||||||
install.tools: .install.gitvalidation .install.gometalinter .install.vndr
|
install.tools: .install.gitvalidation .install.gometalinter .install.vndr ## install tools used by verify
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
|
||||||
.install.gitvalidation:
|
.install.gitvalidation:
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
$(GO) get -u github.com/vbatts/git-validation
|
$(GO) get -u github.com/vbatts/git-validation
|
||||||
|
|
||||||
.install.gometalinter:
|
.install.gometalinter:
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
$(GO) get -u github.com/alecthomas/gometalinter
|
$(GO) get -u github.com/alecthomas/gometalinter
|
||||||
gometalinter --install
|
gometalinter --install
|
||||||
|
|
||||||
.install.vndr:
|
.install.vndr:
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
$(GO) get -u github.com/LK4D4/vndr
|
$(GO) get -u github.com/LK4D4/vndr
|
||||||
|
|
||||||
.PHONY: \
|
.PHONY: \
|
||||||
|
2
cri.go
2
cri.go
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2018 The Containerd Authors.
|
Copyright 2018 The containerd Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (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 not use this file except in compliance with the License.
|
||||||
|
Loading…
Reference in New Issue
Block a user