diff --git a/PUBLISHING.md b/PUBLISHING.md index f085d14d9..20f6003c3 100644 --- a/PUBLISHING.md +++ b/PUBLISHING.md @@ -1,10 +1,26 @@ -# How to Publish a New Version +# Publish docker image and release helm chart -0. The code to be published should be in the `master` branch. +A business partner release consist of a helm chart which references the corresponding business-partner-agent docker image. +The release process is therefore split into two steps: Publish docker image and release helm chart. +(In some cases, we might also want to publish only a new docker image, e.g. for testing purpose.) -1. Update the version number listed in [charts/bpa/Chart.yaml](charts/bpa/Chart.yaml). The incremented version number should adhere to the [Semantic Versioning Specification](https://semver.org/#semantic-versioning-specification-semver) based on the changes since the last published release. +## Step 1: Publish docker image -3. A new tag and GitHub release will be created automatically by a [github workflow](.github/workflows/release.yml). -Charts in the charts folder will be automatically deployed to a repository hosted on github pages. +The code to be published should be in the `master` branch. -*TODO* Include the additions to CHANGELOG.md in the release notes. +Create a git tag in the format `v` (e.g `v1.2.3`) +The incremented version number should adhere to the [Semantic Versioning Specification](https://semver.org/#semantic-versioning-specification-semver) based on the changes since the last published release. +A docker image will be created with the tag `` (e.g `1.2.3`) by a [github workflow](.github/workflows/build.yml). + +## Step 2: Release helm chart + +Update the `version` and `appVersion` number listed in [charts/bpa/Chart.yaml](charts/bpa/Chart.yaml). + +`appVersion` must be equal to the docker image tag created in the previous step. + +`version` is typically the same. + +Both incremented version numbers should adhere to the [Semantic Versioning Specification](https://semver.org/#semantic-versioning-specification-semver) based on the changes since the last published release. + +A new tag and GitHub release will be created automatically by a [github workflow](.github/workflows/release.yml). +Charts in the charts folder will be automatically deployed to a repository hosted on github pages. \ No newline at end of file diff --git a/charts/bpa/Chart.yaml b/charts/bpa/Chart.yaml index f3b81509c..c2b15cc8d 100644 --- a/charts/bpa/Chart.yaml +++ b/charts/bpa/Chart.yaml @@ -2,9 +2,9 @@ apiVersion: v2 name: bpa description: The Business Partner Agent allows to manage and exchange master data between organizations. type: application -version: 0.1.0-alpha2.6 -appVersion: latest +version: 0.1.0-alpha2.10 +appVersion: 0.1.0-alpha2.10 home: "https://github.com/hyperledger-labs/business-partner-agent/tree/master/charts/bpa" sources: ["https://github.com/hyperledger-labs/business-partner-agent/tree/master/charts/bpa"] diff --git a/charts/bpa/README.md b/charts/bpa/README.md index 8b33ebc1f..ce1d921fd 100644 --- a/charts/bpa/README.md +++ b/charts/bpa/README.md @@ -2,9 +2,9 @@ The Business Partner Agent allows to manage and exchange master data between organizations. -![Version: 0.1.0-alpha2.2](https://img.shields.io/badge/Version-0.1.0--alpha2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 0.1.0-alpha2.10](https://img.shields.io/badge/Version-0.1.0--alpha2.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0-alpha2.10](https://img.shields.io/badge/AppVersion-0.1.0--alpha2.10-informational?style=flat-square) -This chart will install a business partner agent (bpa-core & bpa-acapy) and Postgres. Be aware that in the standard configuration the database is not persistant, and kubernetes might redeploy your database at anytime. +This chart will install a business partner agent (bpa-core & bpa-acapy) and Postgres. It will also create the default ingress routes. @@ -14,8 +14,6 @@ It will also create the default ingress routes. helm repo add bpa https://hyperledger-labs.github.io/business-partner-agent/ helm repo update helm upgrade \ - --set bpa.image.repository=myrepo.io/bpa \ - --set bpa.image.tag=latest \ --set bpa.acapy.agentSeed=12345678901234567890123456789012 \ mybpa bpa/bpa -i -n mynamespace --devel ``` @@ -39,30 +37,6 @@ This chart bootstraps a business partner agent deployment on a Kubernetes cluste The following steps have to be done only once. -### Clone this git repository - -This is required for the next preparation steps. - -```s -git@github.com:hyperledger-labs/business-partner-agent.git -cd business-partner-agent/docker -``` - -### Create and push docker image - -In the future we plan to have bpa image publically available, e.g. on docker hub. -Currently you have to build it on your own and make it available in a registry (one that is reachable by your kubernetes cluster, e.g. docker hub). - -Build your image by executing the docker build command and push it to your registry. -E.g. - -```s -docker login --username=yourusername --password=yourpassword -docker build -t myrepo.io/bpa:latest . -docker push myrepo.io/bpa:latest -``` -See also [docker command line documentation](https://docs.docker.com/engine/reference/commandline/cli/). - ### Register a new DID Use the `./docker/register-did.sh` script to register a new DID on our test network (see also [docker setup](../../docker/README.md)) @@ -74,14 +48,12 @@ Just run: ## Installing the chart -To install the chart with the release name `bpa`, the docker image `myrepo.io/bpa` and the seed `12345678901234567890123456789012` in the namespace `mynamespace` +To install the chart with the release name `bpa` and the seed `12345678901234567890123456789012` in the namespace `mynamespace` ```sh helm repo add bpa https://hyperledger-labs.github.io/business-partner-agent/ helm repo update helm upgrade \ - --set bpa.image.repository=myrepo.io/bpa \ - --set bpa.image.tag=latest \ --set bpa.acapy.agentSeed=12345678901234567890123456789012 \ mybpa bpa/bpa -i -n mynamespace --devel ``` @@ -104,9 +76,6 @@ Create a yaml file. ```yaml cat <> values-mybpa.yaml bpa: - image: - repository: myrepo.io/bpa - tag: latest ingress: enabled: true hosts: @@ -197,6 +166,7 @@ Note: Deleting the PVC's will delete postgresql data as well. Please be cautious | acapy.nodeSelector | object | `{}` | | | acapy.podAnnotations | object | `{}` | | | acapy.podSecurityContext | object | `{}` | | +| acapy.readOnlyMode | bool | `false` | | | acapy.resources | object | `{}` | | | acapy.securityContext | object | `{}` | | | acapy.service.adminPort | int | `8031` | | @@ -204,9 +174,10 @@ Note: Deleting the PVC's will delete postgresql data as well. Please be cautious | acapy.service.type | string | `"ClusterIP"` | | | acapy.tolerations | list | `[]` | | | bpa.affinity | object | `{}` | | +| bpa.agentName | string | `"Business Partner Agent"` | The Agent Name as it should be displayed in the UI | | bpa.didPrefix | string | `"did:sov:iil:"` | The ledger prefix that is configured with the Uni Resolver | | bpa.image.pullPolicy | string | `"IfNotPresent"` | | -| bpa.image.repository | string | `"myrepo"` | | +| bpa.image.repository | string | `"docker.pkg.github.com/hyperledger-labs/business-partner-agent/business-partner-agent"` | | | bpa.image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | bpa.imagePullSecrets | list | `[]` | | | bpa.ingress.annotations | object | `{}` | | @@ -229,10 +200,11 @@ Note: Deleting the PVC's will delete postgresql data as well. Please be cautious | bpa.service.type | string | `"ClusterIP"` | | | bpa.tolerations | list | `[]` | | | bpa.userName | string | `"admin"` | Default username | -| bpa.webMode | bool | `false` | Run in web only mode without any ledger dependency and aries functionality | +| bpa.webMode | bool | `false` | Run in did:web mode with read only ledger. If set to true acapy.readOnlyMode has to be true too. | | global.fullnameOverride | string | `""` | | | global.nameOverride | string | `""` | | | global.persistence.deployPostgres | bool | `true` | If true, the Postgres chart is deployed | +| postgresql.image.tag | int | `12` | | | postgresql.persistence | object | `{"enabled":false}` | Persistent Volume Storage configuration. ref: https://kubernetes.io/docs/user-guide/persistent-volumes | | postgresql.persistence.enabled | bool | `false` | Enable PostgreSQL persistence using Persistent Volume Claims. | | postgresql.postgresqlDatabase | string | `"bpa"` | PostgreSQL Database to create. | @@ -243,7 +215,7 @@ Note: Deleting the PVC's will delete postgresql data as well. Please be cautious ## Chart dependencies | Repository | Name | Version | |------------|------|---------| -| https://charts.bitnami.com/bitnami/ | postgresql | 9.7.2 | +| https://charts.bitnami.com/bitnami/ | postgresql | 10.1.3 | ## Chart development diff --git a/charts/bpa/README.md.gotmpl b/charts/bpa/README.md.gotmpl index c12b3c2e2..cb7cbb7db 100644 --- a/charts/bpa/README.md.gotmpl +++ b/charts/bpa/README.md.gotmpl @@ -13,8 +13,6 @@ It will also create the default ingress routes. helm repo add bpa https://hyperledger-labs.github.io/business-partner-agent/ helm repo update helm upgrade \ - --set bpa.image.repository=myrepo.io/bpa \ - --set bpa.image.tag=latest \ --set bpa.acapy.agentSeed=12345678901234567890123456789012 \ mybpa bpa/bpa -i -n mynamespace --devel ``` @@ -38,30 +36,6 @@ This chart bootstraps a business partner agent deployment on a Kubernetes cluste The following steps have to be done only once. -### Clone this git repository - -This is required for the next preparation steps. - -```s -git@github.com:hyperledger-labs/business-partner-agent.git -cd business-partner-agent/docker -``` - -### Create and push docker image - -In the future we plan to have bpa image publically available, e.g. on docker hub. -Currently you have to build it on your own and make it available in a registry (one that is reachable by your kubernetes cluster, e.g. docker hub). - -Build your image by executing the docker build command and push it to your registry. -E.g. - -```s -docker login --username=yourusername --password=yourpassword -docker build -t myrepo.io/bpa:latest . -docker push myrepo.io/bpa:latest -``` -See also [docker command line documentation](https://docs.docker.com/engine/reference/commandline/cli/). - ### Register a new DID Use the `./docker/register-did.sh` script to register a new DID on our test network (see also [docker setup](../../docker/README.md)) @@ -73,14 +47,12 @@ Just run: ## Installing the chart -To install the chart with the release name `bpa`, the docker image `myrepo.io/bpa` and the seed `12345678901234567890123456789012` in the namespace `mynamespace` +To install the chart with the release name `bpa` and the seed `12345678901234567890123456789012` in the namespace `mynamespace` ```sh helm repo add bpa https://hyperledger-labs.github.io/business-partner-agent/ helm repo update helm upgrade \ - --set bpa.image.repository=myrepo.io/bpa \ - --set bpa.image.tag=latest \ --set bpa.acapy.agentSeed=12345678901234567890123456789012 \ mybpa bpa/bpa -i -n mynamespace --devel ``` @@ -103,9 +75,6 @@ Create a yaml file. ```yaml cat <> values-mybpa.yaml bpa: - image: - repository: myrepo.io/bpa - tag: latest ingress: enabled: true hosts: diff --git a/charts/bpa/templates/acapy_deployment.yaml b/charts/bpa/templates/acapy_deployment.yaml index fa19dacdd..25cef627e 100644 --- a/charts/bpa/templates/acapy_deployment.yaml +++ b/charts/bpa/templates/acapy_deployment.yaml @@ -24,7 +24,7 @@ spec: securityContext: {{- toYaml .Values.acapy.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Values.acapy.name }} securityContext: {{- toYaml .Values.acapy.securityContext | nindent 12 }} image: "{{ .Values.acapy.image.repository }}:{{ .Values.acapy.image.tag | default .Chart.AppVersion }}" diff --git a/charts/bpa/templates/bpa_deployment.yaml b/charts/bpa/templates/bpa_deployment.yaml index 16b80f64a..674d82590 100644 --- a/charts/bpa/templates/bpa_deployment.yaml +++ b/charts/bpa/templates/bpa_deployment.yaml @@ -24,7 +24,7 @@ spec: securityContext: {{- toYaml .Values.bpa.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Values.bpa.name }} securityContext: {{- toYaml .Values.bpa.securityContext | nindent 12 }} image: "{{ .Values.bpa.image.repository }}:{{ .Values.bpa.image.tag | default .Chart.AppVersion }}" diff --git a/charts/bpa/values.yaml b/charts/bpa/values.yaml index b64c98e24..c5fe7c0ac 100644 --- a/charts/bpa/values.yaml +++ b/charts/bpa/values.yaml @@ -14,7 +14,7 @@ bpa: name: bpacore image: - repository: myrepo + repository: docker.pkg.github.com/hyperledger-labs/business-partner-agent/business-partner-agent pullPolicy: IfNotPresent # -- Overrides the image tag whose default is the chart appVersion. tag: ""