feat: build Talos with support for x86-64-v2 microarchitecture
See https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support This relies on new Go 1.18 feature to use more efficient x86-64 instructions. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
parent
8faebd410b
commit
a4060513c6
24
Dockerfile
24
Dockerfile
@ -278,7 +278,8 @@ FROM base AS init-build-amd64
|
||||
WORKDIR /src/internal/app/init
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /init
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 GOAMD64=${GOAMD64} go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /init
|
||||
RUN chmod +x /init
|
||||
|
||||
FROM base AS init-build-arm64
|
||||
@ -299,7 +300,8 @@ FROM base AS machined-build-amd64
|
||||
WORKDIR /src/internal/app/machined
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /machined
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 GOAMD64=${GOAMD64} go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /machined
|
||||
RUN chmod +x /machined
|
||||
|
||||
FROM base AS machined-build-arm64
|
||||
@ -320,7 +322,8 @@ FROM base AS talosctl-linux-amd64-build
|
||||
WORKDIR /src/cmd/talosctl
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talosctl-linux-amd64
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 GOAMD64=${GOAMD64} go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talosctl-linux-amd64
|
||||
RUN chmod +x /talosctl-linux-amd64
|
||||
|
||||
FROM base AS talosctl-linux-arm64-build
|
||||
@ -355,7 +358,8 @@ FROM base AS talosctl-darwin-amd64-build
|
||||
WORKDIR /src/cmd/talosctl
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talosctl-darwin-amd64
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 GOAMD64=${GOAMD64} go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talosctl-darwin-amd64
|
||||
RUN chmod +x /talosctl-darwin-amd64
|
||||
|
||||
FROM base AS talosctl-darwin-arm64-build
|
||||
@ -373,7 +377,8 @@ FROM base AS talosctl-windows-amd64-build
|
||||
WORKDIR /src/cmd/talosctl
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=windows GOARCH=amd64 go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talosctl-windows-amd64.exe
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=windows GOARCH=amd64 GOAMD64=${GOAMD64} go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talosctl-windows-amd64.exe
|
||||
|
||||
FROM scratch AS talosctl-windows
|
||||
COPY --from=talosctl-windows-amd64-build /talosctl-windows-amd64.exe /talosctl-windows-amd64.exe
|
||||
@ -655,7 +660,8 @@ RUN --security=insecure --mount=type=cache,id=testspace,target=/tmp --mount=type
|
||||
FROM base AS integration-test-linux-build
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go test -v -c ${GO_BUILDFLAGS} \
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 GOAMD64=${GOAMD64} go test -v -c ${GO_BUILDFLAGS} \
|
||||
-ldflags "${GO_LDFLAGS}" \
|
||||
-tags integration,integration_api,integration_cli,integration_k8s \
|
||||
./internal/integration
|
||||
@ -666,7 +672,8 @@ COPY --from=integration-test-linux-build /src/integration.test /integration-test
|
||||
FROM base AS integration-test-darwin-build
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 go test -v -c ${GO_BUILDFLAGS} \
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 GOAMD64=${GOAMD64} go test -v -c ${GO_BUILDFLAGS} \
|
||||
-ldflags "${GO_LDFLAGS}" \
|
||||
-tags integration,integration_api,integration_cli,integration_k8s \
|
||||
./internal/integration
|
||||
@ -679,7 +686,8 @@ COPY --from=integration-test-darwin-build /src/integration.test /integration-tes
|
||||
FROM base AS integration-test-provision-linux-build
|
||||
ARG GO_BUILDFLAGS
|
||||
ARG GO_LDFLAGS
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go test -v -c ${GO_BUILDFLAGS} \
|
||||
ARG GOAMD64
|
||||
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 GOAMD64=${GOAMD64} go test -v -c ${GO_BUILDFLAGS} \
|
||||
-ldflags "${GO_LDFLAGS}" \
|
||||
-tags integration,integration_provision \
|
||||
./internal/integration
|
||||
|
2
Makefile
2
Makefile
@ -44,6 +44,7 @@ INSTALLER_ARCH ?= all
|
||||
CGO_ENABLED ?= 0
|
||||
GO_BUILDFLAGS ?=
|
||||
GO_LDFLAGS ?=
|
||||
GOAMD64 ?= v2
|
||||
|
||||
WITH_RACE ?= false
|
||||
WITH_DEBUG ?= false
|
||||
@ -90,6 +91,7 @@ COMMON_ARGS += --build-arg=INSTALLER_ARCH=$(INSTALLER_ARCH)
|
||||
COMMON_ARGS += --build-arg=CGO_ENABLED=$(CGO_ENABLED)
|
||||
COMMON_ARGS += --build-arg=GO_BUILDFLAGS="$(GO_BUILDFLAGS)"
|
||||
COMMON_ARGS += --build-arg=GO_LDFLAGS="$(GO_LDFLAGS)"
|
||||
COMMON_ARGS += --build-arg=GOAMD64="$(GOAMD64)"
|
||||
COMMON_ARGS += --build-arg=http_proxy=$(http_proxy)
|
||||
COMMON_ARGS += --build-arg=https_proxy=$(https_proxy)
|
||||
COMMON_ARGS += --build-arg=NAME=$(NAME)
|
||||
|
@ -22,6 +22,8 @@ preface = """\
|
||||
* Kubernetes: 1.24.0-beta.0
|
||||
* Flannel: 0.17.0
|
||||
* runc: 1.1.1
|
||||
|
||||
Talos is built with Go 1.18.
|
||||
"""
|
||||
|
||||
[notes.eudev]
|
||||
@ -76,6 +78,13 @@ plugins:
|
||||
```
|
||||
|
||||
The policy is part of the Talos machine configuration, and it can be modified to suite your needs.
|
||||
"""
|
||||
|
||||
[notes.x86_64]
|
||||
title = "x86-64 Architecture"
|
||||
description="""\
|
||||
Talos is built for x86-64 architecture with support for [x86-64-v2 microarchitecture level](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels),
|
||||
so Talos no longer runs on processors supporting only baseline `x86-64` microarchitecture (before 2009).
|
||||
"""
|
||||
|
||||
[make_deps]
|
||||
|
Loading…
Reference in New Issue
Block a user