2020-09-24 00:08:47 +03:00
REGISTRY ?= ghcr.io
USERNAME ?= talos-systems
2019-12-24 23:23:52 +03:00
SHA ?= $( shell git describe --match= none --always --abbrev= 8 --dirty)
TAG ?= $( shell git describe --tag --always --dirty)
2020-11-26 22:00:13 +03:00
IMAGE_TAG ?= $( TAG)
2019-12-24 23:23:52 +03:00
BRANCH ?= $( shell git rev-parse --abbrev-ref HEAD)
2019-12-23 21:36:14 +03:00
REGISTRY_AND_USERNAME := $( REGISTRY) /$( USERNAME)
2020-02-13 23:07:36 +03:00
DOCKER_LOGIN_ENABLED ?= true
2019-12-23 21:36:14 +03:00
2019-12-24 23:23:52 +03:00
ARTIFACTS := _out
2020-11-25 18:00:02 +03:00
TOOLS ?= ghcr.io/talos-systems/tools:v0.3.0-11-g84c834e
2020-11-28 20:30:53 +03:00
PKGS ?= v0.3.0-49-gfae70f7
2020-11-13 19:54:25 +03:00
EXTRAS ?= v0.1.0-5-gcc2df81
2020-09-04 00:56:10 +03:00
GO_VERSION ?= 1.15
2020-07-16 16:25:04 +03:00
GOFUMPT_VERSION ?= abc0db2c416aca0f60ea33c23c76665f6e7ba0b6
2020-05-08 21:44:20 +03:00
IMPORTVET ?= autonomy/importvet:f6b07d9
2019-12-24 23:23:52 +03:00
OPERATING_SYSTEM := $( shell uname -s | tr "[:upper:]" "[:lower:]" )
2020-06-14 02:43:22 +03:00
TALOSCTL_DEFAULT_TARGET := talosctl-$( OPERATING_SYSTEM)
2020-01-05 00:19:34 +03:00
INTEGRATION_TEST_DEFAULT_TARGET := integration-test-$( OPERATING_SYSTEM)
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
INTEGRATION_TEST_PROVISION_DEFAULT_TARGET := integration-test-provision-$( OPERATING_SYSTEM)
2020-12-01 19:03:36 +03:00
KUBECTL_URL ?= https://storage.googleapis.com/kubernetes-release/release/v1.20.0-rc.0/bin/$( OPERATING_SYSTEM) /amd64/kubectl
2020-07-16 01:02:27 +03:00
CLUSTERCTL_VERSION ?= 0.3.7
2020-04-29 22:24:07 +03:00
CLUSTERCTL_URL ?= https://github.com/kubernetes-sigs/cluster-api/releases/download/v$( CLUSTERCTL_VERSION) /clusterctl-$( OPERATING_SYSTEM) -amd64
2020-11-18 00:30:50 +03:00
SONOBUOY_VERSION ?= 0.19.0
2020-01-24 07:52:02 +03:00
SONOBUOY_URL ?= https://github.com/heptio/sonobuoy/releases/download/v$( SONOBUOY_VERSION) /sonobuoy_$( SONOBUOY_VERSION) _$( OPERATING_SYSTEM) _amd64.tar.gz
2020-08-17 19:12:47 +03:00
TESTPKGS ?= github.com/talos-systems/talos/...
2020-11-18 00:30:50 +03:00
RELEASES ?= v0.6.3 v0.7.0
2020-06-25 22:56:59 +03:00
SHORT_INTEGRATION_TEST ?=
2020-07-01 18:34:20 +03:00
CUSTOM_CNI_URL ?=
2019-12-24 23:23:52 +03:00
2020-09-26 00:00:43 +03:00
, : = ,
2020-10-30 01:08:05 +03:00
space := $( subst ,, )
2019-12-24 23:23:52 +03:00
BUILD := docker buildx build
2019-12-23 21:36:14 +03:00
PLATFORM ?= linux/amd64
PROGRESS ?= auto
PUSH ?= false
COMMON_ARGS := --file= Dockerfile
COMMON_ARGS += --progress= $( PROGRESS)
COMMON_ARGS += --platform= $( PLATFORM)
COMMON_ARGS += --push= $( PUSH)
COMMON_ARGS += --build-arg= TOOLS = $( TOOLS)
2020-09-07 16:52:26 +03:00
COMMON_ARGS += --build-arg= PKGS = $( PKGS)
2020-10-08 22:46:55 +03:00
COMMON_ARGS += --build-arg= EXTRAS = $( EXTRAS)
2020-07-16 16:25:04 +03:00
COMMON_ARGS += --build-arg= GOFUMPT_VERSION = $( GOFUMPT_VERSION)
2019-12-23 21:36:14 +03:00
COMMON_ARGS += --build-arg= SHA = $( SHA)
COMMON_ARGS += --build-arg= TAG = $( TAG)
2019-12-27 23:49:24 +03:00
COMMON_ARGS += --build-arg= ARTIFACTS = $( ARTIFACTS)
2020-05-08 21:44:20 +03:00
COMMON_ARGS += --build-arg= IMPORTVET = $( IMPORTVET)
2019-11-01 07:55:58 +03:00
COMMON_ARGS += --build-arg= TESTPKGS = $( TESTPKGS)
2020-08-19 01:52:26 +03:00
COMMON_ARGS += --build-arg= REGISTRY = $( REGISTRY)
2020-02-14 15:26:44 +03:00
COMMON_ARGS += --build-arg= USERNAME = $( USERNAME)
2020-02-20 14:33:12 +03:00
COMMON_ARGS += --build-arg= http_proxy = $( http_proxy)
COMMON_ARGS += --build-arg= https_proxy = $( https_proxy)
2019-04-24 04:52:31 +03:00
2020-07-23 21:21:42 +03:00
CI_ARGS ?=
2020-03-21 03:38:48 +03:00
all : initramfs kernel installer talosctl talos
2019-12-24 23:23:52 +03:00
# Help Menu
d e f i n e H E L P _ M E N U _ H E A D E R
# Getting Started
To build this project, you must have the following installed :
- g i t
- m a k e
- d o c k e r ( 1 9 . 0 3 o r h i g h e r )
- buildx (https : //github .com /docker /buildx )
## Creating a Builder Instance
T h e b u i l d p r o c e s s m a k e s u s e o f f e a t u r e s n o t c u r r e n t l y s u p p o r t e d b y t h e d e f a u l t
builder instance (docker driver). To create a compatible builder instance, run :
2019-07-23 17:17:16 +03:00
2019-12-24 23:23:52 +03:00
` ` `
d o c k e r b u i l d x c r e a t e - - d r i v e r d o c k e r - c o n t a i n e r - - n a m e l o c a l - - b u i l d k i t d - f l a g s '--allow-insecure-entitlement security.insecure' - - u s e
` ` `
2019-04-29 19:25:04 +03:00
2019-12-24 23:23:52 +03:00
I f y o u a l r e a d y h a v e a c o m p a t i b l e b u i l d e r i n s t a n c e , y o u m a y u s e t h a t i n s t e a d .
2019-02-15 07:32:00 +03:00
2020-02-13 23:07:36 +03:00
> Note : The security .insecure entitlement is only required , and used by the unit -tests target and targets which build container images
f o r a p p l i c a t i o n s u s i n g ` i m g ` t o o l .
2019-06-05 21:44:15 +03:00
2019-12-24 23:23:52 +03:00
## Artifacts
2019-02-15 07:32:00 +03:00
2019-12-24 23:23:52 +03:00
A l l a r t i f a c t s w i l l b e o u t p u t t o . / $( ARTIFACTS ) . I m a g e s w i l l b e t a g g e d w i t h t h e
2020-11-26 22:00:13 +03:00
registry "$(REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(REGISTRY_AND_USERNAME)/image : $( IMAGE_TAG ) ).
2019-12-24 23:23:52 +03:00
T h e r e g i s t r y a n d u s e r n a m e c a n b e o v e r r i d e n b y e x p o r t i n g R E G I S T R Y , a n d U S E R N A M E
r e s p e c t i v e l y .
e n d e f
export HELP_MENU_HEADER
help : ## This help menu.
@echo " $$ HELP_MENU_HEADER "
@grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $( MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# Build Abstractions
.PHONY : base
target-% : ## Builds the specified target defined in the Dockerfile. The build result will only remain in the build cache.
2019-12-23 21:36:14 +03:00
@$( BUILD) \
2019-12-24 23:23:52 +03:00
--target= $* \
$( COMMON_ARGS) \
2020-07-23 21:21:42 +03:00
$( TARGET_ARGS) \
$( CI_ARGS) .
2019-12-24 23:23:52 +03:00
2019-11-01 07:55:58 +03:00
local-% : ## Builds the specified target defined in the Dockerfile using the local output type. The build result will be output to the specified local destination.
2019-12-24 23:23:52 +03:00
@$( MAKE) target-$* TARGET_ARGS = " --output=type=local,dest= $( DEST) $( TARGET_ARGS) "
2020-09-26 00:00:43 +03:00
@PLATFORM= $( PLATFORM) \
ARTIFACTS = $( ARTIFACTS) \
./hack/fix-artifacts.sh
2019-12-24 23:23:52 +03:00
2019-11-01 07:55:58 +03:00
docker-% : ## Builds the specified target defined in the Dockerfile using the docker output type. The build result will be output to the specified local destination.
2019-12-24 23:23:52 +03:00
@mkdir -p $( DEST)
2020-11-26 22:00:13 +03:00
@$( MAKE) target-$* TARGET_ARGS = " --output type=docker,dest= $( DEST) / $* .tar,name= $( REGISTRY_AND_USERNAME) / $* : $( IMAGE_TAG) $( TARGET_ARGS) "
2019-12-24 23:23:52 +03:00
2020-09-26 00:00:43 +03:00
registry-% : ## Builds the specified target defined in the Dockerfile using the image/registry output type. The build result will be pushed to the registry if PUSH=true.
2020-11-26 22:00:13 +03:00
@$( MAKE) target-$* TARGET_ARGS = " --output type=image,name= $( REGISTRY_AND_USERNAME) / $* : $( IMAGE_TAG) $( TARGET_ARGS) "
2020-09-26 00:00:43 +03:00
2019-11-01 07:55:58 +03:00
hack-test-% : ## Runs the specied script in ./hack/test with well known environment variables.
2020-01-24 07:52:02 +03:00
@./hack/test/$* .sh
2019-11-01 07:55:58 +03:00
2019-12-24 23:23:52 +03:00
# Generators
2019-04-24 04:52:31 +03:00
2019-08-09 06:45:13 +03:00
.PHONY : generate
2019-12-24 23:23:52 +03:00
generate : ## Generates source code from protobuf definitions.
2020-09-26 00:00:43 +03:00
@$( MAKE) local-$@ DEST = ./ PLATFORM = linux/amd64
2019-08-09 06:45:13 +03:00
2019-11-09 18:22:43 +03:00
.PHONY : docs
2020-03-21 03:38:48 +03:00
docs : ## Generates the documentation for machine config, and talosctl.
2020-10-20 22:05:13 +03:00
@rm -rf docs/configuration/*
2020-03-21 03:38:48 +03:00
@rm -rf docs/talosctl/*
2020-09-26 00:00:43 +03:00
@$( MAKE) local-$@ DEST = ./ PLATFORM = linux/amd64
2019-12-24 23:23:52 +03:00
# Local Artifacts
2019-11-09 18:22:43 +03:00
2019-04-19 05:31:43 +03:00
.PHONY : kernel
2020-09-01 00:35:12 +03:00
kernel : ## Outputs the kernel package contents (vmlinuz) to the artifact directory.
2019-12-24 23:23:52 +03:00
@$( MAKE) local-$@ DEST = $( ARTIFACTS)
@-rm -rf $( ARTIFACTS) /modules
2019-01-18 06:14:52 +03:00
2019-04-19 05:31:43 +03:00
.PHONY : initramfs
2020-02-14 15:26:44 +03:00
initramfs : ## Builds the compressed initramfs and outputs it to the artifact directory.
@$( MAKE) local-$@ DEST = $( ARTIFACTS) TARGET_ARGS = "--allow security.insecure"
2018-12-20 09:22:05 +03:00
2019-12-24 23:23:52 +03:00
.PHONY : installer
2020-02-14 15:26:44 +03:00
installer : ## Builds the container image for the installer and outputs it to the artifact directory.
2020-09-26 00:00:43 +03:00
@$( MAKE) registry-$@ TARGET_ARGS = "--allow security.insecure"
2019-10-31 01:52:36 +03:00
2019-12-24 23:23:52 +03:00
.PHONY : talos
2020-02-14 15:26:44 +03:00
talos : ## Builds the Talos container image and outputs it to the artifact directory.
2020-09-26 00:00:43 +03:00
@$( MAKE) registry-$@ TARGET_ARGS = "--allow security.insecure"
2018-12-20 09:22:05 +03:00
2020-03-21 03:38:48 +03:00
talosctl-% :
2020-09-26 00:00:43 +03:00
@$( MAKE) local-$@ DEST = $( ARTIFACTS) PLATFORM = linux/amd64
2019-12-24 23:23:52 +03:00
2020-06-14 02:43:22 +03:00
talosctl : $( TALOSCTL_DEFAULT_TARGET ) ## Builds the talosctl binary for the local machine.
2019-12-24 23:23:52 +03:00
2019-11-01 07:55:58 +03:00
image-% : ## Builds the specified image. Valid options are aws, azure, digital-ocean, gcp, and vmware (e.g. image-aws)
2020-12-05 01:43:06 +03:00
@docker pull $( REGISTRY) /$( USERNAME) /installer:$( TAG)
2020-11-13 17:17:07 +03:00
@docker run --rm -v /dev:/dev --privileged $( REGISTRY) /$( USERNAME) /installer:$( TAG) image --platform $* --tar-to-stdout | tar xz -C $( ARTIFACTS)
2019-11-01 07:55:58 +03:00
2020-11-25 18:00:02 +03:00
images : image -aws image -azure image -digital -ocean image -gcp image -metal image -openstack image -vmware ## Builds all known images (AWS, Azure, Digital Ocean, GCP, Metal, Openstack, and VMware).
2019-04-05 07:34:58 +03:00
2020-12-04 22:59:08 +03:00
sbc-% : ## Builds the specified SBC image. Valid options are rpi_4, rock64, bananapi_m64, and libretech_all_h3_cc_h5 (e.g. sbc-rpi_4)
2020-12-05 01:43:06 +03:00
@docker pull $( REGISTRY) /$( USERNAME) /installer:$( TAG)
2020-12-01 05:52:23 +03:00
@docker run --rm -v /dev:/dev --privileged $( REGISTRY) /$( USERNAME) /installer:$( TAG) image --platform metal --board $* --tar-to-stdout | tar xz -C $( ARTIFACTS)
2020-12-04 22:59:08 +03:00
sbcs : sbc -rpi_ 4 sbc -rock 64 sbc -bananapi_m 64 sbc -libretech_all_h 3_cc_h 5 ## Builds all known SBC images (Raspberry Pi 4 Model B, Rock64, Banana Pi M64, and Libre Computer Board ALL-H3-CC).
2020-12-01 05:52:23 +03:00
2020-11-01 00:03:56 +03:00
.PHONY : iso
iso : ## Builds the ISO and outputs it to the artifact directory.
2020-12-05 01:43:06 +03:00
@docker pull $( REGISTRY) /$( USERNAME) /installer:$( TAG)
2020-11-13 17:17:07 +03:00
@docker run --rm -i $( REGISTRY) /$( USERNAME) /installer:$( TAG) iso --tar-to-stdout | tar xz -C $( ARTIFACTS)
2020-11-01 00:03:56 +03:00
2020-01-09 23:25:25 +03:00
.PHONY : boot
2020-09-26 00:00:43 +03:00
boot : ## Creates a compressed tarball that includes vmlinuz-{amd64,arm64} and initramfs-{amd64,arm64}.xz. Note that these files must already be present in the artifacts directory.
@for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
arch = ` basename " $$ {platform} " ` ; \
tar -C $( ARTIFACTS) --transform= s/-$$ { arch} // -czf $( ARTIFACTS) /boot-$$ { arch} .tar.gz vmlinuz-$$ { arch} initramfs-$$ { arch} .xz ; \
done
2020-01-09 23:25:25 +03:00
2020-10-30 01:08:05 +03:00
.PHONY : talosctl -cni -bundle
talosctl-cni-bundle : ## Creates a compressed tarball that includes CNI bundle for talosctl.
@$( MAKE) local-$@ DEST = $( ARTIFACTS)
@for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
arch = ` basename " $$ {platform} " ` ; \
tar -C $( ARTIFACTS) /talosctl-cni-bundle-$$ { arch} -czf $( ARTIFACTS) /talosctl-cni-bundle-$$ { arch} .tar.gz . ; \
done
@rm -rf $( ARTIFACTS) /talosctl-cni-bundle-*/
2019-12-24 23:23:52 +03:00
# Code Quality
2019-02-19 19:41:41 +03:00
2019-12-24 23:23:52 +03:00
.PHONY : fmt
fmt : ## Formats the source code.
2020-07-16 16:25:04 +03:00
@docker run --rm -it -v $( PWD) :/src -w /src golang:$( GO_VERSION) bash -c " export GO111MODULE=on; export GOPROXY=https://proxy.golang.org; cd /tmp && go mod init tmp && go get mvdan.cc/gofumpt/gofumports@ $( GOFUMPT_VERSION) && cd - && gofumports -w -local github.com/talos-systems/talos . "
2019-04-28 22:06:03 +03:00
2019-11-01 07:55:58 +03:00
lint-% : ## Runs the specified linter. Valid options are go, protobuf, and markdown (e.g. lint-go).
2020-09-26 00:00:43 +03:00
@$( MAKE) target-lint-$* PLATFORM = linux/amd64
2019-08-02 18:05:34 +03:00
2019-12-24 23:23:52 +03:00
lint : ## Runs linters on go, protobuf, and markdown file types.
@$( MAKE) lint-go lint-protobuf lint-markdown
2020-04-07 22:49:12 +03:00
check-dirty : ## Verifies that source tree is not dirty
2020-10-20 12:20:31 +03:00
@if test -n "`git status --porcelain`" ; then echo "Source tree is dirty" ; git status; exit 1 ; fi
2020-04-07 22:49:12 +03:00
2019-12-24 23:23:52 +03:00
# Tests
2019-06-17 19:36:48 +03:00
2019-08-09 06:45:13 +03:00
.PHONY : unit -tests
2020-02-14 15:26:44 +03:00
unit-tests : ## Performs unit tests.
2020-09-26 00:00:43 +03:00
@$( MAKE) local-$@ DEST = $( ARTIFACTS) TARGET_ARGS = "--allow security.insecure" PLATFORM = linux/amd64
2019-08-07 01:08:27 +03:00
2019-08-09 06:45:13 +03:00
.PHONY : unit -tests -race
2019-12-24 23:23:52 +03:00
unit-tests-race : ## Performs unit tests with race detection enabled.
2020-09-26 00:00:43 +03:00
@$( MAKE) target-$@ TARGET_ARGS = "--allow security.insecure" PLATFORM = linux/amd64
2019-12-24 23:23:52 +03:00
2020-01-24 07:52:02 +03:00
$(ARTIFACTS)/$(INTEGRATION_TEST_DEFAULT_TARGET)-amd64 :
2020-09-26 00:00:43 +03:00
@$( MAKE) local-$( INTEGRATION_TEST_DEFAULT_TARGET) DEST = $( ARTIFACTS) PLATFORM = linux/amd64
2020-01-24 07:52:02 +03:00
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
$(ARTIFACTS)/$(INTEGRATION_TEST_PROVISION_DEFAULT_TARGET)-amd64 :
2020-09-26 00:00:43 +03:00
@$( MAKE) local-$( INTEGRATION_TEST_PROVISION_DEFAULT_TARGET) DEST = $( ARTIFACTS) PLATFORM = linux/amd64
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
2020-01-24 07:52:02 +03:00
$(ARTIFACTS)/sonobuoy :
@mkdir -p $( ARTIFACTS)
@curl -L -o /tmp/sonobuoy.tar.gz ${ SONOBUOY_URL }
@tar -xf /tmp/sonobuoy.tar.gz -C $( ARTIFACTS)
$(ARTIFACTS)/kubectl :
@mkdir -p $( ARTIFACTS)
@curl -L -o $( ARTIFACTS) /kubectl " $( KUBECTL_URL) "
@chmod +x $( ARTIFACTS) /kubectl
2020-04-29 22:24:07 +03:00
$(ARTIFACTS)/clusterctl :
@mkdir -p $( ARTIFACTS)
@curl -L -o $( ARTIFACTS) /clusterctl " $( CLUSTERCTL_URL) "
@chmod +x $( ARTIFACTS) /clusterctl
e2e-% : $( ARTIFACTS ) /$( INTEGRATION_TEST_DEFAULT_TARGET ) -amd 64 $( ARTIFACTS ) /sonobuoy $( ARTIFACTS ) /kubectl $( ARTIFACTS ) /clusterctl ## Runs the E2E test for the specified platform (e.g. e2e-docker).
2020-01-24 07:52:02 +03:00
@$( MAKE) hack-test-$@ \
PLATFORM = $* \
TAG = $( TAG) \
SHA = $( SHA) \
2020-09-26 00:00:43 +03:00
REGISTRY = $( REGISTRY) \
2020-01-24 07:52:02 +03:00
IMAGE = $( REGISTRY_AND_USERNAME) /talos:$( TAG) \
2020-07-23 21:21:42 +03:00
INSTALLER_IMAGE = $( REGISTRY_AND_USERNAME) /installer:$( TAG) \
2020-01-24 07:52:02 +03:00
ARTIFACTS = $( ARTIFACTS) \
2020-06-14 02:43:22 +03:00
TALOSCTL = $( PWD) /$( ARTIFACTS) /$( TALOSCTL_DEFAULT_TARGET) -amd64 \
2020-01-24 07:52:02 +03:00
INTEGRATION_TEST = $( PWD) /$( ARTIFACTS) /$( INTEGRATION_TEST_DEFAULT_TARGET) -amd64 \
2020-06-25 22:56:59 +03:00
SHORT_INTEGRATION_TEST = $( SHORT_INTEGRATION_TEST) \
2020-07-01 18:34:20 +03:00
CUSTOM_CNI_URL = $( CUSTOM_CNI_URL) \
2020-01-24 07:52:02 +03:00
KUBECTL = $( PWD) /$( ARTIFACTS) /kubectl \
2020-04-29 22:24:07 +03:00
SONOBUOY = $( PWD) /$( ARTIFACTS) /sonobuoy \
CLUSTERCTL = $( PWD) /$( ARTIFACTS) /clusterctl
2019-12-24 23:23:52 +03:00
2020-03-24 21:20:36 +03:00
provision-tests-prepare : release -artifacts $( ARTIFACTS ) /$( INTEGRATION_TEST_PROVISION_DEFAULT_TARGET ) -amd 64
provision-tests : provision -tests -prepare
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
@$( MAKE) hack-test-$@ \
TAG = $( TAG) \
2020-06-14 02:43:22 +03:00
TALOSCTL = $( PWD) /$( ARTIFACTS) /$( TALOSCTL_DEFAULT_TARGET) -amd64 \
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
INTEGRATION_TEST = $( PWD) /$( ARTIFACTS) /$( INTEGRATION_TEST_PROVISION_DEFAULT_TARGET) -amd64
2020-03-24 21:20:36 +03:00
provision-tests-track-% :
@$( MAKE) hack-test-provision-tests \
TAG = $( TAG) \
2020-06-14 02:43:22 +03:00
TALOSCTL = $( PWD) /$( ARTIFACTS) /$( TALOSCTL_DEFAULT_TARGET) -amd64 \
2020-03-24 21:20:36 +03:00
INTEGRATION_TEST = $( PWD) /$( ARTIFACTS) /$( INTEGRATION_TEST_PROVISION_DEFAULT_TARGET) -amd64 \
2020-07-27 19:28:28 +03:00
INTEGRATION_TEST_RUN = " TestIntegration/.+-TR $* " \
2020-09-07 23:36:42 +03:00
INTEGRATION_TEST_TRACK = " $* " \
2020-09-26 00:00:43 +03:00
CUSTOM_CNI_URL = $( CUSTOM_CNI_URL) \
REGISTRY = $( REGISTRY)
2020-03-24 21:20:36 +03:00
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
# Assets for releases
.PHONY : $( ARTIFACTS ) /$( TALOS_RELEASE )
2020-07-29 19:39:47 +03:00
$(ARTIFACTS)/$(TALOS_RELEASE) : $( ARTIFACTS ) /$( TALOS_RELEASE ) /vmlinuz $( ARTIFACTS ) /$( TALOS_RELEASE ) /initramfs .xz
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
# download release artifacts for specific version
$(ARTIFACTS)/$(TALOS_RELEASE)/% :
@mkdir -p $( ARTIFACTS) /$( TALOS_RELEASE) /
2020-10-23 23:59:50 +03:00
@case " $( TALOS_RELEASE) " in \
v0.6*) \
curl -L -o " $( ARTIFACTS) / $( TALOS_RELEASE) / $* " " https://github.com/talos-systems/talos/releases/download/ $( TALOS_RELEASE) / $* " \
; ; \
v0.7.0-alpha.[ 0-3] ) \
curl -L -o " $( ARTIFACTS) / $( TALOS_RELEASE) / $* " " https://github.com/talos-systems/talos/releases/download/ $( TALOS_RELEASE) / $* " \
; ; \
*) \
case " $* " in \
vmlinuz) \
curl -L -o " $( ARTIFACTS) / $( TALOS_RELEASE) / $* " " https://github.com/talos-systems/talos/releases/download/ $( TALOS_RELEASE) /vmlinuz-amd64 " \
; ; \
initramfs.xz) \
curl -L -o " $( ARTIFACTS) / $( TALOS_RELEASE) / $* " " https://github.com/talos-systems/talos/releases/download/ $( TALOS_RELEASE) /initramfs-amd64.xz " \
; ; \
esac \
; ; \
esac
test: implement new class of tests: provision tests (upgrades)
This class of tests is included/excluded by build tags, but as it is
pretty different from other integration tests, we build it as separate
executable. Provision tests provision cluster for the test run, perform
some actions and verify results (could be upgrade, reset, scale up/down,
etc.)
There's now framework to implement upgrade tests, first of the tests
tests upgrade from latest 0.3 (0.3.2 at the moment) to current version
of Talos (being built in CI). Tests starts by booting with 0.3
kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for
bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker
supports bootloader, this boots 0.4 system from boot disk (as installed
by installer).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-18 01:00:51 +03:00
.PHONY : release -artifacts
release-artifacts :
@for release in $( RELEASES) ; do \
$( MAKE) $( ARTIFACTS) /$$ release TALOS_RELEASE = $$ release; \
done
2019-12-24 23:23:52 +03:00
# Utilities
2019-01-19 12:58:26 +03:00
2020-04-11 03:06:59 +03:00
.PHONY : conformance
conformance : ## Performs policy checks against the commit and source code.
docker run --rm -it -v $( PWD) :/src -w /src docker.io/autonomy/conform:v0.1.0-alpha.19
2020-07-28 23:55:47 +03:00
.PHONY : release -notes
release-notes :
2020-10-07 16:46:37 +03:00
ARTIFACTS = $( ARTIFACTS) ./hack/release.sh $@ $( ARTIFACTS) /RELEASE_NOTES.md $( TAG)
2020-07-28 23:55:47 +03:00
2019-04-12 09:40:30 +03:00
.PHONY : login
2019-12-24 23:23:52 +03:00
login : ## Logs in to the configured container registry.
2020-02-13 23:07:36 +03:00
i f e q ( $( DOCKER_LOGIN_ENABLED ) , t r u e )
2020-09-24 02:21:43 +03:00
@docker login --username " $( GHCR_USERNAME) " --password " $( GHCR_PASSWORD) " $( REGISTRY)
2020-02-13 23:07:36 +03:00
e n d i f
2019-04-12 09:40:30 +03:00
2020-01-01 21:28:44 +03:00
push : login ## Pushes the installer, and talos images to the configured container registry with the generated tag.
2020-09-26 00:00:43 +03:00
@$( MAKE) installer PUSH = true
@$( MAKE) talos PUSH = true
2020-01-01 21:28:44 +03:00
push-% : login ## Pushes the installer, and talos images to the configured container registry with the specified tag (e.g. push-latest).
2020-11-26 22:00:13 +03:00
@$( MAKE) push IMAGE_TAG = $*
2019-04-12 09:40:30 +03:00
2019-04-19 05:31:43 +03:00
.PHONY : clean
2019-12-24 23:23:52 +03:00
clean : ## Cleans up all artifacts.
2020-01-24 07:52:02 +03:00
@-rm -rf $( ARTIFACTS)