From c4396d0ae597153dc01a6a1abe08ad81b342c17a Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Wed, 6 Dec 2023 11:54:44 +0100 Subject: [PATCH 1/9] ci(chart-verification): add node_image input for kind cluster step --- .github/workflows/chart-verification.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index 9442c63c1..fe6476355 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -21,6 +21,13 @@ name: Verify and Test Helm Chart on: workflow_dispatch: + inputs: + node_image: + description: 'kindest/node image for k8s kind cluster' + # k8s version from 3.1 release as default + default: 'kindest/node:v1.27.3' + required: false + type: string pull_request: paths: - 'charts/managed-identity-wallet/**' @@ -132,7 +139,8 @@ jobs: - name: Kubernetes KinD Cluster uses: container-tools/kind-action@v2 with: - node_image: 'kindest/node:v1.27.3' + # default value for event_name != workflow_dispatch + node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }} version: v0.20.0 - name: Build image From c47e4f9b271f3b68b4c4c5b616f9ac5f74d7a7a0 Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 11:38:11 +0100 Subject: [PATCH 2/9] chore(helm): update chart lock Ran `helm dependency update charts/managed-identity-wallet` --- charts/managed-identity-wallet/Chart.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/managed-identity-wallet/Chart.lock b/charts/managed-identity-wallet/Chart.lock index 45fec3516..4ca5f7780 100644 --- a/charts/managed-identity-wallet/Chart.lock +++ b/charts/managed-identity-wallet/Chart.lock @@ -4,9 +4,9 @@ dependencies: version: 15.1.6 - name: common repository: https://charts.bitnami.com/bitnami - version: 2.8.0 + version: 2.13.3 - name: postgresql repository: https://charts.bitnami.com/bitnami version: 11.9.13 -digest: sha256:4ec5952d86e68eb97bc393404e52e5a7371eed72d769440d1fa549c8db8b4a3b -generated: "2023-08-21T23:08:36.120845+02:00" +digest: sha256:d26187a3896751774a3c7646c6a12186aae20fbde5a705ca458c1aeac9bf361c +generated: "2023-12-11T11:38:02.235024+01:00" From a00d3856b01b18f729d123a712bb72342c446e3c Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 11:39:16 +0100 Subject: [PATCH 3/9] ci(chart-verification): add `upgrade_from` input to chart workflow --- .github/workflows/chart-verification.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index fe6476355..029daeb51 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -28,6 +28,12 @@ on: default: 'kindest/node:v1.27.3' required: false type: string + upgrade_from: + description: 'chart version to upgrade from' + # chart version from 3.1 release as default + default: '0.2.0' + required: false + type: string pull_request: paths: - 'charts/managed-identity-wallet/**' From a5f2c8443f3cf9f49ac18f9680deb6d32bda0a30 Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 12:25:34 +0100 Subject: [PATCH 4/9] ci(chart-verification): add tractusx-dev repo to workflow --- .github/workflows/chart-verification.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index 029daeb51..fd84df767 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -120,9 +120,10 @@ jobs: distribution: 'temurin' java-version: '17' - - name: Add bitnami repo + - name: Add bitnami and tractusx-dev repos run: | helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev helm repo update - name: Update Helm dependencies From ce09c2ed6025ee1368b47a3c8c134724ab45748b Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 12:28:21 +0100 Subject: [PATCH 5/9] ci(chart-verification): add chart-testing step (list-changed) --- .github/workflows/chart-verification.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index fd84df767..06ae25068 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -157,5 +157,24 @@ jobs: push: true tags: kind-registry:5000/miw:testing - - name: Install the chart on KinD cluster - run: helm install -n apps --create-namespace --wait --set image.tag=testing --set=image.repository=kind-registry:5000/miw testing charts/managed-identity-wallet + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + check-latest: true + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.3.1 + + # ct list-changed will output all charts which have changed compared to the target-branch + # Example: + # Our branch has update the charts/managed-identity-wallet + # When we compare with main/develop + # We get the output + # > charts/managed-identity-wallet + # and subsequently set the variable `changed=true` + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + fi From 2ad2620b7dcc8b52ca98f3bd9b93a2ef522dbafe Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 12:36:43 +0100 Subject: [PATCH 6/9] ci(chart-verification): prepare stub for chart-testing (install) --- .github/workflows/chart-verification.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index 06ae25068..1928c3e11 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -178,3 +178,9 @@ jobs: if [[ -n "$changed" ]]; then echo "changed=true" >> $GITHUB_OUTPUT fi + + # TODO: update the ci/all-values.yaml file before enabling this step + - name: Run chart-testing (install) + run: ct install --charts charts/managed-identity-wallet + # if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true' + if: false From 4a9c3b454aa8387dbe9cbba72c83e52b8178d47e Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 12:47:02 +0100 Subject: [PATCH 7/9] ci(chart-verification): add a step to install distributed chart --- .github/workflows/chart-verification.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index 1928c3e11..d8b2f63f5 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -184,3 +184,21 @@ jobs: run: ct install --charts charts/managed-identity-wallet # if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true' if: false + + # command breakdown + # install: install the chart effectively creating a release + # install arg 1 (testing): the name of the release + # install arg 2 (tractusx-dev/managed-identity-wallet): the chart to install (in this case the official one from the dev repo) + # -n/--namespace: the namespace to use when installing + # --create-namespace: create the release namespace if it doesn't exist + # --wait: wait for all resources to start + # --version: The chart version to install + - name: Install the default chart on KinD cluster + run: | + helm install \ + testing \ + tractusx-dev/managed-identity-wallet \ + -n apps \ + --create-namespace \ + --wait \ + --version ${{ github.event.inputs.upgrade_from || '0.2.0' }} From e0315f273fc7763085ab485c7cb8395b9d270dcd Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Mon, 11 Dec 2023 12:47:52 +0100 Subject: [PATCH 8/9] ci(chart-verification): add a step to upgrade to latest chart version --- .github/workflows/chart-verification.yml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/chart-verification.yml b/.github/workflows/chart-verification.yml index d8b2f63f5..ffdc2c8ca 100644 --- a/.github/workflows/chart-verification.yml +++ b/.github/workflows/chart-verification.yml @@ -202,3 +202,35 @@ jobs: --create-namespace \ --wait \ --version ${{ github.event.inputs.upgrade_from || '0.2.0' }} + + # command breakdown + # helm dependency update: update chart dependencies based on the content of Chart.yaml + # update arg1 (charts/managed-identity-wallet): the location of Chart.yaml + # -n/--namespace apps: run in the `apps` namespace + # --- + # helm upgrade: upgrade a release + # upgrade arg1 (testing): the name of the release to upgrade + # upgrade arg2 (charts/managed-identity-wallet): the location of Chart.yaml + # -n/--namespace apps: run in the `apps` namespace + # --wait: wait for all pods, services etc. ro run + # --set image.tag=testing: overwrite the image.tag value to be `testing` + # --set image.repository=kind-registry:5000/miw: overwrite the image.repository value to be `kind-registry:5000/miw` + # --- + # NOTE: the overwritten values for the image are used to ensure we use the latest chart version, which was + # built during the workflow run. + - name: Run helm upgrade + run: | + helm dependency \ + update \ + charts/managed-identity-wallet \ + -n apps + + helm upgrade \ + testing \ + charts/managed-identity-wallet \ + -n apps \ + --wait \ + --set image.tag=testing \ + --set image.repository=kind-registry:5000/miw + # only run if this is not a PR -OR- if there are new versions available + if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true' From 337f393470f2be96642d9c10af7392f739c5ab2c Mon Sep 17 00:00:00 2001 From: Boris Rizov Date: Tue, 12 Dec 2023 10:00:07 +0100 Subject: [PATCH 9/9] chore(helm): udpate helm docs --- charts/managed-identity-wallet/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/managed-identity-wallet/README.md b/charts/managed-identity-wallet/README.md index bf1616852..da27ba496 100644 --- a/charts/managed-identity-wallet/README.md +++ b/charts/managed-identity-wallet/README.md @@ -2,7 +2,7 @@ # managed-identity-wallet -![Version: 0.2.0-develop.11](https://img.shields.io/badge/Version-0.2.0--develop.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.0-develop.11](https://img.shields.io/badge/AppVersion-0.2.0--develop.11-informational?style=flat-square) +![Version: 0.4.0-develop.1](https://img.shields.io/badge/Version-0.4.0--develop.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.0-develop.1](https://img.shields.io/badge/AppVersion-0.4.0--develop.1-informational?style=flat-square) Managed Identity Wallet is supposed to supply a secure data source and data sink for Digital Identity Documents (DID), in order to enable Self-Sovereign Identity founding on those DIDs. And at the same it shall support an uninterrupted tracking and tracing and documenting the usage of those DIDs, e.g. within logistical supply chains.