Skip to content

Commit

Permalink
feat: pull in new Talos machinery
Browse files Browse the repository at this point in the history
Pull in new Talos machinery, drop dependency on alpine and add required
tools from pkgs.

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Mar 5, 2025
1 parent c6e3fa6 commit c7f207d
Show file tree
Hide file tree
Showing 8 changed files with 459 additions and 308 deletions.
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2025-01-16T11:42:04Z by kres 3b3f992.
# Generated on 2025-03-05T06:26:46Z by kres 1281806.

# options for analysis running
run:
Expand Down Expand Up @@ -133,7 +133,6 @@ linters:
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
- goimports # same as gci
- musttag # seems to be broken - goes into imported libraries and reports issues there
- exportloopref # WARN The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.

issues:
exclude: [ ]
Expand Down
159 changes: 135 additions & 24 deletions .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,161 @@ spec:
GOOS: linux
GOARCH: arm64
---
kind: golang.Toolchain
spec:
makefile:
extraVariables:
- name: PKGS_PREFIX
defaultValue: ghcr.io/siderolabs
- name: PKGS
defaultValue: v1.10.0-alpha.0-49-g347ad26
docker:
extraArgs:
- PKGS_PREFIX
- PKGS
---
kind: common.Docker
spec:
extraBuildArgs:
- PKGS_PREFIX
- PKGS
---
kind: common.Image
name: image-image-factory
spec:
baseImage: alpine:3.20.3
extraEnvironment:
PLATFORM: linux/amd64,linux/arm64
additionalImages: []
additionalImages: [] # so we copy same fhs and ca-certificates as the version of other tools
allowedLocalPaths:
- tailwind.config.js
- package.json
- package-lock.json
dependsOn:
- tailwind
customCommands:
- apk add --no-cache --update
bash
cpio
dosfstools
e2fsprogs
efibootmgr
kmod
mtools
pigz
qemu-img
squashfs-tools
tar
util-linux
xfsprogs
xorriso
xz
zstd
entrypoint: /usr/bin/image-factory
copyFrom:
- stage: ghcr.io/siderolabs/grub:v1.9.0
- name: pkg-fhs
stage: ${PKGS_PREFIX}/fhs:${PKGS}
source: /
destination: /
- name: pkg-ca-certificates
stage: ${PKGS_PREFIX}/ca-certificates:${PKGS}
source: /
destination: /
- stage: ghcr.io/siderolabs/grub@sha256:4aea36c88627add06512a14c7e571b43405b6eeeca0a8ad295b8c4e31bf57721 # amd64
- name: pkg-musl
stage: ${PKGS_PREFIX}/musl:${PKGS}
source: /
destination: /
- name: pkg-cpio
stage: ${PKGS_PREFIX}/cpio:${PKGS}
source: /
destination: /
- name: pkg-dosfstools
stage: ${PKGS_PREFIX}/dosfstools:${PKGS}
source: /
destination: /
- name: pkg-grub
stage: ${PKGS_PREFIX}/grub:${PKGS}
source: /
destination: /
- name: pkg-grub-amd64
stage: ${PKGS_PREFIX}/grub:${PKGS}
platform: linux/amd64
source: /usr/lib/grub
destination: /usr/lib/grub
- stage: ghcr.io/siderolabs/grub@sha256:d82f11c8a7dc61fcdcc1d93d9550a1624eb291829a90700983e1c5b1a3b6cc26 # arm64
- name: pkg-grub-arm64
stage: ${PKGS_PREFIX}/grub:${PKGS}
platform: linux/arm64
source: /usr/lib/grub
destination: /usr/lib/grub
- stage: ghcr.io/siderolabs/installer:v1.9.0-alpha.2
- name: pkg-grub-unicode
stage: ghcr.io/siderolabs/installer:v1.9.4
source: /usr/share/grub/unicode.pf2
destination: /usr/share/grub/unicode.pf2
- name: pkg-kmod
stage: ${PKGS_PREFIX}/kmod:${PKGS}
source: /
destination: /
- name: pkg-libattr
stage: ${PKGS_PREFIX}/libattr:${PKGS}
source: /
destination: /
- name: pkg-lininih
stage: ${PKGS_PREFIX}/libinih:${PKGS}
source: /
destination: /
- name: pkg-liblzma
stage: ${PKGS_PREFIX}/liblzma:${PKGS}
source: /
destination: /
- name: pkg-linurcu
stage: ${PKGS_PREFIX}/liburcu:${PKGS}
source: /
destination: /
- name: pkg-openssl
stage: ${PKGS_PREFIX}/openssl:${PKGS}
source: /
destination: /
- name: pkg-xfsprogs
stage: ${PKGS_PREFIX}/xfsprogs:${PKGS}
source: /
destination: /
- name: pkg-e2fsprogs
stage: ${PKGS_PREFIX}/e2fsprogs:${PKGS}
source: /
destination: /
- name: pkg-glib
stage: ${PKGS_PREFIX}/glib:${PKGS}
source: /
destination: /
- name: pkg-linburn
stage: ${PKGS_PREFIX}/libburn:${PKGS}
source: /
destination: /
- name: pkg-libisoburn
stage: ${PKGS_PREFIX}/libisoburn:${PKGS}
source: /
destination: /
- name: pkg-linisofs
stage: ${PKGS_PREFIX}/libisofs:${PKGS}
source: /
destination: /
- name: pkg-mtools
stage: ${PKGS_PREFIX}/mtools:${PKGS}
source: /
destination: /
- name: pkg-pcre2
stage: ${PKGS_PREFIX}/pcre2:${PKGS}
source: /
destination: /
- name: pkg-pigz
stage: ${PKGS_PREFIX}/pigz:${PKGS}
source: /
destination: /
- name: pkg-qemu-tools
stage: ${PKGS_PREFIX}/qemu-tools:${PKGS}
source: /
destination: /
- name: pkg-squashfs-tools
stage: ${PKGS_PREFIX}/squashfs-tools:${PKGS}
source: /
destination: /
- name: pkg-tar
stage: ${PKGS_PREFIX}/tar:${PKGS}
source: /
destination: /
- name: pkg-xz
stage: ${PKGS_PREFIX}/xz:${PKGS}
source: /
destination: /
- name: pkg-zlib
stage: ${PKGS_PREFIX}/zlib:${PKGS}
source: /
destination: /
- name: pkg-zstd
stage: ${PKGS_PREFIX}/zstd:${PKGS}
source: /
destination: /
---
kind: auto.CustomSteps
spec:
Expand Down
113 changes: 99 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,82 @@
# syntax = docker/dockerfile-upstream:1.12.1-labs
# syntax = docker/dockerfile-upstream:1.14.0-labs

# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2025-01-16T11:42:04Z by kres 3b3f992.
# Generated on 2025-03-05T16:03:37Z by kres e2c7efe.

ARG TOOLCHAIN

FROM alpine:3.20.3 AS base-image-image-factory
ARG PKGS_PREFIX
ARG PKGS

# runs markdownlint
FROM docker.io/oven/bun:1.1.43-alpine AS lint-markdown
FROM docker.io/oven/bun:1.2.4-alpine AS lint-markdown
WORKDIR /src
RUN bun i markdownlint-cli@0.43.0 [email protected]
RUN bun i markdownlint-cli@0.44.0 [email protected]
COPY .markdownlint.json .
COPY ./CHANGELOG.md ./CHANGELOG.md
COPY ./README.md ./README.md
RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules sentences-per-line .

FROM ${PKGS_PREFIX}/ca-certificates:${PKGS} AS pkg-ca-certificates

FROM ${PKGS_PREFIX}/cpio:${PKGS} AS pkg-cpio

FROM ${PKGS_PREFIX}/dosfstools:${PKGS} AS pkg-dosfstools

FROM ${PKGS_PREFIX}/e2fsprogs:${PKGS} AS pkg-e2fsprogs

FROM ${PKGS_PREFIX}/fhs:${PKGS} AS pkg-fhs

FROM ${PKGS_PREFIX}/glib:${PKGS} AS pkg-glib

FROM ${PKGS_PREFIX}/grub:${PKGS} AS pkg-grub

FROM --platform=linux/amd64 ${PKGS_PREFIX}/grub:${PKGS} AS pkg-grub-amd64

FROM --platform=linux/arm64 ${PKGS_PREFIX}/grub:${PKGS} AS pkg-grub-arm64

FROM ghcr.io/siderolabs/installer:v1.9.4 AS pkg-grub-unicode

FROM ${PKGS_PREFIX}/kmod:${PKGS} AS pkg-kmod

FROM ${PKGS_PREFIX}/libattr:${PKGS} AS pkg-libattr

FROM ${PKGS_PREFIX}/libisoburn:${PKGS} AS pkg-libisoburn

FROM ${PKGS_PREFIX}/liblzma:${PKGS} AS pkg-liblzma

FROM ${PKGS_PREFIX}/libburn:${PKGS} AS pkg-linburn

FROM ${PKGS_PREFIX}/libinih:${PKGS} AS pkg-lininih

FROM ${PKGS_PREFIX}/libisofs:${PKGS} AS pkg-linisofs

FROM ${PKGS_PREFIX}/liburcu:${PKGS} AS pkg-linurcu

FROM ${PKGS_PREFIX}/mtools:${PKGS} AS pkg-mtools

FROM ${PKGS_PREFIX}/musl:${PKGS} AS pkg-musl

FROM ${PKGS_PREFIX}/openssl:${PKGS} AS pkg-openssl

FROM ${PKGS_PREFIX}/pcre2:${PKGS} AS pkg-pcre2

FROM ${PKGS_PREFIX}/pigz:${PKGS} AS pkg-pigz

FROM ${PKGS_PREFIX}/qemu-tools:${PKGS} AS pkg-qemu-tools

FROM ${PKGS_PREFIX}/squashfs-tools:${PKGS} AS pkg-squashfs-tools

FROM ${PKGS_PREFIX}/tar:${PKGS} AS pkg-tar

FROM ${PKGS_PREFIX}/xfsprogs:${PKGS} AS pkg-xfsprogs

FROM ${PKGS_PREFIX}/xz:${PKGS} AS pkg-xz

FROM ${PKGS_PREFIX}/zlib:${PKGS} AS pkg-zlib

FROM ${PKGS_PREFIX}/zstd:${PKGS} AS pkg-zstd

# Installs tailwindcss
FROM docker.io/node:21.7.3-alpine3.19 AS tailwind-base
WORKDIR /src
Expand Down Expand Up @@ -166,14 +226,39 @@ FROM scratch AS image-factory-all
COPY --from=image-factory-linux-amd64 / /
COPY --from=image-factory-linux-arm64 / /

FROM base-image-image-factory AS image-image-factory
RUN apk add --no-cache --update bash cpio dosfstools e2fsprogs efibootmgr kmod mtools pigz qemu-img squashfs-tools tar util-linux xfsprogs xorriso xz zstd
FROM scratch AS image-image-factory
ARG TARGETARCH
COPY --from=image-factory image-factory-linux-${TARGETARCH} /image-factory
COPY --from=ghcr.io/siderolabs/grub:v1.9.0 / /
COPY --from=ghcr.io/siderolabs/grub@sha256:4aea36c88627add06512a14c7e571b43405b6eeeca0a8ad295b8c4e31bf57721 /usr/lib/grub /usr/lib/grub
COPY --from=ghcr.io/siderolabs/grub@sha256:d82f11c8a7dc61fcdcc1d93d9550a1624eb291829a90700983e1c5b1a3b6cc26 /usr/lib/grub /usr/lib/grub
COPY --from=ghcr.io/siderolabs/installer:v1.9.0-alpha.2 /usr/share/grub/unicode.pf2 /usr/share/grub/unicode.pf2
COPY --from=image-factory image-factory-linux-${TARGETARCH} /usr/bin/image-factory
COPY --from=pkg-fhs / /
COPY --from=pkg-ca-certificates / /
COPY --from=pkg-musl / /
COPY --from=pkg-cpio / /
COPY --from=pkg-dosfstools / /
COPY --from=pkg-grub / /
COPY --from=pkg-grub-amd64 /usr/lib/grub /usr/lib/grub
COPY --from=pkg-grub-arm64 /usr/lib/grub /usr/lib/grub
COPY --from=pkg-grub-unicode /usr/share/grub/unicode.pf2 /usr/share/grub/unicode.pf2
COPY --from=pkg-kmod / /
COPY --from=pkg-libattr / /
COPY --from=pkg-lininih / /
COPY --from=pkg-liblzma / /
COPY --from=pkg-linurcu / /
COPY --from=pkg-openssl / /
COPY --from=pkg-xfsprogs / /
COPY --from=pkg-e2fsprogs / /
COPY --from=pkg-glib / /
COPY --from=pkg-linburn / /
COPY --from=pkg-libisoburn / /
COPY --from=pkg-linisofs / /
COPY --from=pkg-mtools / /
COPY --from=pkg-pcre2 / /
COPY --from=pkg-pigz / /
COPY --from=pkg-qemu-tools / /
COPY --from=pkg-squashfs-tools / /
COPY --from=pkg-tar / /
COPY --from=pkg-xz / /
COPY --from=pkg-zlib / /
COPY --from=pkg-zstd / /
LABEL org.opencontainers.image.source=https://github.com/siderolabs/image-factory
ENTRYPOINT ["/image-factory"]
ENTRYPOINT ["/usr/bin/image-factory"]

18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2025-02-03T09:51:10Z by kres 987bf4d.
# Generated on 2025-03-05T13:09:39Z by kres e2c7efe.

# common variables

Expand All @@ -17,15 +17,15 @@ WITH_RACE ?= false
REGISTRY ?= ghcr.io
USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
PROTOBUF_GO_VERSION ?= 1.36.2
PROTOBUF_GO_VERSION ?= 1.36.5
GRPC_GO_VERSION ?= 1.5.1
GRPC_GATEWAY_VERSION ?= 2.25.1
GRPC_GATEWAY_VERSION ?= 2.26.3
VTPROTOBUF_VERSION ?= 0.6.0
GOIMPORTS_VERSION ?= 0.29.0
GOIMPORTS_VERSION ?= 0.30.0
DEEPCOPY_VERSION ?= v0.5.6
GOLANGCILINT_VERSION ?= v1.63.4
GOLANGCILINT_VERSION ?= v1.64.6
GOFUMPT_VERSION ?= v0.7.0
GO_VERSION ?= 1.23.5
GO_VERSION ?= 1.24.1
GO_BUILDFLAGS ?=
GO_LDFLAGS ?=
CGO_ENABLED ?= 0
Expand Down Expand Up @@ -69,10 +69,14 @@ COMMON_ARGS += --build-arg=DEEPCOPY_VERSION="$(DEEPCOPY_VERSION)"
COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION="$(GOLANGCILINT_VERSION)"
COMMON_ARGS += --build-arg=GOFUMPT_VERSION="$(GOFUMPT_VERSION)"
COMMON_ARGS += --build-arg=TESTPKGS="$(TESTPKGS)"
TOOLCHAIN ?= docker.io/golang:1.23-alpine
COMMON_ARGS += --build-arg=PKGS_PREFIX="$(PKGS_PREFIX)"
COMMON_ARGS += --build-arg=PKGS="$(PKGS)"
TOOLCHAIN ?= docker.io/golang:1.24-alpine

# extra variables

PKGS_PREFIX ?= ghcr.io/siderolabs
PKGS ?= v1.10.0-alpha.0-49-g347ad26
RUN_TESTS ?= TestIntegration
TEST_FLAGS ?=

Expand Down
Loading

0 comments on commit c7f207d

Please sign in to comment.