2024-10-03 20:24:08 +03:00
REGISTRY ?= gitea.basealt.ru
USERNAME ?= talos
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)
2021-03-29 17:27:23 +03:00
NAME = Talos
2019-12-23 21:36:14 +03:00
2023-08-08 17:55:23 +03:00
CLOUD_IMAGES_EXTRA_ARGS ?= ""
2024-04-26 16:32:15 +03:00
ZSTD_COMPRESSION_LEVEL ?= 18
2023-08-08 17:55:23 +03:00
2024-08-30 19:55:45 +03:00
CI_RELEASE_TAG := $( shell git log --oneline --format= %B -n 1 HEAD^2 -- 2>/dev/null | head -n 1 | sed -r " /^release\(.*\)/ s/^release\((.*)\):.* $$ /\\1/; t; Q " )
2024-07-05 15:16:36 +03:00
2019-12-24 23:23:52 +03:00
ARTIFACTS := _out
2024-02-03 21:31:06 +03:00
2024-10-03 20:24:08 +03:00
PKGS_PREFIX ?= gitea.basealt.ru/talos
2024-09-06 14:46:52 +03:00
EXTRAS ?= v1.8.0
2024-02-03 21:31:06 +03:00
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-tags depName=golang/go
2024-02-09 20:52:58 +03:00
GO_VERSION ?= 1.22
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=golang.org/x/tools
2024-08-29 19:44:37 +03:00
GOIMPORTS_VERSION ?= v0.24.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=mvdan.cc/gofumpt
2024-08-29 19:44:37 +03:00
GOFUMPT_VERSION ?= v0.7.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/golangci/golangci-lint
2024-08-29 19:44:37 +03:00
GOLANGCILINT_VERSION ?= v1.60.3
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=golang.org/x/tools
2024-08-07 20:02:52 +03:00
STRINGER_VERSION ?= v0.24.0
2024-02-09 20:52:58 +03:00
# renovate: datasource=go depName=github.com/dmarkham/enumer
2024-08-07 20:02:52 +03:00
ENUMER_VERSION ?= v1.5.10
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=k8s.io/code-generator
2024-08-29 19:44:37 +03:00
DEEPCOPY_GEN_VERSION ?= v0.31.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/planetscale/vtprotobuf
2024-02-09 17:42:50 +03:00
VTPROTOBUF_VERSION ?= v0.6.0
2023-01-23 17:32:50 +03:00
# renovate: datasource=go depName=github.com/siderolabs/deep-copy
2024-02-09 20:52:58 +03:00
DEEPCOPY_VERSION ?= v0.5.6
2023-06-07 21:26:51 +03:00
# renovate: datasource=go depName=github.com/siderolabs/importvet
2024-02-09 20:52:58 +03:00
IMPORTVET_VERSION ?= v0.2.0
2024-08-20 17:10:43 +03:00
# not setting renovate config since the repo is archived
PROTOTOOL_VERSION ?= v1.10.0
# renovate: datasource=go depName=github.com/pseudomuto/protoc-gen-doc
PROTOC_GEN_DOC_VERSION ?= v1.5.1
2023-02-16 13:38:22 +03:00
# renovate: datasource=npm depName=markdownlint-cli
2024-05-08 13:59:41 +03:00
MARKDOWNLINTCLI_VERSION ?= 0.40.0
2023-02-16 13:38:22 +03:00
# renovate: datasource=npm depName=textlint
2024-04-03 09:37:25 +03:00
TEXTLINT_VERSION ?= 14.0.4
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
2023-11-07 08:25:45 +03:00
# renovate: datasource=docker depName=klakegg/hugo
2024-03-28 19:56:13 +03:00
HUGO_VERSION ?= 0.111.3-ext-alpine
2019-12-24 23:23:52 +03:00
OPERATING_SYSTEM := $( shell uname -s | tr "[:upper:]" "[:lower:]" )
2023-07-27 11:50:06 +03:00
ARCH := $( shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/' )
2020-06-14 02:43:22 +03:00
TALOSCTL_DEFAULT_TARGET := talosctl-$( OPERATING_SYSTEM)
2023-07-27 11:50:06 +03:00
TALOSCTL_EXECUTABLE := $( PWD) /$( ARTIFACTS) /$( TALOSCTL_DEFAULT_TARGET) -$( ARCH)
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)
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=kubernetes/kubernetes
2024-10-25 17:20:10 +03:00
KUBECTL_VERSION ?= v1.31.2
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=kastenhq/kubestr
2024-08-29 19:44:37 +03:00
KUBESTR_VERSION ?= v0.4.46
2023-01-23 17:32:50 +03:00
# renovate: datasource=github-releases depName=helm/helm
2024-08-29 19:44:37 +03:00
HELM_VERSION ?= v3.15.4
2023-03-02 18:49:50 +03:00
# renovate: datasource=github-releases depName=cilium/cilium-cli
2024-08-29 19:44:37 +03:00
CILIUM_CLI_VERSION ?= v0.16.16
2024-07-29 17:58:14 +03:00
# renovate: datasource=github-releases depName=microsoft/secureboot_objects
MICROSOFT_SECUREBOOT_RELEASE ?= v1.1.3
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
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/...
2024-04-19 15:57:16 +03:00
RELEASES ?= v1.6.7 v1.7.0
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 ?=
2019-12-24 23:23:52 +03:00
2021-03-29 17:27:23 +03:00
CGO_ENABLED ?= 0
GO_BUILDFLAGS ?=
2024-02-22 13:44:58 +03:00
GO_BUILDTAGS ?= tcell_minimal,grpcnotrace
2024-09-26 15:03:15 +03:00
GO_BUILDTAGS_TALOSCTL ?= grpcnotrace
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) )
2023-10-09 14:02:00 +03:00
GO_BUILDTAGS := $( GO_BUILDTAGS) ,sidero.debug
2024-09-26 15:03:15 +03:00
GO_BUILDTAGS_TALOSCTL := $( GO_BUILDTAGS_TALOSCTL) ,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
2024-09-26 15:03:15 +03:00
GO_BUILDFLAGS_TALOSCTL := $( GO_BUILDFLAGS) -tags " $( GO_BUILDTAGS_TALOSCTL) "
2023-10-09 14:02:00 +03:00
GO_BUILDFLAGS += -tags " $( GO_BUILDTAGS) "
2020-09-26 00:00:43 +03:00
, : = ,
2020-10-30 01:08:05 +03:00
space := $( subst ,, )
2024-10-03 20:24:08 +03:00
BUILD := podman build
2019-12-23 21:36:14 +03:00
PLATFORM ?= linux/amd64
PROGRESS ?= auto
PUSH ?= false
2024-10-03 20:24:08 +03:00
COMMON_ARGS := --file= Dockerfile.alt
2019-12-23 21:36:14 +03:00
COMMON_ARGS += --platform= $( PLATFORM)
2024-10-03 20:24:08 +03:00
#COMMON_ARGS += --push=$(PUSH)
2019-12-23 21:36:14 +03:00
COMMON_ARGS += --build-arg= TOOLS = $( TOOLS)
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)
2024-08-20 17:10:43 +03:00
COMMON_ARGS += --build-arg= PROTOTOOL_VERSION = $( PROTOTOOL_VERSION)
COMMON_ARGS += --build-arg= PROTOC_GEN_DOC_VERSION = $( PROTOC_GEN_DOC_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) "
2024-09-26 15:03:15 +03:00
COMMON_ARGS += --build-arg= GO_BUILDFLAGS_TALOSCTL = " $( GO_BUILDFLAGS_TALOSCTL) "
2021-03-29 17:27:23 +03:00
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)
2024-04-26 16:32:15 +03:00
COMMON_ARGS += --build-arg= ZSTD_COMPRESSION_LEVEL = $( ZSTD_COMPRESSION_LEVEL)
2024-07-29 17:58:14 +03:00
COMMON_ARGS += --build-arg= MICROSOFT_SECUREBOOT_RELEASE = $( MICROSOFT_SECUREBOOT_RELEASE)
2019-04-24 04:52:31 +03:00
2020-07-23 21:21:42 +03:00
CI_ARGS ?=
2024-08-27 15:39:54 +03:00
EXTENSIONS_FILTER_COMMAND ?= grep -vE 'tailscale|xen-guest-agent|nvidia|vmtoolsd-guest-agent'
2024-08-22 19:00:29 +03:00
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
2023-07-27 11:50:06 +03:00
> Note : The security .insecure entitlement is only required , and used by the unit -tests target .
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.
2024-10-03 20:24:08 +03:00
@$( MAKE) target-$* TARGET_ARGS = " --output type=local,dest= $( 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 \
2023-11-07 08:25:45 +03:00
--user $( shell id -u) :$( shell id -g) \
2022-04-08 16:04:31 +03:00
--volume $( PWD) :/src --workdir /src/website \
--publish 1313:1313 \
2023-11-07 08:25:45 +03:00
klakegg/hugo:$( HUGO_VERSION) \
2022-04-08 16:04:31 +03:00
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.
2023-07-27 11:50:06 +03:00
@$( MAKE) local-$@ DEST = $( ARTIFACTS) PUSH = false
2018-12-20 09:22:05 +03:00
2023-08-03 21:18:08 +03:00
.PHONY : sd -boot
sd-boot : ## Outputs the systemd-boot to the artifact directory.
@$( MAKE) local-$@ DEST = $( ARTIFACTS) PUSH = false
.PHONY : sd -stub
sd-stub : ## Outputs the systemd-stub to the artifact directory.
@$( MAKE) local-$@ DEST = $( ARTIFACTS) PUSH = false
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 \
2023-07-27 11:50:06 +03:00
$( MAKE) registry-$@
2021-12-03 14:18:59 +03:00
.PHONY : imager
imager : ## Builds the container image for the imager and outputs it to the registry.
2023-07-27 11:50:06 +03:00
@$( MAKE) registry-$@
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.
2023-07-27 11:50:06 +03:00
@$( MAKE) registry-$@
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.
2023-07-27 11:50:06 +03:00
@$( MAKE) registry-talosctl
2021-03-18 19:46:32 +03:00
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)
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)
2023-07-27 11:50:06 +03:00
@for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
2022-06-07 16:47:32 +03:00
arch = $$ ( basename " $$ {platform} " ) && \
2024-07-30 16:25:11 +03:00
docker run --rm -t -v /dev:/dev -v $( PWD) /$( ARTIFACTS) :/secureboot:ro -v $( PWD) /$( ARTIFACTS) :/out -e SOURCE_DATE_EPOCH = $( SOURCE_DATE_EPOCH) --network= host --privileged $( REGISTRY_AND_USERNAME) /imager:$( IMAGE_TAG) $* --arch $$ arch $( IMAGER_ARGS) ; \
2021-04-16 14:33:34 +03:00
done
2019-11-01 07:55:58 +03:00
2024-03-22 18:58:32 +03:00
images-essential : image -aws image -azure image -gcp image -metal secureboot -installer ## Builds only essential images used in the CI (AWS, GCP, and Metal).
2021-12-24 21:30:07 +03:00
2024-08-16 02:54:29 +03:00
images : image -akamai image -aws image -azure image -digital -ocean image -exoscale image -cloudstack image -gcp image -hcloud image -iso image -metal image -nocloud image -opennebula image -openstack image -oracle image -scaleway image -upcloud image -vmware image -vultr ## Builds all known images (AWS, Azure, DigitalOcean, Exoscale, Cloudstack, GCP, HCloud, Metal, NoCloud, OpenNebula, OpenStack, Oracle, Scaleway, UpCloud, Vultr and VMware).
2019-04-05 07:34:58 +03:00
2020-11-01 00:03:56 +03:00
.PHONY : iso
2023-07-27 11:50:06 +03:00
iso : image -iso ## Builds the ISO and outputs it to the artifact directory.
2020-11-01 00:03:56 +03:00
2023-07-27 11:50:06 +03:00
.PHONY : secureboot -iso
secureboot-iso : image -secureboot -iso ## Builds UEFI only ISO which uses UKI and outputs it to the artifact directory.
.PHONY : secureboot -installer
secureboot-installer : ## Builds UEFI only installer which uses UKI and push it to the registry.
@$( MAKE) image-secureboot-installer IMAGER_ARGS = " --base-installer-image $( REGISTRY_AND_USERNAME) /installer: $( IMAGE_TAG) "
2023-05-30 23:45:05 +03:00
@for platform in $( subst $( ,) ,$( space) ,$( PLATFORM) ) ; do \
2023-07-27 11:50:06 +03:00
arch = $$ ( basename " $$ {platform} " ) && \
2023-08-17 21:12:36 +03:00
crane push $( ARTIFACTS) /installer-$$ { arch} -secureboot.tar $( REGISTRY_AND_USERNAME) /installer:$( IMAGE_TAG) -$$ { arch} -secureboot ; \
2023-05-30 23:45:05 +03:00
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) \
2024-04-23 21:01:44 +03:00
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
2023-05-19 20:24:00 +03:00
-e AZURE_SUBSCRIPTION_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e AZURE_TENANT_ID \
2024-09-05 19:25:57 +03:00
-e GOOGLE_PROJECT_ID -e GOOGLE_CREDENTIALS \
2020-12-11 23:22:56 +03:00
golang:$( GO_VERSION) \
2023-08-08 17:55:23 +03:00
./hack/cloud-image-uploader.sh $( CLOUD_IMAGES_EXTRA_ARGS)
2020-12-11 23:22:56 +03:00
2023-07-27 11:50:06 +03:00
.PHONY : uki -certs
uki-certs : talosctl ## Generate test certificates for SecureBoot/PCR Signing
@$( TALOSCTL_EXECUTABLE) gen secureboot uki
@$( TALOSCTL_EXECUTABLE) gen secureboot pcr
@$( TALOSCTL_EXECUTABLE) gen secureboot database
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.
2023-08-23 20:15:03 +03:00
@docker run --rm -it -v $( PWD) :/src -w /src -e GOTOOLCHAIN = local 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
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
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
2024-09-05 19:25:57 +03:00
external-artifacts : $( ARTIFACTS ) /kubectl $( ARTIFACTS ) /kubestr $( ARTIFACTS ) /helm $( ARTIFACTS ) /cilium
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 \
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
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
2024-04-23 21:01:44 +03:00
installer-with-extensions : $( ARTIFACTS ) /extensions /_out /extensions -metadata
2024-04-26 16:32:15 +03:00
$( MAKE) image-installer \
2024-08-22 19:00:29 +03:00
IMAGER_ARGS = " --base-installer-image= $( REGISTRY_AND_USERNAME) /installer: $( IMAGE_TAG) $( shell cat $( ARTIFACTS) /extensions/_out/extensions-metadata | $( EXTENSIONS_FILTER_COMMAND) | xargs -n 1 echo --system-extension-image) "
2024-04-26 16:32:15 +03:00
crane push $( ARTIFACTS) /installer-amd64.tar $( REGISTRY_AND_USERNAME) /installer:$( IMAGE_TAG) -amd64-extensions
2024-08-22 19:00:29 +03:00
INSTALLER_IMAGE_EXTENSIONS = " $( REGISTRY_AND_USERNAME) /installer: $( IMAGE_TAG) -amd64-extensions " yq eval -n '.machine.install.image = strenv(INSTALLER_IMAGE_EXTENSIONS)' > $( ARTIFACTS) /installer-extensions-patch.yaml
2024-04-26 16:32:15 +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
2024-04-23 21:01:44 +03:00
.PHONY : rekres
rekres :
@docker pull $( KRES_IMAGE)
@docker run --rm --net= host --user $( shell id -u) :$( shell id -g) -v $( PWD) :/src -w /src -e GITHUB_TOKEN $( KRES_IMAGE)
2020-04-11 03:06:59 +03:00
.PHONY : conformance
2024-04-23 21:01:44 +03:00
conformance :
@docker pull $( CONFORMANCE_IMAGE)
@docker run --rm -it -v $( PWD) :/src -w /src $( CONFORMANCE_IMAGE) 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
2024-04-23 21:01:44 +03:00
push : ## 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
2024-04-23 21:01:44 +03:00
push-% : ## 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.
2023-09-13 14:46:04 +03:00
@for image in $( shell $( MAKE) --quiet image-list REGISTRY_AND_USERNAME = $( REGISTRY_AND_USERNAME) IMAGE_TAG = $( IMAGE_TAG) ) ; do \
echo '==>' $$ image; \
cosign verify $$ image --certificate-identity-regexp '@siderolabs\.com$$' --certificate-oidc-issuer https://accounts.google.com || \
cosign sign --yes $$ image; \
done
2023-04-20 18:20:13 +03:00
.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/
2024-07-05 15:16:36 +03:00
.PHONY : ci -temp -release -tag
ci-temp-release-tag : ## Generates a temporary release tag for CI run.
@if [ -n " $( CI_RELEASE_TAG) " -a -n " $$ {GITHUB_ENV} " ] ; then \
echo Setting temporary release tag " $( CI_RELEASE_TAG) " ; \
echo " TAG= $( CI_RELEASE_TAG) " >> " $$ {GITHUB_ENV} " ; \
echo " ABBREV_TAG= $( CI_RELEASE_TAG) " >> " $$ {GITHUB_ENV} " ; \
fi