The commands can be run concurrently, with the exception of e2e that has to be run after e2e-setup is done. The e2e target does not check whether cert-manager and the addons are installed. The two only scripts that were kept are: - make/e2e.sh (previously called ./devel/run-e2e.sh) - make/cluster.sh (previsouly called ./devel/cluster/create.sh) The reason for the removal of the other scripts is that they didn't have that much logic and could easily ported to Make, improving greatly the execution speed thanks to make's concurrency. make/e2e.sh now behaves "as expected" when using -ginkgo.focus or GINKGO_FOCUS; previously, the logs would not be shown before the end of the test. make/cluster.sh has lost the ability to create an OpenShift 3.11 cluster. for running the end-to-end tests. The two reasons are that OpenShift 4 wasn't supported by the script devel/cluster/create.sh, and OpenShift 3.11 is not supported by cert-manager anymore. The Makefile targets that were used in the Prow jobs (verify, verify_deps, verify_chart, verify_upgrade, and cluster) have been kept around. They now show a warning to encourage people to use the new Make-based targets. When running one of the deprecated targets the Makefile won't check the presence of the system tools such as Go and jq, since Bazel takes care of these dependencies. On version change, downloaded tools and images are re-downloaded. The command 'make clean' now keeps the downloaded images and tools. Note that a lot of attention has been put into having a Make system that works flawlessly both on Linux and on BSDs (such as macOS). You will note that some recursive calls to make are made, and $(MAKE) instead of plain "make" is used in that case. If we didn't use $(MAKE), we would have concurrency issues, and warnings such as: make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. Signed-off-by: Maël Valais <mael@vls.dev>
139 lines
9.8 KiB
Makefile
139 lines
9.8 KiB
Makefile
# set to "DYNAMIC" to use a dynamic base image
|
|
BASE_IMAGE_TYPE:=STATIC
|
|
|
|
ARCHS = amd64 arm64 s390x ppc64le arm
|
|
BINS = controller acmesolver cainjector webhook ctl
|
|
|
|
BASE_IMAGE_controller-linux-amd64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_amd64)
|
|
BASE_IMAGE_controller-linux-arm64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm64)
|
|
BASE_IMAGE_controller-linux-s390x:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_s390x)
|
|
BASE_IMAGE_controller-linux-ppc64le:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_ppc64le)
|
|
BASE_IMAGE_controller-linux-arm:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm)
|
|
|
|
BASE_IMAGE_webhook-linux-amd64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_amd64)
|
|
BASE_IMAGE_webhook-linux-arm64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm64)
|
|
BASE_IMAGE_webhook-linux-s390x:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_s390x)
|
|
BASE_IMAGE_webhook-linux-ppc64le:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_ppc64le)
|
|
BASE_IMAGE_webhook-linux-arm:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm)
|
|
|
|
BASE_IMAGE_acmesolver-linux-amd64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_amd64)
|
|
BASE_IMAGE_acmesolver-linux-arm64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm64)
|
|
BASE_IMAGE_acmesolver-linux-s390x:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_s390x)
|
|
BASE_IMAGE_acmesolver-linux-ppc64le:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_ppc64le)
|
|
BASE_IMAGE_acmesolver-linux-arm:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm)
|
|
|
|
BASE_IMAGE_cainjector-linux-amd64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_amd64)
|
|
BASE_IMAGE_cainjector-linux-arm64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm64)
|
|
BASE_IMAGE_cainjector-linux-s390x:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_s390x)
|
|
BASE_IMAGE_cainjector-linux-ppc64le:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_ppc64le)
|
|
BASE_IMAGE_cainjector-linux-arm:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm)
|
|
|
|
BASE_IMAGE_cmctl-linux-amd64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_amd64)
|
|
BASE_IMAGE_cmctl-linux-arm64:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm64)
|
|
BASE_IMAGE_cmctl-linux-s390x:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_s390x)
|
|
BASE_IMAGE_cmctl-linux-ppc64le:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_ppc64le)
|
|
BASE_IMAGE_cmctl-linux-arm:=$($(BASE_IMAGE_TYPE)_BASE_IMAGE_arm)
|
|
|
|
.PHONY: all-containers
|
|
all-containers: cert-manager-controller-linux cert-manager-webhook-linux cert-manager-acmesolver-linux cert-manager-cainjector-linux cert-manager-ctl-linux
|
|
|
|
.PHONY: cert-manager-controller-linux
|
|
cert-manager-controller-linux: bin/containers/cert-manager-controller-linux-amd64.tar.gz bin/containers/cert-manager-controller-linux-arm64.tar.gz bin/containers/cert-manager-controller-linux-s390x.tar.gz bin/containers/cert-manager-controller-linux-ppc64le.tar.gz bin/containers/cert-manager-controller-linux-arm.tar.gz
|
|
|
|
bin/containers/cert-manager-controller-linux-amd64.tar bin/containers/cert-manager-controller-linux-arm64.tar bin/containers/cert-manager-controller-linux-s390x.tar bin/containers/cert-manager-controller-linux-ppc64le.tar bin/containers/cert-manager-controller-linux-arm.tar: bin/containers/cert-manager-controller-linux-%.tar: bin/scratch/build-context/cert-manager-controller-linux-%/controller hack/containers/Containerfile.controller bin/scratch/build-context/cert-manager-controller-linux-%/cert-manager.license bin/scratch/build-context/cert-manager-controller-linux-%/cert-manager.licenses_notice bin/release-version | bin/containers
|
|
@$(eval TAG := cert-manager-controller-$*:$(RELEASE_VERSION))
|
|
@$(eval BASE := BASE_IMAGE_controller-linux-$*)
|
|
$(CTR) build --quiet \
|
|
-f hack/containers/Containerfile.controller \
|
|
--build-arg BASE_IMAGE=$($(BASE)) \
|
|
-t $(TAG) \
|
|
$(dir $<) >/dev/null
|
|
$(CTR) save $(TAG) -o $@ >/dev/null
|
|
|
|
.PHONY: cert-manager-webhook-linux
|
|
cert-manager-webhook-linux: bin/containers/cert-manager-webhook-linux-amd64.tar.gz bin/containers/cert-manager-webhook-linux-arm64.tar.gz bin/containers/cert-manager-webhook-linux-s390x.tar.gz bin/containers/cert-manager-webhook-linux-ppc64le.tar.gz bin/containers/cert-manager-webhook-linux-arm.tar.gz
|
|
|
|
bin/containers/cert-manager-webhook-linux-amd64.tar bin/containers/cert-manager-webhook-linux-arm64.tar bin/containers/cert-manager-webhook-linux-s390x.tar bin/containers/cert-manager-webhook-linux-ppc64le.tar bin/containers/cert-manager-webhook-linux-arm.tar: bin/containers/cert-manager-webhook-linux-%.tar: bin/scratch/build-context/cert-manager-webhook-linux-%/webhook hack/containers/Containerfile.webhook bin/scratch/build-context/cert-manager-webhook-linux-%/cert-manager.license bin/scratch/build-context/cert-manager-webhook-linux-%/cert-manager.licenses_notice bin/release-version | bin/containers
|
|
@$(eval TAG := cert-manager-webhook-$*:$(RELEASE_VERSION))
|
|
@$(eval BASE := BASE_IMAGE_webhook-linux-$*)
|
|
$(CTR) build --quiet \
|
|
-f hack/containers/Containerfile.webhook \
|
|
--build-arg BASE_IMAGE=$($(BASE)) \
|
|
-t $(TAG) \
|
|
$(dir $<) >/dev/null
|
|
$(CTR) save $(TAG) -o $@ >/dev/null
|
|
|
|
.PHONY: cert-manager-cainjector-linux
|
|
cert-manager-cainjector-linux: bin/containers/cert-manager-cainjector-linux-amd64.tar.gz bin/containers/cert-manager-cainjector-linux-arm64.tar.gz bin/containers/cert-manager-cainjector-linux-s390x.tar.gz bin/containers/cert-manager-cainjector-linux-ppc64le.tar.gz bin/containers/cert-manager-cainjector-linux-arm.tar.gz
|
|
|
|
bin/containers/cert-manager-cainjector-linux-amd64.tar bin/containers/cert-manager-cainjector-linux-arm64.tar bin/containers/cert-manager-cainjector-linux-s390x.tar bin/containers/cert-manager-cainjector-linux-ppc64le.tar bin/containers/cert-manager-cainjector-linux-arm.tar: bin/containers/cert-manager-cainjector-linux-%.tar: bin/scratch/build-context/cert-manager-cainjector-linux-%/cainjector hack/containers/Containerfile.cainjector bin/scratch/build-context/cert-manager-cainjector-linux-%/cert-manager.license bin/scratch/build-context/cert-manager-cainjector-linux-%/cert-manager.licenses_notice bin/release-version | bin/containers
|
|
@$(eval TAG := cert-manager-cainjector-$*:$(RELEASE_VERSION))
|
|
@$(eval BASE := BASE_IMAGE_cainjector-linux-$*)
|
|
$(CTR) build --quiet \
|
|
-f hack/containers/Containerfile.cainjector \
|
|
--build-arg BASE_IMAGE=$($(BASE)) \
|
|
-t $(TAG) \
|
|
$(dir $<) >/dev/null
|
|
$(CTR) save $(TAG) -o $@ >/dev/null
|
|
|
|
.PHONY: cert-manager-acmesolver-linux
|
|
cert-manager-acmesolver-linux: bin/containers/cert-manager-acmesolver-linux-amd64.tar.gz bin/containers/cert-manager-acmesolver-linux-arm64.tar.gz bin/containers/cert-manager-acmesolver-linux-s390x.tar.gz bin/containers/cert-manager-acmesolver-linux-ppc64le.tar.gz bin/containers/cert-manager-acmesolver-linux-arm.tar.gz
|
|
|
|
bin/containers/cert-manager-acmesolver-linux-amd64.tar bin/containers/cert-manager-acmesolver-linux-arm64.tar bin/containers/cert-manager-acmesolver-linux-s390x.tar bin/containers/cert-manager-acmesolver-linux-ppc64le.tar bin/containers/cert-manager-acmesolver-linux-arm.tar: bin/containers/cert-manager-acmesolver-linux-%.tar: bin/scratch/build-context/cert-manager-acmesolver-linux-%/acmesolver hack/containers/Containerfile.acmesolver bin/scratch/build-context/cert-manager-acmesolver-linux-%/cert-manager.license bin/scratch/build-context/cert-manager-acmesolver-linux-%/cert-manager.licenses_notice bin/release-version | bin/containers
|
|
@$(eval TAG := cert-manager-acmesolver-$*:$(RELEASE_VERSION))
|
|
@$(eval BASE := BASE_IMAGE_acmesolver-linux-$*)
|
|
$(CTR) build --quiet \
|
|
-f hack/containers/Containerfile.acmesolver \
|
|
--build-arg BASE_IMAGE=$($(BASE)) \
|
|
-t $(TAG) \
|
|
$(dir $<) >/dev/null
|
|
$(CTR) save $(TAG) -o $@ >/dev/null
|
|
|
|
.PHONY: cert-manager-ctl-linux
|
|
cert-manager-ctl-linux: bin/containers/cert-manager-ctl-linux-amd64.tar.gz bin/containers/cert-manager-ctl-linux-arm64.tar.gz bin/containers/cert-manager-ctl-linux-s390x.tar.gz bin/containers/cert-manager-ctl-linux-ppc64le.tar.gz bin/containers/cert-manager-ctl-linux-arm.tar.gz
|
|
|
|
$(foreach arch,$(ARCHS),bin/containers/cert-manager-ctl-linux-$(arch).tar): bin/containers/cert-manager-ctl-linux-%.tar: bin/scratch/build-context/cert-manager-ctl-linux-%/ctl hack/containers/Containerfile.ctl bin/scratch/build-context/cert-manager-ctl-linux-%/cert-manager.license bin/scratch/build-context/cert-manager-ctl-linux-%/cert-manager.licenses_notice bin/release-version | bin/containers
|
|
@$(eval TAG := cert-manager-ctl-$*:$(RELEASE_VERSION))
|
|
@$(eval BASE := BASE_IMAGE_cmctl-linux-$*)
|
|
$(CTR) build --quiet \
|
|
-f hack/containers/Containerfile.ctl \
|
|
--build-arg BASE_IMAGE=$($(BASE)) \
|
|
-t $(TAG) \
|
|
$(dir $<) >/dev/null
|
|
$(CTR) save $(TAG) -o $@ >/dev/null
|
|
|
|
# At first, we used .INTERMEDIATE to remove the intermediate .tar files.
|
|
# But it meant "make install" would always have to rebuild
|
|
# the tar files.
|
|
bin/containers/cert-manager-%.tar.gz: bin/containers/cert-manager-%.tar
|
|
gzip -c $< > $@
|
|
|
|
bin/containers:
|
|
@mkdir -p $@
|
|
|
|
# When running "docker build .", the "build context" was getting too big (1.1 GB
|
|
# when all binaries for all archs are built). Even with a very strict
|
|
# .dockerignore, each "docker build" command would last for more than 10 seconds
|
|
# each due to the copying happening. To avoid that, we set a different folder
|
|
# for each "docker build" command, which reduces the copying to ~50 MB per
|
|
# "docker build".
|
|
#
|
|
# Note that we can't use symlinks in the build context. In order to avoid the
|
|
# cost of multiple copies of the same binary, we use hard links which shouldn't
|
|
# be a problem since the bin/ folder is entirely managed by make.
|
|
|
|
$(foreach arch,$(ARCHS),$(foreach bin,$(BINS), bin/scratch/build-context/cert-manager-$(bin)-linux-$(arch))):
|
|
@mkdir -p $@
|
|
|
|
bin/scratch/build-context/cert-manager-%/cert-manager.license: bin/scratch/cert-manager.license | bin/scratch/build-context/cert-manager-%
|
|
@ln -f $< $@
|
|
|
|
bin/scratch/build-context/cert-manager-%/cert-manager.licenses_notice: bin/scratch/cert-manager.licenses_notice | bin/scratch/build-context/cert-manager-%
|
|
@ln -f $< $@
|
|
|
|
bin/scratch/build-context/cert-manager-%/controller bin/scratch/build-context/cert-manager-%/acmesolver bin/scratch/build-context/cert-manager-%/cainjector bin/scratch/build-context/cert-manager-%/webhook: bin/server/% | bin/scratch/build-context/cert-manager-%
|
|
@ln -f $< $@
|
|
|
|
bin/scratch/build-context/cert-manager-ctl-%/ctl: bin/cmctl/cmctl-% | bin/scratch/build-context/cert-manager-ctl-%
|
|
@ln -f $< $@
|