2020-09-24 00:08:47 +03:00
REGISTRY ?= ghcr.io
2022-03-23 20:02:22 +03:00
USERNAME ?= siderolabs
2019-12-24 23:23:52 +03:00
SHA ?= $( shell git describe --match= none --always --abbrev= 8 --dirty)
2021-09-13 17:34:15 +03:00
TAG ?= $( shell git describe --tag --always --dirty --match v[ 0-9] \* )
2022-03-30 22:05:43 +03:00
ABBREV_TAG ?= $( shell git describe --tag --always --match v[ 0-9] \* --abbrev= 0 )
2021-08-16 18:23:39 +03:00
TAG_SUFFIX ?=
2021-08-10 22:49:33 +03:00
SOURCE_DATE_EPOCH ?= $( shell git log -1 --pretty= %ct)
2021-02-24 15:43:27 +03:00
IMAGE_REGISTRY ?= $( REGISTRY)
2021-08-16 18:23:39 +03:00
IMAGE_TAG ?= $( TAG) $( TAG_SUFFIX)
2019-12-24 23:23:52 +03:00
BRANCH ?= $( shell git rev-parse --abbrev-ref HEAD)
2021-02-24 15:43:27 +03:00
REGISTRY_AND_USERNAME := $( IMAGE_REGISTRY) /$( USERNAME)
2020-02-13 23:07:36 +03:00
DOCKER_LOGIN_ENABLED ?= true
2021-03-29 17:27:23 +03:00
NAME = Talos
2019-12-23 21:36:14 +03:00
2019-12-24 23:23:52 +03:00
ARTIFACTS := _out
2023-07-12 14:21:26 +03:00
TOOLS ?= ghcr.io/siderolabs/tools:v1.5.0-alpha.0-18-ge27c249
PKGS ?= v1.5.0-alpha.0-34-g75696ba
EXTRAS ?= v1.5.0-alpha.0-2-gf415aac
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-tags depName=golang/go
2023-02-16 13:38:22 +03:00
GO_VERSION ?= 1.20
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=golang.org/x/tools
2023-07-14 11:59:09 +03:00
GOIMPORTS_VERSION ?= v0.11.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=mvdan.cc/gofumpt
2023-05-11 07:56:06 +03:00
GOFUMPT_VERSION ?= v0.5.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/golangci/golangci-lint
2023-06-22 19:52:33 +03:00
GOLANGCILINT_VERSION ?= v1.53.3
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=golang.org/x/tools
2023-07-14 11:59:09 +03:00
STRINGER_VERSION ?= v0.11.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/alvaroloes/enumer
2021-12-30 15:57:32 +03:00
ENUMER_VERSION ?= v1.1.2
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=k8s.io/code-generator
2023-06-22 19:52:33 +03:00
DEEPCOPY_GEN_VERSION ?= v0.27.3
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/planetscale/vtprotobuf
2023-01-30 19:49:12 +03:00
VTPROTOBUF_VERSION ?= v0.4.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/siderolabs/deep-copy
2022-05-12 17:50:39 +03:00
DEEPCOPY_VERSION ?= v0.5.5
2023-06-07 21:26:51 +03:00
# renovate: datasource=go depName=github.com/siderolabs/importvet
IMPORTVET_VERSION ?= v0.1.0
2023-02-16 13:38:22 +03:00
# renovate: datasource=npm depName=markdownlint-cli
2023-06-22 19:52:33 +03:00
MARKDOWNLINTCLI_VERSION ?= 0.35.0
2023-02-16 13:38:22 +03:00
# renovate: datasource=npm depName=textlint
2023-03-30 20:28:26 +03:00
TEXTLINT_VERSION ?= 13.3.2
2023-02-16 13:38:22 +03:00
# renovate: datasource=npm depName=textlint-filter-rule-comments
TEXTLINT_FILTER_RULE_COMMENTS_VERSION ?= 1.2.2
# renovate: datasource=npm depName=textlint-rule-one-sentence-per-line
TEXTLINT_RULE_ONE_SENTENCE_PER_LINE_VERSION ?= 2.0.0
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)
2023-04-10 14:09:39 +03:00
MODULE_SIG_VERIFY_DEFAULT_TARGET := module-sig-verify-$( 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)
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=kubernetes/kubernetes
2023-07-10 15:48:22 +03:00
KUBECTL_VERSION ?= v1.28.0-alpha.4
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=kastenhq/kubestr
2023-02-16 13:38:22 +03:00
KUBESTR_VERSION ?= v0.4.37
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=helm/helm
2023-06-22 19:52:33 +03:00
HELM_VERSION ?= v3.12.1
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=kubernetes-sigs/cluster-api
2023-07-05 17:20:28 +03:00
CLUSTERCTL_VERSION ?= 1.4.4
2023-03-02 18:49:50 +03:00
# renovate: datasource=github-releases depName=cilium/cilium-cli
2023-07-14 11:59:09 +03:00
CILIUM_CLI_VERSION ?= v0.14.7
2023-05-11 19:02:32 +03:00
KUBECTL_URL ?= https://dl.k8s.io/release/$( KUBECTL_VERSION) /bin/$( OPERATING_SYSTEM) /amd64/kubectl
2023-01-23 17:32:50 +03:00
KUBESTR_URL ?= https://github.com/kastenhq/kubestr/releases/download/$( KUBESTR_VERSION) /kubestr_$( subst v,,$( KUBESTR_VERSION) ) _Linux_amd64.tar.gz
HELM_URL ?= https://get.helm.sh/helm-$( HELM_VERSION) -linux-amd64.tar.gz
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
2023-03-02 18:49:50 +03:00
CILIUM_CLI_URL ?= https://github.com/cilium/cilium-cli/releases/download/$( CILIUM_CLI_VERSION) /cilium-$( OPERATING_SYSTEM) -amd64.tar.gz
2022-11-02 14:06:45 +03:00
TESTPKGS ?= github.com/siderolabs/talos/...
2023-06-13 21:10:14 +03:00
RELEASES ?= v1.3.7 v1.4.5
2020-06-25 22:56:59 +03:00
SHORT_INTEGRATION_TEST ?=
2020-07-01 18:34:20 +03:00
CUSTOM_CNI_URL ?=
2021-05-31 20:30:01 +03:00
INSTALLER_ARCH ?= all
2022-05-25 16:28:51 +03:00
IMAGER_ARGS ?=
2022-06-07 16:47:32 +03:00
IMAGER_SYSTEM_EXTENSIONS ?=
2019-12-24 23:23:52 +03:00
2021-03-29 17:27:23 +03:00
CGO_ENABLED ?= 0
GO_BUILDFLAGS ?=
2023-05-08 20:40:42 +03:00
GO_LDFLAGS ?=
2022-04-11 20:25:11 +03:00
GOAMD64 ?= v2
2021-03-29 17:27:23 +03:00
2021-05-13 13:28:38 +03:00
WITH_RACE ?= false
WITH_DEBUG ?= false
2021-03-29 17:27:23 +03:00
2021-05-26 17:20:54 +03:00
i f n e q ( , $( filter $ ( WITH_RACE ) , t true TRUE y yes 1) )
2021-03-29 17:27:23 +03:00
CGO_ENABLED = 1
GO_BUILDFLAGS += -race
GO_LDFLAGS += -linkmode= external -extldflags '-static'
2021-05-31 20:30:01 +03:00
INSTALLER_ARCH = targetarch
2021-03-29 17:27:23 +03:00
e n d i f
2021-05-26 17:20:54 +03:00
i f n e q ( , $( filter $ ( WITH_DEBUG ) , t true TRUE y yes 1) )
2021-05-13 11:56:26 +03:00
GO_BUILDFLAGS += -tags sidero.debug
2021-05-17 12:39:27 +03:00
e l s e
GO_LDFLAGS += -s -w
2021-05-13 11:56:26 +03:00
e n d i f
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)
2022-03-23 10:49:07 +03:00
COMMON_ARGS += --build-arg= GOIMPORTS_VERSION = $( GOIMPORTS_VERSION)
2021-04-12 15:34:48 +03:00
COMMON_ARGS += --build-arg= STRINGER_VERSION = $( STRINGER_VERSION)
2021-12-30 15:57:32 +03:00
COMMON_ARGS += --build-arg= ENUMER_VERSION = $( ENUMER_VERSION)
2021-07-07 18:12:53 +03:00
COMMON_ARGS += --build-arg= DEEPCOPY_GEN_VERSION = $( DEEPCOPY_GEN_VERSION)
2021-08-09 14:46:00 +03:00
COMMON_ARGS += --build-arg= VTPROTOBUF_VERSION = $( VTPROTOBUF_VERSION)
2023-06-07 21:26:51 +03:00
COMMON_ARGS += --build-arg= IMPORTVET_VERSION = $( IMPORTVET_VERSION)
2022-01-26 16:02:31 +03:00
COMMON_ARGS += --build-arg= GOLANGCILINT_VERSION = $( GOLANGCILINT_VERSION)
2022-05-12 17:50:39 +03:00
COMMON_ARGS += --build-arg= DEEPCOPY_VERSION = $( DEEPCOPY_VERSION)
2023-02-16 13:38:22 +03:00
COMMON_ARGS += --build-arg= MARKDOWNLINTCLI_VERSION = $( MARKDOWNLINTCLI_VERSION)
COMMON_ARGS += --build-arg= TEXTLINT_VERSION = $( TEXTLINT_VERSION)
COMMON_ARGS += --build-arg= TEXTLINT_FILTER_RULE_COMMENTS_VERSION = $( TEXTLINT_FILTER_RULE_COMMENTS_VERSION)
COMMON_ARGS += --build-arg= TEXTLINT_RULE_ONE_SENTENCE_PER_LINE_VERSION = $( TEXTLINT_RULE_ONE_SENTENCE_PER_LINE_VERSION)
2019-12-23 21:36:14 +03:00
COMMON_ARGS += --build-arg= TAG = $( TAG)
2021-08-10 22:49:33 +03:00
COMMON_ARGS += --build-arg= SOURCE_DATE_EPOCH = $( SOURCE_DATE_EPOCH)
2019-12-27 23:49:24 +03:00
COMMON_ARGS += --build-arg= ARTIFACTS = $( ARTIFACTS)
2019-11-01 07:55:58 +03:00
COMMON_ARGS += --build-arg= TESTPKGS = $( TESTPKGS)
2021-05-31 20:30:01 +03:00
COMMON_ARGS += --build-arg= INSTALLER_ARCH = $( INSTALLER_ARCH)
2021-03-29 17:27:23 +03:00
COMMON_ARGS += --build-arg= CGO_ENABLED = $( CGO_ENABLED)
COMMON_ARGS += --build-arg= GO_BUILDFLAGS = " $( GO_BUILDFLAGS) "
COMMON_ARGS += --build-arg= GO_LDFLAGS = " $( GO_LDFLAGS) "
2022-04-11 20:25:11 +03:00
COMMON_ARGS += --build-arg= GOAMD64 = " $( GOAMD64) "
2020-02-20 14:33:12 +03:00
COMMON_ARGS += --build-arg= http_proxy = $( http_proxy)
COMMON_ARGS += --build-arg= https_proxy = $( https_proxy)
2022-03-28 12:07:37 +03:00
COMMON_ARGS += --build-arg= NAME = $( NAME)
COMMON_ARGS += --build-arg= SHA = $( SHA)
COMMON_ARGS += --build-arg= USERNAME = $( USERNAME)
COMMON_ARGS += --build-arg= REGISTRY = $( REGISTRY)
COMMON_ARGS += --build-arg= ABBREV_TAG = $( ABBREV_TAG)
2019-04-24 04:52:31 +03:00
2020-07-23 21:21:42 +03:00
CI_ARGS ?=
2021-12-03 14:18:59 +03:00
all : initramfs kernel installer imager talosctl talosctl -image 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 )
2022-08-08 12:19:13 +03:00
- crane (https : //github .com /google /go -containerregistry /blob /main /cmd /crane /README .md )
2019-12-24 23:23:52 +03:00
## 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
2021-02-24 15:43:27 +03:00
registry "$(IMAGE_REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(REGISTRY_AND_USERNAME)/image : $( IMAGE_TAG ) ).
2022-03-15 10:37:13 +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 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
2019-12-24 23:23:52 +03:00
r e s p e c t i v e l y .
2021-03-29 17:27:23 +03:00
## Race Detector
B u i l d i n g w i t h ` WITH_RACE = 1` enables race detector in the Talos executables. Integration tests are always built with the race detector
e n a b l e d .
2019-12-24 23:23:52 +03:00
e n d e f
export HELP_MENU_HEADER
help : ## This help menu.
@echo " $$ HELP_MENU_HEADER "
2021-03-19 15:46:39 +03:00
@grep -E '^[a-zA-Z0-9%_-]+:.*?## .*$$' $( MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2019-12-24 23:23:52 +03:00
# 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
2022-03-21 13:18:58 +03:00
hack-test-% : ## Runs the specified 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
2021-04-01 19:46:54 +03:00
generate : ## Generates code from protobuf service definitions and machinery config.
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
2022-03-28 18:00:24 +03:00
.PHONY : docs -preview
2022-04-08 16:04:31 +03:00
docs-preview : ## Starts a local preview of the documentation using Hugo in docker
@docker run --rm --interactive --tty \
--volume $( PWD) :/src --workdir /src/website \
--publish 1313:1313 \
klakegg/hugo:0.95.0-ext-alpine \
server
2022-03-28 18:00:24 +03:00
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.
2021-02-16 22:30:26 +03:00
@$( MAKE) local-$@ DEST = $( ARTIFACTS) PUSH = false
2019-12-24 23:23:52 +03:00
@-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.
2021-02-16 22:30:26 +03:00
@$( MAKE) local-$@ DEST = $( ARTIFACTS) PUSH = false TARGET_ARGS = "--allow security.insecure"
2018-12-20 09:22:05 +03:00
2019-12-24 23:23:52 +03:00
.PHONY : installer
2021-12-03 14:18:59 +03:00
installer : ## Builds the container image for the installer and outputs it to the registry.
@INSTALLER_ARCH= targetarch \
$( MAKE) registry-$@ TARGET_ARGS = "--allow security.insecure"
.PHONY : imager
imager : ## Builds the container image for the imager and outputs it to the registry.
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
2021-12-03 14:18:59 +03:00
talos : ## Builds the Talos container image and outputs it to the registry.
2020-09-26 00:00:43 +03:00
@$( MAKE) registry-$@ TARGET_ARGS = "--allow security.insecure"
2018-12-20 09:22:05 +03:00
2021-03-18 19:46:32 +03:00
.PHONY : talosctl -image
2021-12-03 14:18:59 +03:00
talosctl-image : ## Builds the talosctl container image and outputs it to the registry.
2021-03-18 19:46:32 +03:00
@$( MAKE) registry-talosctl TARGET_ARGS = "--allow security.insecure"
2023-05-26 19:49:04 +03:00
talosctl-all :
@$( MAKE) local-talosctl-all DEST = $( ARTIFACTS) PUSH = false NAME = Client
2019-12-24 23:23:52 +03:00
2023-05-26 19:49:04 +03:00
talosctl-linux-amd64 :
@$( MAKE) local-talosctl-linux-amd64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
talosctl-linux-arm64 :
@$( MAKE) local-talosctl-linux-arm64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
talosctl-darwin-amd64 :
@$( MAKE) local-talosctl-darwin-amd64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
talosctl-darwin-arm64 :
@$( MAKE) local-talosctl-darwin-arm64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
talosctl-freebsd-amd64 :
@$( MAKE) local-talosctl-freebsd-amd64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
taloscl-freebsd-arm64 :
@$( MAKE) local-talosctl-freebsd-arm64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
talosctl-windows-amd64 :
@$( MAKE) local-talosctl-windows-amd64 DEST = $( ARTIFACTS) PUSH = false NAME = Client
talosctl :
2023-05-25 19:10:29 +03:00
@$( MAKE) local-talosctl-targetarch DEST = $( ARTIFACTS)
uki-certs :
@$( MAKE) local-uki-certs DEST = $( ARTIFACTS) /uki-certs
uki :
@$( MAKE) local-uki DEST = $( ARTIFACTS)
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)
2021-12-03 14:18:59 +03:00
@docker pull $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG)
2022-06-07 16:47:32 +03:00
@ . ./hack/imager.sh && \
for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
arch = $$ ( basename " $$ {platform} " ) && \
tmpdir = $$ ( prepare_extension_images " $$ {platform} " $( IMAGER_SYSTEM_EXTENSIONS) ) && \
docker run --rm -v /dev:/dev -v " $$ {tmpdir}:/system/extensions " --privileged $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG) image --platform $* --arch $$ arch --tar-to-stdout $( IMAGER_ARGS) | tar xz -C $( ARTIFACTS) ; \
rm -rf " $$ {tmpdir} " ; \
2021-04-16 14:33:34 +03:00
done
2019-11-01 07:55:58 +03:00
2021-12-24 21:30:07 +03:00
images-essential : image -aws image -gcp image -metal ## Builds only essential images used in the CI (AWS, GCP, and Metal).
2022-10-23 09:17:26 +03:00
images : image -aws image -azure image -digital -ocean image -exoscale image -gcp image -hcloud image -metal image -nocloud image -openstack image -oracle image -scaleway image -upcloud image -vmware image -vultr ## Builds all known images (AWS, Azure, DigitalOcean, Exoscale, GCP, HCloud, Metal, NoCloud, Openstack, Oracle, Scaleway, UpCloud, Vultr and VMware).
2019-04-05 07:34:58 +03:00
2022-09-23 06:49:32 +03:00
sbc-% : ## Builds the specified SBC image. Valid options are rpi_4, rpi_generic, rock64, bananapi_m64, libretech_all_h3_cc_h5, rockpi_4, rockpi_4c, pine64, jetson_nano and nanopi_r4s (e.g. sbc-rpi_4)
2021-12-03 14:18:59 +03:00
@docker pull $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG)
2022-06-07 16:47:32 +03:00
@ . ./hack/imager.sh && \
tmpdir = $$ ( prepare_extension_images linux/arm64 $( IMAGER_SYSTEM_EXTENSIONS) ) && \
docker run --rm -v /dev:/dev -v " $$ {tmpdir}:/system/extensions " --privileged $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG) image --platform metal --arch arm64 --board $* --tar-to-stdout $( IMAGER_ARGS) | tar xz -C $( ARTIFACTS) ; \
rm -rf " $$ {tmpdir} "
2020-12-01 05:52:23 +03:00
2022-09-23 06:49:32 +03:00
sbcs : sbc -rpi_ 4 sbc -rpi_generic sbc -rock 64 sbc -bananapi_m 64 sbc -libretech_all_h 3_cc_h 5 sbc -rockpi_ 4 sbc -rockpi_ 4c sbc -pine 64 sbc -jetson_nano sbc -nanopi_r 4s ## Builds all known SBC images (Raspberry Pi 4 Model B, Rock64, Banana Pi M64, Radxa ROCK Pi 4, Radxa ROCK Pi 4c, Pine64, Libre Computer Board ALL-H3-CC, Jetson Nano and Nano Pi R4S).
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.
2021-12-03 14:18:59 +03:00
@docker pull $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG)
2021-04-16 14:33:34 +03:00
@for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
arch = ` basename " $$ {platform} " ` ; \
2022-05-25 16:28:51 +03:00
docker run --rm -e SOURCE_DATE_EPOCH = $( SOURCE_DATE_EPOCH) -i $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG) iso --arch $$ arch --tar-to-stdout $( IMAGER_ARGS) | tar xz -C $( ARTIFACTS) ; \
2021-04-16 14:33:34 +03:00
done
2020-11-01 00:03:56 +03:00
2023-05-30 23:45:05 +03:00
.PHONY : iso -uki
iso-uki : ## Builds UEFI only ISO which uses UKI and outputs it to the artifact directory.
@docker pull $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG)
@for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
arch = ` basename " $$ {platform} " ` ; \
docker run --rm -e SOURCE_DATE_EPOCH = $( SOURCE_DATE_EPOCH) -i $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG) iso --arch $$ arch --uki --tar-to-stdout $( IMAGER_ARGS) | tar xz -C $( ARTIFACTS) ; \
done
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-*/
2020-12-11 23:22:56 +03:00
.PHONY : cloud -images
cloud-images : ## Uploads cloud images (AMIs, etc.) to the cloud registry.
@docker run --rm -v $( PWD) :/src -w /src \
2023-05-19 20:24:00 +03:00
-e TAG = $( TAG) -e ARTIFACTS = $( ARTIFACTS) -e ABBREV_TAG = $( ABBREV_TAG) \
2020-12-11 23:22:56 +03:00
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SVC_ACCT \
-e AZURE_SVC_ACCT -e GCE_SVC_ACCT -e PACKET_AUTH_TOKEN \
2023-05-19 20:24:00 +03:00
-e AZURE_SUBSCRIPTION_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e AZURE_TENANT_ID \
2020-12-11 23:22:56 +03:00
golang:$( GO_VERSION) \
./hack/cloud-image-uploader.sh
2019-12-24 23:23:52 +03:00
# Code Quality
2019-02-19 19:41:41 +03:00
2021-11-29 20:45:31 +03:00
api-descriptors : ## Generates API descriptors used to detect breaking API changes.
@$( MAKE) local-api-descriptors DEST = ./ PLATFORM = linux/amd64
2021-11-23 18:03:38 +03:00
fmt-go : ## Formats the source code.
2022-11-02 14:06:45 +03:00
@docker run --rm -it -v $( PWD) :/src -w /src golang:$( GO_VERSION) bash -c " go install golang.org/x/tools/cmd/goimports@ $( GOIMPORTS_VERSION) && goimports -w -local github.com/siderolabs/talos . && go install mvdan.cc/gofumpt@ $( GOFUMPT_VERSION) && gofumpt -w . "
2019-04-28 22:06:03 +03:00
2021-11-23 18:03:38 +03:00
fmt-protobuf : ## Formats protobuf files.
@$( MAKE) local-fmt-protobuf DEST = ./ PLATFORM = linux/amd64
fmt : ## Formats the source code and protobuf files.
@$( MAKE) fmt-go fmt-protobuf
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
2022-09-27 13:40:50 +03:00
lint : ## Runs linters on go, vulncheck, protobuf, and markdown file types.
@$( MAKE) lint-go lint-vulncheck lint-protobuf lint-markdown
2019-12-24 23:23:52 +03:00
2020-04-07 22:49:12 +03:00
check-dirty : ## Verifies that source tree is not dirty
2023-06-30 22:23:28 +03:00
@if test -n "`git status --porcelain`" ; then echo "Source tree is dirty" ; git status; git diff; exit 1 ; fi
2020-04-07 22:49:12 +03:00
2022-05-31 21:42:11 +03:00
go-mod-outdated : ## Runs the go-mod-oudated to show outdated dependencies.
2023-04-10 14:09:39 +03:00
@$( MAKE) target-go-mod-outdated PLATFORM = linux/amd64
2022-05-31 21:42:11 +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 :
2023-01-24 14:30:01 +03:00
@$( MAKE) local-$( INTEGRATION_TEST_DEFAULT_TARGET) DEST = $( ARTIFACTS) PLATFORM = linux/amd64 WITH_RACE = true NAME = Client PUSH = false
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 :
2021-03-29 17:27:23 +03:00
@$( MAKE) local-$( INTEGRATION_TEST_PROVISION_DEFAULT_TARGET) DEST = $( ARTIFACTS) PLATFORM = linux/amd64 WITH_RACE = true NAME = Client
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
2023-04-10 14:09:39 +03:00
$(ARTIFACTS)/$(MODULE_SIG_VERIFY_DEFAULT_TARGET)-amd64 :
@$( MAKE) local-$( MODULE_SIG_VERIFY_DEFAULT_TARGET) DEST = $( ARTIFACTS) PLATFORM = linux/amd64
2020-01-24 07:52:02 +03:00
$(ARTIFACTS)/kubectl :
@mkdir -p $( ARTIFACTS)
@curl -L -o $( ARTIFACTS) /kubectl " $( KUBECTL_URL) "
@chmod +x $( ARTIFACTS) /kubectl
2022-01-21 16:37:13 +03:00
$(ARTIFACTS)/kubestr :
@mkdir -p $( ARTIFACTS)
@curl -L " $( KUBESTR_URL) " | tar xzf - -C $( ARTIFACTS) kubestr
@chmod +x $( ARTIFACTS) /kubestr
2022-07-08 23:50:19 +03:00
$(ARTIFACTS)/helm :
@mkdir -p $( ARTIFACTS)
@curl -L " $( HELM_URL) " | tar xzf - -C $( ARTIFACTS) --strip-components= 1 linux-amd64/helm
@chmod +x $( ARTIFACTS) /helm
2020-04-29 22:24:07 +03:00
$(ARTIFACTS)/clusterctl :
@mkdir -p $( ARTIFACTS)
@curl -L -o $( ARTIFACTS) /clusterctl " $( CLUSTERCTL_URL) "
@chmod +x $( ARTIFACTS) /clusterctl
2023-03-02 18:49:50 +03:00
$(ARTIFACTS)/cilium :
@mkdir -p $( ARTIFACTS)
@curl -L " $( CILIUM_CLI_URL) " | tar xzf - -C $( ARTIFACTS) cilium
@chmod +x $( ARTIFACTS) /cilium
2023-04-10 14:09:39 +03:00
external-artifacts : $( ARTIFACTS ) /kubectl $( ARTIFACTS ) /clusterctl $( ARTIFACTS ) /kubestr $( ARTIFACTS ) /helm $( ARTIFACTS ) /cilium $( ARTIFACTS ) /$( MODULE_SIG_VERIFY_DEFAULT_TARGET ) -amd 64
2023-03-20 09:59:24 +03:00
e2e-% : $( ARTIFACTS ) /$( INTEGRATION_TEST_DEFAULT_TARGET ) -amd 64 external -artifacts ## 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) \
2021-02-24 15:43:27 +03:00
REGISTRY = $( IMAGE_REGISTRY) \
2021-08-16 18:23:39 +03:00
IMAGE = $( REGISTRY_AND_USERNAME) /talos:$( IMAGE_TAG) \
INSTALLER_IMAGE = $( REGISTRY_AND_USERNAME) /installer:$( IMAGE_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 \
2023-04-10 14:09:39 +03:00
MODULE_SIG_VERIFY = $( PWD) /$( ARTIFACTS) /$( MODULE_SIG_VERIFY_DEFAULT_TARGET) -amd64 \
KERNEL_MODULE_SIGNING_PUBLIC_KEY = $( PWD) /$( ARTIFACTS) /signing_key.x509 \
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 \
2022-01-21 16:37:13 +03:00
KUBESTR = $( PWD) /$( ARTIFACTS) /kubestr \
2022-07-08 23:50:19 +03:00
HELM = $( PWD) /$( ARTIFACTS) /helm \
2023-03-02 18:49:50 +03:00
CLUSTERCTL = $( PWD) /$( ARTIFACTS) /clusterctl \
CILIUM_CLI = $( PWD) /$( ARTIFACTS) /cilium
2020-04-29 22:24:07 +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) \
2021-03-12 17:40:17 +03:00
REGISTRY = $( IMAGE_REGISTRY) \
ARTIFACTS = $( ARTIFACTS)
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) /
2021-12-03 14:18:59 +03:00
@case " $* " in \
vmlinuz) \
2022-03-23 20:02:22 +03:00
curl -L -o " $( ARTIFACTS) / $( TALOS_RELEASE) / $* " " https://github.com/siderolabs/talos/releases/download/ $( TALOS_RELEASE) /vmlinuz-amd64 " \
2020-10-23 23:59:50 +03:00
; ; \
2021-12-03 14:18:59 +03:00
initramfs.xz) \
2022-03-23 20:02:22 +03:00
curl -L -o " $( ARTIFACTS) / $( TALOS_RELEASE) / $* " " https://github.com/siderolabs/talos/releases/download/ $( TALOS_RELEASE) /initramfs-amd64.xz " \
2020-10-23 23:59:50 +03:00
; ; \
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.
2023-02-16 13:38:22 +03:00
docker run --rm -it -v $( PWD) :/src -w /src ghcr.io/siderolabs/conform:latest enforce
2020-04-11 03:06:59 +03:00
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 )
2021-02-24 15:43:27 +03:00
@docker login --username " $( GHCR_USERNAME) " --password " $( GHCR_PASSWORD) " $( IMAGE_REGISTRY)
2020-02-13 23:07:36 +03:00
e n d i f
2019-04-12 09:40:30 +03:00
2021-12-03 14:18:59 +03:00
push : login ## Pushes the installer, imager, talos and talosctl images to the configured container registry with the generated tag.
2020-09-26 00:00:43 +03:00
@$( MAKE) installer PUSH = true
2021-12-03 14:18:59 +03:00
@$( MAKE) imager PUSH = true
2020-09-26 00:00:43 +03:00
@$( MAKE) talos PUSH = true
2021-03-18 19:46:32 +03:00
@$( MAKE) talosctl-image PUSH = true
2020-01-01 21:28:44 +03:00
2021-12-03 14:18:59 +03:00
push-% : login ## Pushes the installer, imager, talos and talosctl 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)
2023-04-20 18:20:13 +03:00
.PHONY : image -list
image-list : ## Prints a list of all images built by this Makefile with digests.
@echo -n installer talos imager talosctl | xargs -d ' ' -I{ } sh -c 'echo $(REGISTRY_AND_USERNAME)/{}:$(IMAGE_TAG)' | xargs -I{ } sh -c 'echo {}@$$(crane digest {})'
.PHONY : sign -images
sign-images : ## Run cosign to sign all images built by this Makefile.
@$( MAKE) --quiet image-list | xargs -I{ } sh -c 'cosign sign --yes {}'
.PHONY : reproducibility -test
reproducibility-test :
@$( MAKE) reproducibility-test-local-initramfs
@$( MAKE) reproducibility-test-docker-installer INSTALLER_ARCH = targetarch PLATFORM = linux/amd64
@$( MAKE) reproducibility-test-docker-talos reproducibility-test-docker-imager reproducibility-test-docker-talosctl PLATFORM = linux/amd64
reproducibility-test-docker-% :
@rm -rf _out1/ _out2/
@mkdir -p _out1/ _out2/
@$( MAKE) docker-$* DEST = _out1/
@$( MAKE) docker-$* DEST = _out2/ TARGET_ARGS = "--no-cache"
@find _out1/ -type f | xargs -IFILE diffoscope FILE ` echo FILE | sed 's/_out1/_out2/' `
@rm -rf _out1/ _out2/
reproducibility-test-local-% :
@rm -rf _out1/ _out2/
@mkdir -p _out1/ _out2/
@$( MAKE) local-$* DEST = _out1/
@$( MAKE) local-$* DEST = _out2/ TARGET_ARGS = "--no-cache"
@find _out1/ -type f | xargs -IFILE diffoscope FILE ` echo FILE | sed 's/_out1/_out2/' `
@rm -rf _out1/ _out2/