From b6814e9ee83ae2acbfa2b35a78c2bcefb14f4ab2 Mon Sep 17 00:00:00 2001 From: "Ivan.Makeev" Date: Fri, 20 Dec 2024 14:15:58 +0400 Subject: [PATCH] * make werf manifests compatible with other modules (like sds-replicated-volume) Signed-off-by: Ivan.Makeev --- .werf/consts.yaml | 16 ++++++++++++++++ .werf/images.yaml | 2 +- .werf/release.yaml | 3 ++- images/agent/werf.inc.yaml | 16 +++++----------- .../sds-health-watcher-controller/werf.inc.yaml | 4 ++-- images/sds-utils-installer/werf.inc.yaml | 16 +++++----------- werf.yaml | 1 + 7 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 .werf/consts.yaml diff --git a/.werf/consts.yaml b/.werf/consts.yaml new file mode 100644 index 00000000..65d3593c --- /dev/null +++ b/.werf/consts.yaml @@ -0,0 +1,16 @@ +# base images +{{- $_ := set $ "BASE_ALPINE_DEV" "registry.deckhouse.io/base_images/dev-alpine:3.16.3@sha256:c706fa83cc129079e430480369a3f062b8178cac9ec89266ebab753a574aca8e" }} +{{- $_ := set $ "BASE_ALT_P11" "registry.deckhouse.io/base_images/alt:p11@sha256:c396cd7348a48f9236413e2ef5569223c15e554c0a3ca37f9d92fb787d4f1893" }} +{{- $_ := set $ "BASE_GOLANG_1_22" "registry.deckhouse.io/base_images/golang:1.22.7-bullseye@sha256:e5dc67bf84590c008338a0e30f56a6ed2092a38e0d2895c797dd501db73a2330" }} +{{- $_ := set $ "BASE_SCRATCH" "registry.deckhouse.io/base_images/scratch@sha256:653ae76965c98c8cd1c8c9ff7725316d2983986f896655b30e0f44d2f8b2dd7e" }} + + +# component versions +{{- $versions := dict }} +{{- $_ := set $versions "UTIL_LINUX" "2.39.3" }} +{{- $_ := set $versions "LVM2" "d786a8f820d54ce87a919e6af5426c333c173b11" }} + +{{- $_ := set $ "VERSIONS" $versions }} + + +# custom constants diff --git a/.werf/images.yaml b/.werf/images.yaml index 0908d90a..6aa9b902 100644 --- a/.werf/images.yaml +++ b/.werf/images.yaml @@ -1,7 +1,7 @@ {{- $ImagesBuildFiles := .Files.Glob "images/*/{Dockerfile,werf.inc.yaml}" }} {{- range $path, $content := $ImagesBuildFiles }} - {{ $ctx := (dict "ImageName" ($path | split "/")._1) }} + {{ $ctx := (dict "ImageName" ($path | split "/")._1 "Root" $ "Versions" $.VERSIONS) }} --- {{- /* For Dockerfile just render it from the folder. */ -}} {{- if not (regexMatch "/werf.inc.yaml$" $path) }} diff --git a/.werf/release.yaml b/.werf/release.yaml index f1e18db7..d6bd6144 100644 --- a/.werf/release.yaml +++ b/.werf/release.yaml @@ -1,6 +1,7 @@ # Release image, stored in your.registry.io/modules//release: --- -artifact: release-channel-version-artifact +image: release-channel-version-artifact +final: false from: registry.deckhouse.io/base_images/alpine:3.16.3 shell: beforeInstall: diff --git a/images/agent/werf.inc.yaml b/images/agent/werf.inc.yaml index 0128eabe..4089e0e4 100644 --- a/images/agent/werf.inc.yaml +++ b/images/agent/werf.inc.yaml @@ -1,13 +1,7 @@ -{{- $_ := set . "BASE_GOLANG" "registry.deckhouse.io/base_images/golang:1.22.8-alpine@sha256:54bb7313917c733191a079ccae2e52bd3b80664e46c7879efa06513d4221d804" }} -{{- $_ := set . "BASE_SCRATCH" "registry.deckhouse.ru/base_images/scratch@sha256:b054705fcc9f2205777d80a558d920c0b4209efdc3163c22b5bfcb5dda1db5fc" }} -{{- $_ := set . "BASE_ALPINE_DEV" "registry.deckhouse.ru/base_images/dev-alpine:3.16.3@sha256:c706fa83cc129079e430480369a3f062b8178cac9ec89266ebab753a574aca8e" }} -{{- $_ := set . "BASE_ALT_DEV" "registry.deckhouse.ru/base_images/dev-alt:p10@sha256:76e6e163fa982f03468166203488b569e6d9fc10855d6a259c662706436cdcad" }} - {{ $binaries := "/opt/deckhouse/sds/lib/libblkid.so.1 /opt/deckhouse/sds/lib/libmount.so.1 /opt/deckhouse/sds/lib/libsmartcols.so.1 /opt/deckhouse/sds/bin/nsenter.static /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 ld-linux-x86-64.so.2 /opt/deckhouse/sds/bin/lsblk.dynamic" }} -{{ $version := "2.39.3" }} --- image: {{ $.ImageName }}-binaries-artifact -from: {{ $.BASE_ALT_DEV }} +from: {{ $.Root.BASE_ALT_P11 }} final: false shell: @@ -32,7 +26,7 @@ shell: - cd / - git clone {{ env "SOURCE_REPO" }}/util-linux/util-linux.git - cd /util-linux - - git checkout v{{ $version }} + - git checkout v{{ $.Versions.UTIL_LINUX }} - ./autogen.sh - ./configure LDFLAGS="-static" --enable-static-programs -disable-all-programs --enable-nsenter - make install-strip @@ -49,7 +43,7 @@ shell: --- image: {{ $.ImageName }}-golang-artifact -from: {{ $.BASE_GOLANG }} +from: {{ $.Root.BASE_GOLANG_1_22 }} final: false git: @@ -70,7 +64,7 @@ shell: --- image: {{ $.ImageName }}-distroless-artifact -from: {{ $.BASE_ALPINE_DEV }} +from: {{ $.Root.BASE_ALPINE_DEV }} final: false shell: @@ -88,7 +82,7 @@ shell: --- image: {{ $.ImageName }}-distroless -from: {{ $.BASE_SCRATCH }} +from: {{ $.Root.BASE_SCRATCH }} final: false import: diff --git a/images/sds-health-watcher-controller/werf.inc.yaml b/images/sds-health-watcher-controller/werf.inc.yaml index bea9b7be..f5381064 100644 --- a/images/sds-health-watcher-controller/werf.inc.yaml +++ b/images/sds-health-watcher-controller/werf.inc.yaml @@ -3,7 +3,7 @@ --- image: {{ $.ImageName }}-golang-artifact -from: {{ $.BASE_GOLANG }} +from: {{ $.Root.BASE_GOLANG_1_22 }} final: false git: @@ -26,7 +26,7 @@ shell: --- image: {{ $.ImageName }} -from: {{ $.BASE_SCRATCH }} +from: {{ $.Root.BASE_SCRATCH }} import: - image: {{ $.ImageName }}-golang-artifact diff --git a/images/sds-utils-installer/werf.inc.yaml b/images/sds-utils-installer/werf.inc.yaml index fcf6039c..c9560b48 100644 --- a/images/sds-utils-installer/werf.inc.yaml +++ b/images/sds-utils-installer/werf.inc.yaml @@ -1,13 +1,7 @@ -{{- $_ := set . "BASE_GOLANG" "registry.deckhouse.io/base_images/golang:1.22.8-alpine@sha256:54bb7313917c733191a079ccae2e52bd3b80664e46c7879efa06513d4221d804" }} -{{- $_ := set . "BASE_SCRATCH" "registry.deckhouse.ru/base_images/scratch@sha256:b054705fcc9f2205777d80a558d920c0b4209efdc3163c22b5bfcb5dda1db5fc" }} -{{- $_ := set . "BASE_ALPINE_DEV" "registry.deckhouse.ru/base_images/dev-alpine:3.16.3@sha256:c706fa83cc129079e430480369a3f062b8178cac9ec89266ebab753a574aca8e" }} -{{- $_ := set . "BASE_ALT_DEV" "registry.deckhouse.ru/base_images/dev-alt:p10@sha256:76e6e163fa982f03468166203488b569e6d9fc10855d6a259c662706436cdcad" }} - {{ $binaries := "/sds-utils/bin/lvm.static" }} -{{ $version := "d786a8f820d54ce87a919e6af5426c333c173b11" }} --- image: {{ $.ImageName }}-binaries-artifact -from: {{ $.BASE_ALT_DEV }} +from: {{ $.Root.BASE_ALT_P11 }} final: false shell: @@ -28,7 +22,7 @@ shell: - cd / - git clone {{ env "SOURCE_REPO" }}/lvmteam/lvm2.git - cd /lvm2 - - git checkout {{ $version }} + - git checkout {{ $.Versions.LVM2 }} - ./configure --enable-static_link --disable-silent-rules --disable-readline --enable-blkid_wiping --build=x86_64-linux-gnu - make - mkdir -p /sds-utils/bin/ @@ -37,7 +31,7 @@ shell: --- image: {{ $.ImageName }}-golang-artifact -from: {{ $.BASE_GOLANG }} +from: {{ $.Root.BASE_GOLANG_1_22 }} final: false git: @@ -55,7 +49,7 @@ shell: --- image: {{ $.ImageName }}-distroless-artifact -from: {{ $.BASE_ALPINE_DEV }} +from: {{ $.Root.BASE_ALPINE_DEV }} final: false shell: @@ -73,7 +67,7 @@ shell: --- image: {{ $.ImageName }}-distroless -from: {{ $.BASE_SCRATCH }} +from: {{ $.Root.BASE_SCRATCH }} final: false import: diff --git a/werf.yaml b/werf.yaml index 4fab11c4..451b8174 100644 --- a/werf.yaml +++ b/werf.yaml @@ -1,6 +1,7 @@ project: sds-node-configurator configVersion: 1 --- +{{ tpl (.Files.Get ".werf/consts.yaml") $ }} {{ tpl (.Files.Get ".werf/images.yaml") $ }} {{ tpl (.Files.Get ".werf/images-digests.yaml") $ }} {{ tpl (.Files.Get ".werf/python-deps.yaml") $ }}