Skip to content

Commit cbef21b

Browse files
authored
Add simple release process and info for custom helm repo. (redhat-ai-dev#20)
* Remove 0.1.0 directory * Add info for custom helm repo * Add release process information * Replace release workflow * Specify chart version info * Remove relative path * Address docs feedback * Add pipelines route as webhook url * Add correction to Github App naming * Revert note for webhook url * Update gitSourceRepo description * Fix values json description * Remove special chars from values.json
1 parent 278590f commit cbef21b

21 files changed

+108
-40
lines changed

Diff for: .github/workflows/chart-releaser.yaml

-29
This file was deleted.

Diff for: .github/workflows/release.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release Helm Chart Package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release-package:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
chart:
16+
- path: charts/ai-software-templates/chatbot
17+
package: chatbot-ai-software-template
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Install Helm
25+
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
26+
with:
27+
version: 3.12.1
28+
29+
- name: Generate Helm Package
30+
run: |
31+
RELEASE_VERSION=${GITHUB_REF#refs/*/}
32+
CHART_PATH=${{matrix.chart.path}}
33+
helm package $CHART_PATH
34+
echo "RELEASE_VERSION=${RELEASE_VERSION//v}" >> $GITHUB_ENV
35+
36+
- name: Add packages to Release
37+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
38+
with:
39+
draft: false
40+
files: ${{matrix.chart.package}}-${{env.RELEASE_VERSION}}.tgz

Diff for: README.md

+12
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@ The helm chart mainly uses the tekton pipelines under [rhdh-pipelines](https://g
1919
- The [.tekton/docker-push.yaml](/pac/pipelineRuns/.tekton/docker-push.yaml) PipelineRun used to manage `push` events received from the github app webhook.
2020
- The [update-deployment.yaml](/pac/tasks/update-deployment.yaml) Task which is used to update the application deployment whenever a new image is pushed to the image registry.
2121
- The [docker-build-ai-software-templates-chart.yaml](./pac/pipelines/docker-build-ai-software-templates-chart.yaml) Pipeline, again used for the application deployment update.
22+
23+
## Testing with a Custom Helm Repository
24+
25+
To test your updates by importing the `ai-lab-helm-charts` fork as a custom Helm chart repository, you can follow the instructions [here](./docs/SETUP_CUSTOM_HELM_REPO.md)
26+
27+
## Release Process
28+
29+
The ai-lab-helm-charts are created on demand.
30+
31+
- A `tag` should be created with the version of the release as the name. `ai-lab-helmcharts` follows the v{major}.{minor}.{bugfix} format (e.g v0.1.0).
32+
- Before proceeding, make sure that all the `version` fields within `Chart.yaml` have this tag as the value. For example in the case where the tag is `v0.1.0`, the `version` should be `0.1.0`.
33+
- After the new release is published, the updated Helm packages will be pinned on the release.

Diff for: charts/ai-software-templates/chatbot/0.1.0/README.md renamed to charts/ai-software-templates/chatbot/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The deployment flow, will create an application instance, a model server and a g
99
- You have a Github APP created with sufficient permissions for the organization that the application repository will be created. Detailed instructions for the github application creation can be found [here](https://github.com/redhat-ai-dev/ai-rhdh-installer/blob/main/docs/APP-SETUP.md#github-app).
1010
- You need to have access to a cluster for each operation with OpenShift 4, like deploying and testing.
1111
- The Namespace that your application will run is already created in your cluster.
12-
- Your cluster should have [Openshift Pipelines Operator](https://www.redhat.com/en/technologies/cloud-computing/openshift/pipelines) installed and should be connected to your Github APP's webhook. In case your cluster is not configured yet, check the ["Pipelines Configuration Guide"](../../../../docs/PIPELINES_CONFIGURATION.md) for further instructions.
12+
- Your cluster should have [Openshift Pipelines Operator](https://www.redhat.com/en/technologies/cloud-computing/openshift/pipelines) installed and should be connected to your Github App's webhook. In case your cluster is not configured yet, check the ["Pipelines Configuration Guide"](https://github.com/redhat-ai-dev/ai-lab-helm-charts/blob/main/docs/PIPELINES_CONFIGURATION.md) for further instructions.
1313
- A `key/value` Secret is already created in the Namespace that you are planning to install your helm release, containing a [Github Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with sufficient access to the given Github Organization. You can find the exact permissions [here](https://github.com/redhat-ai-dev/ai-rhdh-installer/blob/main/docs/APP-SETUP.md#procedure). Your Secret's name and the Key of the github token will be provided as values to the helm chart.
1414

1515
## Background
@@ -61,11 +61,11 @@ Below is a table of each value used to configure this chart. Note:
6161

6262
### Gitops
6363

64-
| Value | Description | Default | Additional Information |
65-
| -------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------- | ---------------------- |
66-
| `gitops.gitSecretName` | The name of the Secret containing the required Github token. | `git-secrets` | |
67-
| `gitops.gitSecretKeyToken` | The name of the Secret's key with the Github token value. | `GITHUB_TOKEN` | |
68-
| `gitops.githubOrgName` | `[REQUIRED]` The Github Organization name that the chatbot application repository will be created into | | |
69-
| `gitops.gitSourceRepo` | The Github Repository with the contents of the chatbot application. | `"thepetk/chatbot-test-chart-repo` | |
70-
| `gitops.gitDefaultBranch` | The default branch for the chatbot application Github repository. | `main` | |
71-
| `gitops.quayAccountName` | `[REQUIRED]` The quay.io account that the application image will be pushed. | | |
64+
| Value | Description | Default | Additional Information |
65+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ---------------------- |
66+
| `gitops.gitSecretName` | The name of the Secret containing the required Github token. | `git-secrets` | |
67+
| `gitops.gitSecretKeyToken` | The name of the Secret's key with the Github token value. | `GITHUB_TOKEN` | |
68+
| `gitops.githubOrgName` | `[REQUIRED]` The Github Organization name that the chatbot application repository will be created into | | |
69+
| `gitops.gitSourceRepo` | The Github Repository with the contents of the ai-lab sample chatbot application. It must be either the `redhat-ai-dev/ai-lab-samples` or its fork. | `redhat-ai-dev/ai-lab-samples` |
70+
| `gitops.gitDefaultBranch` | The default branch for the chatbot application Github repository. | `main` | |
71+
| `gitops.quayAccountName` | `[REQUIRED]` The quay.io account that the application image will be pushed. | | |

Diff for: charts/ai-software-templates/chatbot/0.1.0/values.schema.json renamed to charts/ai-software-templates/chatbot/values.schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
"gitSourceRepo": {
6868
"type": "string",
69-
"description": "The Github Repository with the contents of the chatbot application. If blank it defaults to 'redhat-ai-dev/ai-lab-samples'.",
69+
"description": "The Github Repository with the contents of the ai-lab sample chatbot application. It must be either the 'redhat-ai-dev/ai-lab-samples' or its fork. If blank it defaults to 'redhat-ai-dev/ai-lab-samples'.",
7070
"default": "redhat-ai-dev/ai-lab-samples"
7171
},
7272
"gitDefaultBranch": {

Diff for: docs/PIPELINES_CONFIGURATION.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The OpenShift Pipelines configuration is a requirement in order to support CI/CD
44

55
1. Install the [Openshift Pipelines Operator](https://docs.redhat.com/en/documentation/openshift_container_platform/4.6/html/pipelines/installing-pipelines#installing-pipelines).
66

7-
2. Ensure that the `pipeline-as-code-controller` is up by getting its route:
7+
2. Ensure that the `pipeline-as-code-controller` is up by getting its route.
88

99
```
1010
kubectl get route -n openshift-pipelines pipelines-as-code-controller

Diff for: docs/SETUP_CUSTOM_HELM_REPO.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Testing with a Custom Helm Repository
2+
3+
To setup a custom Helm repository on your fork and be able to import and test the `ai-lab-helm-charts` repo on your OCP cluster, you can follow the steps below:
4+
5+
### Setup gh-pages
6+
7+
- Create a new branch (`gh-pages` could be a good candidate) in your fork.
8+
9+
- Go to your fork's `settings` > `Pages` > `Build and Deployment`.
10+
11+
- Select `Deploy from a branch` & choose your new as the branch we will be deploying from.
12+
13+
### Add Helm Package and Index
14+
15+
- Package the Helm chart you want to test:
16+
17+
```
18+
# from project root dir
19+
helm package <path-of-the-helm-chart-dir>
20+
21+
# example
22+
helm package charts/ai-software-templates/chatbot/
23+
```
24+
25+
- Create the `index.yaml`:
26+
27+
```
28+
# from project root dir
29+
helm repo index .
30+
```
31+
32+
- Push to your branch. A deployment will start after the push event.
33+
34+
- On your OCP cluster you can create a custom Helm repo by applying this yaml file:
35+
36+
```
37+
apiVersion: helm.openshift.io/v1beta1
38+
kind: HelmChartRepository
39+
metadata:
40+
name: 'ai-lab-helm-charts'
41+
spec:
42+
connectionConfig:
43+
url: '<your-gh-pages-url>'
44+
45+
```

0 commit comments

Comments
 (0)