Skip to content

Commit

Permalink
Address feedback from manual testing (redhat-ai-dev#19)
Browse files Browse the repository at this point in the history
* Address certifiers feedback

Signed-off-by: thepetk <[email protected]>

* Move OpenShift Pipelines Configuration to manual guide

Signed-off-by: thepetk <[email protected]>

* Replace name and namespace with release values

* Remove robots.txt

* Update docs/PIPELINES_CONFIGURATION.md

* Remove model-server test

* Add fix namespace for pipelines operator

* Remove transparency settings in tektonconfig

* Add fixed secret names

* Add export command for app id

* Add further info for the private key

* Fix issue with dockerconfigjson value

* Update test-connection-app

* Fix helm test case

---------

Signed-off-by: thepetk <[email protected]>
  • Loading branch information
thepetk authored Nov 12, 2024
1 parent 5468a0f commit 7ee6dc3
Show file tree
Hide file tree
Showing 26 changed files with 230 additions and 527 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ At the moment one template has helm chart support and this is the [chatbot appli

The gitops component, handled by ArgoCD for the RHDH case, is replaced by the `application_gitops` project. Therefore, post application deployment a kubernetes Job is taking care of the github application repository creation. The source code is [here](https://github.com/redhat-ai-dev/developer-images/tree/main/helm-charts/application-gitops)

## OpenShift Pipelines Configuration
## OpenShift Pipelines

For OpenShift Pipelines configuration there's a separate (optional) helm chart, that a user can use to install and configure the pipelines for their project. The configuration helm chart is [here](/charts/openshift-pipelines/).
For OpenShift Pipelines configuration there's an [OpenShift Pipelines Configuration Guide](/docs/PIPELINES_CONFIGURATION.md) that the user can follow to configure their pipelines, prior to installing the helm chart.

The helm chart mainly uses the pipelines under [rhdh-pipelines](https://github.com/redhat-ai-dev/rhdh-pipelines) repo. The only customized resources used for the helm chart case are:
The helm chart mainly uses the tekton pipelines under [rhdh-pipelines](https://github.com/redhat-ai-dev/rhdh-pipelines) repo. The only customized resources used for the helm chart case are:

- The [.tekton/docker-push.yaml](/pac/pipelineRuns/.tekton/docker-push.yaml) PipelineRun used to manage `push` events received from the github app webhook.
- 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.
Expand Down
3 changes: 3 additions & 0 deletions charts/ai-software-templates/chatbot/0.1.0/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apiVersion: v2
kubeVersion: ">= 1.27.0-0"
annotations:
charts.openshift.io/name: Chatbot AI Software Template
description: A helm chart for the AI Software Templates. For more information please check https://github.com/redhat-ai-dev/ai-lab-helm-charts.git
name: chatbot-ai-software-template
tags: chatbot,llama.cpp,ai-lab
Expand Down
55 changes: 25 additions & 30 deletions charts/ai-software-templates/chatbot/0.1.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ The deployment flow, will create an application instance, a model server and a g

- 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).
- You need to have access to a cluster for each operation with OpenShift 4, like deploying and testing.
- 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 ["Setup Openshift Pipelines Operator"](#setup-openshift-pipelines-operator) below for further instructions.
- A 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).
- The Namespace that your application will run is already created in your cluster.
- 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.
- 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.

## Background

Expand All @@ -27,12 +28,6 @@ Apart from the two main deployments, the gitops & OpenShift Pipelines parts are

The helm chart can be directly installed from the OpenShift Dev Console. Check [here](https://docs.redhat.com/en/documentation/openshift_container_platform/4.8/html/building_applications/working-with-helm-charts#understanding-helm) for more information.

### Setup Openshift Pipelines Operator

The suggested way to subscribe to, configure and connect the Openshift Pipelines and your Github App, is the through [openshift-pipelines](../../../openshift-pipelines/) helm chart.

<!-- TODO: Add manual instructions if needed -->

### Install using Helm

In order to install AI Software Template Helm chart using helm directly, you can run:
Expand All @@ -43,34 +38,34 @@ helm upgrade --install <release-name> --namespace <release-namespace> .

## Values

Below is a table of each value used to configure this chart.
Below is a table of each value used to configure this chart. Note:

- Your helm release's name will be used to as the name of the application github repository.

### Application

| Value | Description | Default | Additional Information |
| -------------- | ------------------------------------------------------------- | -------------------------------------- | ---------------------- |
| `name` | The name of the application. | `chatbot-helm-chart` | |
| `namespace` | The namespace that the application will be deployed. | `ai-software-templates-dev` | |
| `appPort` | The exposed port of the application | 8501 | |
| `appContainer` | The initial image used for the chatbot application interface. | `quay.io/redhat-ai-dev/chatbot:latest` | |
| Value | Description | Default | Additional Information |
| -------------------------- | ------------------------------------------------------------- | -------------------------------------- | ---------------------- |
| `application.appPort` | The exposed port of the application | 8501 | |
| `application.appContainer` | The initial image used for the chatbot application interface. | `quay.io/redhat-ai-dev/chatbot:latest` | |

### Model

| Value | Description | Default | Additional Information |
| ----------------------- | --------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------- |
| `modelServicePort` | The exposed port of the model service. | 8001 | |
| `modelServiceContainer` | The image used for the model service. | `quay.io/ai-lab/llamacpp_python:latest` | |
| `initContainer` | The image used for the initContainer of the model service deployment. | `quay.io/redhat-ai-dev/granite-7b-lab:latest` | |
| `modelInitCommand` | The model service initContainer command. | `['/usr/bin/install', '/model/model.file', '/shared/']` | |
| `modelPath` | The path of the model file inside the model service container. | `/model/model.file` | |
| Value | Description | Default | Additional Information |
| ----------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------- |
| `model.modelServicePort` | The exposed port of the model service. | 8001 | |
| `model.modelServiceContainer` | The image used for the model service. | `quay.io/ai-lab/llamacpp_python:latest` | |
| `initContainer` | The image used for the initContainer of the model service deployment. | `quay.io/redhat-ai-dev/granite-7b-lab:latest` | |
| `model.modelInitCommand` | The model service initContainer command. | `['/usr/bin/install', '/model/model.file', '/shared/']` | |
| `model.modelPath` | The path of the model file inside the model service container. | `/model/model.file` | |

### Gitops

| Value | Description | Default | Additional Information |
| ------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------- | ---------------------- |
| `gitSecretName` | The name of the Secret containing the required Github token. | `git-secrets` | |
| `gitSecretKeyToken` | The name of the Secret's key with the Github token value. | `GITHUB_TOKEN` | |
| `githubOrgName` | `[REQUIRED]` The Github Organization name that the chatbot application repository will be created into | | |
| `gitSourceRepo` | The Github Repository with the contents of the chatbot application. | `redhat-ai-dev/ai-lab-helm-charts` | |
| `gitDefaultBranch` | The default branch for the chatbot application Github repository. | `main` | |
| `quayAccountName` | `[REQUIRED]` The quay.io account that the application image will be pushed. | | |
| Value | Description | Default | Additional Information |
| -------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------- | ---------------------- |
| `gitops.gitSecretName` | The name of the Secret containing the required Github token. | `git-secrets` | |
| `gitops.gitSecretKeyToken` | The name of the Secret's key with the Github token value. | `GITHUB_TOKEN` | |
| `gitops.githubOrgName` | `[REQUIRED]` The Github Organization name that the chatbot application repository will be created into | | |
| `gitops.gitSourceRepo` | The Github Repository with the contents of the chatbot application. | `"thepetk/chatbot-test-chart-repo` | |
| `gitops.gitDefaultBranch` | The default branch for the chatbot application Github repository. | `main` | |
| `gitops.quayAccountName` | `[REQUIRED]` The quay.io account that the application image will be pushed. | | |
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}-app-config
app.kubernetes.io/name: {{ .Values.application.name }}-app-config
app.kubernetes.io/part-of: {{ .Values.application.name }}
name: {{ .Values.application.name }}-app-config
namespace: {{ .Values.application.namespace }}
app.kubernetes.io/instance: {{ .Release.Name }}-app-config
app.kubernetes.io/name: {{ .Release.Name }}-app-config
app.kubernetes.io/part-of: {{ .Release.Name }}
name: {{ .Release.Name }}-app-config
namespace: {{ .Release.Namespace }}
data:
APP_NAME: "{{ .Values.application.name }}"
APP_NAMESPACE: "{{ .Values.application.namespace }}"
APP_NAME: "{{ .Release.Name }}"
APP_NAMESPACE: "{{ .Release.Namespace }}"
GITHUB_ORG_NAME: "{{ .Values.gitops.githubOrgName }}"
GITHUB_SOURCE_REPO: "{{ .Values.gitops.gitSourceRepo }}"
GITHUB_TETKON_SOURCE_REPO: "redhat-ai-dev/ai-lab-helm-charts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ metadata:
tad.gitops.set/replicas: ".spec.replicas"
tad.gitops.get/replicas: ".spec.replicas"
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}
app.kubernetes.io/name: {{ .Values.application.name }}
app.kubernetes.io/part-of: {{ .Values.application.name }}
name: {{ .Values.application.name }}
namespace: {{ .Values.application.namespace }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/part-of: {{ .Release.Name }}
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Values.application.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- image: {{ .Values.application.appContainer }}
name: app-inference
envFrom:
- configMapRef:
name: {{ .Values.application.name }}-model-config
name: {{ .Release.Name }}-model-config
ports:
- containerPort: {{ .Values.application.appPort }}
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}
app.kubernetes.io/name: {{ .Values.application.name }}
name: {{ .Values.application.name }}
namespace: {{ .Values.application.namespace }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Release.Name }}
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
spec:
port:
targetPort: {{ .Values.application.appPort }}
Expand All @@ -14,6 +14,6 @@ spec:
termination: edge
to:
kind: Service
name: {{ .Values.application.name }}
weight: 100
name: {{ .Release.Name }}
weight: 100
wildcardPolicy: None
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}
app.kubernetes.io/name: {{ .Values.application.name }}
name: {{ .Values.application.name }}
namespace: {{ .Values.application.namespace }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Release.Name }}
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: {{ .Values.application.appPort }}
protocol: TCP
targetPort: {{ .Values.application.appPort }}
selector:
app.kubernetes.io/instance: {{ .Values.application.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: batch/v1
kind: Job
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}-github-repo-creator
app.kubernetes.io/name: {{ .Values.application.name }}-github-repo-creator
app.kubernetes.io/part-of: {{ .Values.application.name }}
namespace: {{ .Values.application.namespace }}
name: {{ .Values.application.name }}-github-repo-creator
app.kubernetes.io/instance: {{ .Release.Name }}-github-repo-creator
app.kubernetes.io/name: {{ .Release.Name }}-github-repo-creator
app.kubernetes.io/part-of: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-github-repo-creator
spec:
template:
spec:
Expand All @@ -21,5 +21,5 @@ spec:
key: {{ .Values.gitops.gitSecretKeyToken }}
envFrom:
- configMapRef:
name: {{ .Values.application.name }}-app-config
name: {{ .Release.Name }}-app-config
restartPolicy: Never
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.application.name }}-model-config
namespace: {{ .Values.application.namespace }}
name: {{ .Release.Name }}-model-config
namespace: {{ .Release.Namespace }}
data:
MODEL_ENDPOINT: "http://{{ .Values.application.name }}-model-server:{{ .Values.model.modelServicePort }}"
MODEL_ENDPOINT: "http://{{ .Release.Name }}-model-server:{{ .Values.model.modelServicePort }}"
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}-model-server
app.kubernetes.io/name: {{ .Values.application.name }}-model-server
app.kubernetes.io/part-of: {{ .Values.application.name }}
name: {{ .Values.application.name }}-model-server
namespace: {{ .Values.application.namespace }}
app.kubernetes.io/instance: {{ .Release.Name }}-model-server
app.kubernetes.io/name: {{ .Release.Name }}-model-server
app.kubernetes.io/part-of: {{ .Release.Name }}
name: {{ .Release.Name }}-model-server
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Values.application.name }}-model-server
app.kubernetes.io/instance: {{ .Release.Name }}-model-server
template:
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}-model-server
app.kubernetes.io/instance: {{ .Release.Name }}-model-server
spec:
initContainers:
- name: model-file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: {{ .Values.application.name }}-model-server
app.kubernetes.io/name: {{ .Values.application.name }}-model-server
name: {{ .Values.application.name }}-model-server
namespace: {{ .Values.application.namespace }}
app.kubernetes.io/instance: {{ .Release.Name }}-model-server
app.kubernetes.io/name: {{ .Release.Name }}-model-server
name: {{ .Release.Name }}-model-server
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: {{ .Values.model.modelServicePort }}
protocol: TCP
targetPort: {{ .Values.model.modelServicePort }}
selector:
app.kubernetes.io/instance: {{ .Values.application.name }}-model-server
app.kubernetes.io/instance: {{ .Release.Name }}-model-server
Loading

0 comments on commit 7ee6dc3

Please sign in to comment.