Skip to content

Commit

Permalink
* make werf manifests compatible with other modules (like sds-replica…
Browse files Browse the repository at this point in the history
…ted-volume)

Signed-off-by: Ivan.Makeev <[email protected]>
  • Loading branch information
Ranger-X committed Dec 20, 2024
1 parent 22885db commit b6814e9
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
16 changes: 16 additions & 0 deletions .werf/consts.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .werf/images.yaml
Original file line number Diff line number Diff line change
@@ -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) }}
Expand Down
3 changes: 2 additions & 1 deletion .werf/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Release image, stored in your.registry.io/modules/<module-name>/release:<semver>
---
artifact: release-channel-version-artifact
image: release-channel-version-artifact
final: false
from: registry.deckhouse.io/base_images/alpine:3.16.3
shell:
beforeInstall:
Expand Down
16 changes: 5 additions & 11 deletions images/agent/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -49,7 +43,7 @@ shell:

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.BASE_GOLANG }}
from: {{ $.Root.BASE_GOLANG_1_22 }}
final: false

git:
Expand All @@ -70,7 +64,7 @@ shell:

---
image: {{ $.ImageName }}-distroless-artifact
from: {{ $.BASE_ALPINE_DEV }}
from: {{ $.Root.BASE_ALPINE_DEV }}
final: false

shell:
Expand All @@ -88,7 +82,7 @@ shell:

---
image: {{ $.ImageName }}-distroless
from: {{ $.BASE_SCRATCH }}
from: {{ $.Root.BASE_SCRATCH }}
final: false

import:
Expand Down
4 changes: 2 additions & 2 deletions images/sds-health-watcher-controller/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.BASE_GOLANG }}
from: {{ $.Root.BASE_GOLANG_1_22 }}
final: false

git:
Expand All @@ -26,7 +26,7 @@ shell:

---
image: {{ $.ImageName }}
from: {{ $.BASE_SCRATCH }}
from: {{ $.Root.BASE_SCRATCH }}

import:
- image: {{ $.ImageName }}-golang-artifact
Expand Down
16 changes: 5 additions & 11 deletions images/sds-utils-installer/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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/
Expand All @@ -37,7 +31,7 @@ shell:

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.BASE_GOLANG }}
from: {{ $.Root.BASE_GOLANG_1_22 }}
final: false

git:
Expand All @@ -55,7 +49,7 @@ shell:

---
image: {{ $.ImageName }}-distroless-artifact
from: {{ $.BASE_ALPINE_DEV }}
from: {{ $.Root.BASE_ALPINE_DEV }}
final: false

shell:
Expand All @@ -73,7 +67,7 @@ shell:

---
image: {{ $.ImageName }}-distroless
from: {{ $.BASE_SCRATCH }}
from: {{ $.Root.BASE_SCRATCH }}
final: false

import:
Expand Down
1 change: 1 addition & 0 deletions werf.yaml
Original file line number Diff line number Diff line change
@@ -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") $ }}
Expand Down

0 comments on commit b6814e9

Please sign in to comment.