Auto-increment chart versions for Istio

Enable auto-versioning of helm charts to ensure the FluxCD
helm controller recognizes chart changes.
Istio App has two upstream charts -
1. Istio
2. Kiali
Changes are done such that both the charts are incremented

Test Plan:
PASS: Build all packages generating an application tarball verifying
      all versions on the charts and application make sense.
PASS: Introduce temporary chart changes and ensure that the versions
      increment as expected.
PASS: Validate basic application lifecycle operations:
      upload/apply/remove/delete.

Story: 2010929
Task: 49906

Change-Id: Iec66a4298293e3e270d8322bf7ae4ab5407ba7ac
Signed-off-by: Aman Pandae <AmanPandae.Mothukuri@windriver.com>
This commit is contained in:
Aman Pandae
2024-04-19 05:50:52 -04:00
parent 245357e2ff
commit 221cc28d53
35 changed files with 108 additions and 219 deletions

View File

@@ -1,4 +1,4 @@
istio-helm
kiali-helm
helm-charts/upstream/istio-helm
helm-charts/upstream/kiali-helm
python3-k8sapp-istio
stx-istio-helm

View File

@@ -0,0 +1,5 @@
istio-helm (1.19-4) unstable; urgency=medium
* Auto-increment chart version
-- Aman Pandae <amanpandae.mothukuri@windriver.com> Thu, 2 May 2024 07:00:00 +0000

View File

@@ -3,9 +3,7 @@ Section: libs
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
chartmuseum,
helm,
procps
helm
Standards-Version: 4.5.1
Homepage: https://www.starlingx.io

View File

@@ -0,0 +1,33 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export ROOT = debian/tmp
export CHART_FOLDER = $(ROOT)/usr/lib/helm
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export PATCH_VERSION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export CHART_BASE_VERSION = $(shell echo $(DEB_VERSION) | sed 's/-/./' | cut -d '.' -f 1-3)
export CHART_VERSION = $(CHART_BASE_VERSION)+STX.$(PATCH_VERSION)
%:
dh $@
override_dh_auto_build:
mkdir -p istio-operator
#Copy istio-operator chart
cp -r manifests/charts/* istio-operator
# Set up chart build files.
cp Makefile istio-operator
# Create the TGZ file.
cd istio-operator && make CHART_VERSION=$(CHART_VERSION) istio-operator
override_dh_auto_install:
# Install the app tar file.
install -d -m 755 $(CHART_FOLDER)
install -p -D -m 755 istio-operator/istio-operator*.tgz $(CHART_FOLDER)
override_dh_auto_test:

View File

@@ -0,0 +1,15 @@
---
debname: istio-helm
debver: 1.19-4
dl_path:
name: helm-charts-istio-1.19.4.tar.gz
url: https://github.com/istio/istio/archive/refs/tags/1.19.4.tar.gz
sha256sum: 5a3a1b8c5d0092a00d1b19247cbd066307ddff1bc8f8c2551a97cc8e36035a79
src_files:
- files/Makefile
revision:
dist: $STX_DIST
stx_patch: -1
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-istio/helm-charts/upstream/istio-helm
BASE_SRCREV: 245357e2ff1271c5451b6b369fb7dc894a04f962

View File

@@ -1,7 +1,7 @@
#
# Copyright 2017 The Openstack-Helm Authors.
#
# Copyright (c) 2012 Wind River Systems, Inc.
# Copyright (c) 2022-2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -9,8 +9,8 @@
SHELL := /bin/bash
TASK := build
EXCLUDES := helm-toolkit doc tests tools logs tmp
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
EXCLUDES := doc tests tools logs tmp
CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
.PHONY: $(EXCLUDES) $(CHARTS)
@@ -25,18 +25,16 @@ $(CHARTS):
init-%:
if [ -f $*/Makefile ]; then make -C $*; fi
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
lint-%: init-%
if [ -d $* ]; then helm lint $*; fi
build-%:
if [ -d $* ]; then helm package $*; fi
if [ -d $* ]; then helm package --version $(CHART_VERSION) $*; fi
clean:
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
%:

View File

@@ -0,0 +1,5 @@
kiali-helm (1.75-0) unstable; urgency=medium
* Auto-increment chart version
-- Aman Pandae <amanpandae.mothukuri@windriver.com> Thu, 2 May 2024 07:00:00 +0000

View File

@@ -3,7 +3,7 @@ Upstream-Name: kiali-helm
Source: https://opendev.org/starlingx/app-istio/
Files: *
Copyright: (c) 2013-2022 Wind River Systems, Inc
Copyright: (c) 2024 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -4,13 +4,18 @@
export ROOT = debian/tmp
export CHART_FOLDER = $(ROOT)/usr/lib/helm
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export PATCH_VERSION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export CHART_BASE_VERSION = $(shell echo $(DEB_VERSION) | sed 's/-/./' | cut -d '.' -f 1-3)
export CHART_VERSION = $(CHART_BASE_VERSION)+STX.$(PATCH_VERSION)
%:
dh $@
override_dh_auto_build:
# Create the TGZ file.
apt install curl -y
make build-helm-charts
make build-helm-charts VERSION=$(CHART_VERSION)
override_dh_auto_install:
# Install the app tar file.

View File

@@ -1,16 +1,13 @@
---
debname: kiali-helm
debver: 1.0-1
debver: 1.75-0
dl_path:
name: helm-charts-kiali-1.75.0.tar.gz
url: https://github.com/kiali/helm-charts/archive/refs/tags/v1.75.0.tar.gz
md5sum: a17439c758fee987372588b7f664f9e6
sha256sum: 3273056128742685a869e0d8dca8fca57651407810be7b61e5b49742f3120c55
src_files:
- files/index.yaml
- files/repositories.yaml
revision:
dist: $STX_DIST
stx_patch: -1
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-istio/kiali-helm
BASE_SRCREV: 28fb552abeb93fce220528fa4e29027f8ff394f6
SRC_DIR: ${MY_REPO}/stx/app-istio/helm-charts/upstream/kiali-helm
BASE_SRCREV: 245357e2ff1271c5451b6b369fb7dc894a04f962

View File

@@ -1,5 +0,0 @@
istio-helm (1.0-1) unstable; urgency=medium
* Initial release.
-- Teresa Ho <teresa.ho@windriver.com> Thu, 31 Mar 2022 08:40:22 +0000

View File

@@ -1,29 +0,0 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export ROOT = debian/tmp
export CHART_FOLDER = $(ROOT)/usr/lib/helm
export ISTIO_VERSION = 1.19.4
%:
dh $@
override_dh_auto_build:
# Host a server for the helm charts.
chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" \
--storage-local-rootdir="." &
sleep 2
helm repo add local http://localhost:8879/charts
# Set up chart build files.
cp Makefile manifests/charts
find . -type f -name "Chart.yaml" -exec sed -i -e '/version/ s/:.*/: ${ISTIO_VERSION}/' {} \;
# Create the TGZ file.
cd manifests/charts && make istio-operator
pkill chartmuseum
override_dh_auto_install:
# Install the app tar file.
install -d -m 755 $(CHART_FOLDER)
install -p -D -m 755 manifests/charts/*.tgz $(CHART_FOLDER)
override_dh_auto_test:

View File

@@ -1,16 +0,0 @@
---
debname: istio-helm
debver: 1.0-1
dl_path:
name: helm-charts-istio-1.19.4.tar.gz
url: https://github.com/istio/istio/archive/refs/tags/1.19.4.tar.gz
md5sum: b958c3f637a41e0ae2a508de9de59894
src_files:
- files/index.yaml
- files/Makefile
- files/repositories.yaml
revision:
dist: $STX_DIST
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-istio/istio-helm
BASE_SRCREV: 28fb552abeb93fce220528fa4e29027f8ff394f6

View File

@@ -1,43 +0,0 @@
#
# Copyright 2017 The Openstack-Helm Authors.
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash
TASK := build
EXCLUDES := helm-toolkit doc tests tools logs tmp
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
.PHONY: $(EXCLUDES) $(CHARTS)
all: $(CHARTS)
$(CHARTS):
@if [ -d $@ ]; then \
echo; \
echo "===== Processing [$@] chart ====="; \
make $(TASK)-$@; \
fi
init-%:
if [ -f $*/Makefile ]; then make -C $*; fi
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
lint-%: init-%
if [ -d $* ]; then helm lint $*; fi
build-%:
if [ -d $* ]; then helm package $*; fi
clean:
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
%:
@:

View File

@@ -1,3 +0,0 @@
apiVersion: v1
entries: {}
generated: 2019-01-07T12:33:46.098166523-06:00

View File

@@ -1,12 +0,0 @@
apiVersion: v1
generated: 2019-01-02T15:19:36.215111369-06:00
repositories:
- caFile: ""
cache: /builddir/.helm/repository/cache/local-index.yaml
certFile: ""
keyFile: ""
name: local
password: ""
url: http://127.0.0.1:8879/charts
username: ""

View File

@@ -1,5 +0,0 @@
kiali-helm (1.0-1) unstable; urgency=medium
* Initial release.
-- Teresa Ho <teresa.ho@windriver.com> Thu, 31 Mar 2022 08:40:22 +0000

View File

@@ -1,3 +0,0 @@
apiVersion: v1
entries: {}
generated: 2019-01-07T12:33:46.098166523-06:00

View File

@@ -1,12 +0,0 @@
apiVersion: v1
generated: 2019-01-02T15:19:36.215111369-06:00
repositories:
- caFile: ""
cache: /builddir/.helm/repository/cache/local-index.yaml
certFile: ""
keyFile: ""
name: local
password: ""
url: http://127.0.0.1:8879/charts
username: ""

View File

@@ -1,3 +1,9 @@
stx-istio-helm (1.0-2) unstable; urgency=medium
* Update package to automatically version itself
-- Aman Pandae <amanpandae.mothukuri@windriver.com> Tue, 30 Apr 2024 08:00:00 +0000
stx-istio-helm (1.0-1) unstable; urgency=medium
* Initial release.

View File

@@ -5,10 +5,6 @@ Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
istio-helm,
kiali-helm,
chartmuseum,
helm,
procps,
python3-k8sapp-istio,
python3-k8sapp-istio-wheels,
build-info
Standards-Version: 4.5.1
@@ -19,4 +15,4 @@ Section: libs
Architecture: any
Depends: ${misc:Depends}
Description: StarlingX Istio Helm Charts
This package contains helm charts for the Istio application.
This package contains manifests for the Istio application.

View File

@@ -3,7 +3,7 @@ Upstream-Name: stx-istio-helm
Source: https://opendev.org/starlingx/app-istio/
Files: *
Copyright: (c) 2013-2022 Wind River Systems, Inc
Copyright: (c) 2013-2024 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -11,6 +11,7 @@ export REVISION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export APP_NAME = istio
export APP_VERSION = $(RELEASE)-$(REVISION)
export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz
export HELM_FOLDER = /usr/lib/helm
export HELM_REPO = stx-platform
export STAGING = staging
@@ -24,16 +25,32 @@ override_dh_auto_build:
cp -R fluxcd-manifests $(STAGING)
mkdir -p $(STAGING)/charts
cp /usr/lib/helm/*.tgz $(STAGING)/charts
# Adjust the helmrelease yamls based on the chart versions
for c in $(STAGING)/charts/*; do \
chart=$$(basename $$c .tgz); \
chart_name=$${chart%-*}; \
chart_version=$${chart##*-}; \
echo "Found $$chart; name: $$chart_name, version: $$chart_version"; \
chart_manifest=$$(find $(STAGING)/fluxcd-manifests -name helmrelease.yaml -exec grep -q "chart:.*$$chart_name" {} \; -print); \
echo "Updating manifest: $$chart_manifest"; \
sed -i "s/REPLACE_HELM_CHART_VERSION/$$chart_version/g" $$chart_manifest; \
grep version $$chart_manifest; \
done
# Populate metadata.
sed -i 's/APP_REPLACE_NAME/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/APP_REPLACE_VERSION/$(APP_VERSION)/g' $(STAGING)/metadata.yaml
sed -i 's/HELM_REPLACE_REPO/$(HELM_REPO)/g' $(STAGING)/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p $(STAGING)/plugins
cp /plugins/*.whl $(STAGING)/plugins
# Create the app package.
cd $(STAGING) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar cfz $(APP_TARBALL) -C $(STAGING)/ .
# Cleanup staging
rm -rf $(STAGING)

View File

@@ -1,6 +1,6 @@
---
debname: stx-istio-helm
debver: 1.0-1
debver: 1.0-2
src_path: stx-istio-helm
revision:
dist: $STX_DIST

View File

@@ -1,3 +0,0 @@
apiVersion: v1
entries: {}
generated: 2019-01-07T12:33:46.098166523-06:00

View File

@@ -1,12 +0,0 @@
apiVersion: v1
generated: 2019-01-02T15:19:36.215111369-06:00
repositories:
- caFile: ""
cache: /builddir/.helm/repository/cache/local-index.yaml
certFile: ""
keyFile: ""
name: local
password: ""
url: http://127.0.0.1:8879/charts
username: ""

View File

@@ -11,11 +11,11 @@ metadata:
labels:
chart_group: istio-charts
spec:
releaseName: istio-istio-operator
releaseName: istio-istio-operator
chart:
spec:
chart: istio-operator
version: 1.19.4
chart: istio-operator
version: REPLACE_HELM_CHART_VERSION
sourceRef:
kind: HelmRepository
name: stx-platform

View File

@@ -11,11 +11,11 @@ metadata:
labels:
chart_group: istio-charts
spec:
releaseName: istio-kiali-server
releaseName: istio-kiali-server
chart:
spec:
chart: kiali-server
version: 1.75.0
chart: kiali-server
version: REPLACE_HELM_CHART_VERSION
sourceRef:
kind: HelmRepository
name: stx-platform

View File

@@ -1,43 +0,0 @@
#
# Copyright 2017 The Openstack-Helm Authors.
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash
TASK := build
EXCLUDES := helm-toolkit doc tests tools logs tmp
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
.PHONY: $(EXCLUDES) $(CHARTS)
all: $(CHARTS)
$(CHARTS):
@if [ -d $@ ]; then \
echo; \
echo "===== Processing [$@] chart ====="; \
make $(TASK)-$@; \
fi
init-%:
if [ -f $*/Makefile ]; then make -C $*; fi
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
lint-%: init-%
if [ -d $* ]; then helm lint $*; fi
build-%: lint-%
if [ -d $* ]; then helm package $*; fi
clean:
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
%:
@: