Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Feature/new chart (#319)
Browse files Browse the repository at this point in the history
new chart  0.1.0-alpha2.10

Signed-off-by: Frank Bernhardt <[email protected]>
  • Loading branch information
frank-bee authored Feb 12, 2021
1 parent a735383 commit 67e6e36
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 80 deletions.
28 changes: 22 additions & 6 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -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<new version>` (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 `<new version>` (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.
4 changes: 2 additions & 2 deletions charts/bpa/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
46 changes: 9 additions & 37 deletions charts/bpa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
```
Expand All @@ -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
[email protected]: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))
Expand All @@ -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
```
Expand All @@ -104,9 +76,6 @@ Create a yaml file.
```yaml
cat <<EOT >> values-mybpa.yaml
bpa:
image:
repository: myrepo.io/bpa
tag: latest
ingress:
enabled: true
hosts:
Expand Down Expand Up @@ -197,16 +166,18 @@ 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` | |
| acapy.service.httpPort | int | `8030` | |
| 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 | `{}` | |
Expand All @@ -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. |
Expand All @@ -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

Expand Down
33 changes: 1 addition & 32 deletions charts/bpa/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
[email protected]: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))
Expand All @@ -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
```
Expand All @@ -103,9 +75,6 @@ Create a yaml file.
```yaml
cat <<EOT >> values-mybpa.yaml
bpa:
image:
repository: myrepo.io/bpa
tag: latest
ingress:
enabled: true
hosts:
Expand Down
2 changes: 1 addition & 1 deletion charts/bpa/templates/acapy_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/bpa/templates/bpa_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/bpa/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 67e6e36

Please sign in to comment.