-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove support for dbRequired Signed-off-by: thepetk <[email protected]> * Pull updates after gitops lint Signed-off-by: thepetk <[email protected]> * Add newly imported values Signed-off-by: thepetk <[email protected]> * Update values Signed-off-by: thepetk <[email protected]> * Fix defaults Signed-off-by: thepetk <[email protected]> * Add modelMaxLength value Signed-off-by: thepetk <[email protected]> * Update resources after testing Signed-off-by: thepetk <[email protected]> * Update tmpl json schema Signed-off-by: thepetk <[email protected]> * Update readme template Signed-off-by: thepetk <[email protected]> * Add readme for generate.sh Signed-off-by: thepetk <[email protected]> * Add the generate.sh Signed-off-by: thepetk <[email protected]> * Rename github action Signed-off-by: thepetk <[email protected]> * Bump chatbot version Signed-off-by: thepetk <[email protected]> * Update charts/ai-software-templates/README.md Co-authored-by: Gabe Montero <[email protected]> * Update charts/ai-software-templates/README.md Co-authored-by: Gabe Montero <[email protected]> * Update charts/ai-software-templates/README.md Co-authored-by: Gabe Montero <[email protected]> * Update readme template * Make app-config permanent --------- Signed-off-by: thepetk <[email protected]> Co-authored-by: Gabe Montero <[email protected]>
- Loading branch information
1 parent
ffeb175
commit bcca534
Showing
18 changed files
with
198 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Verify updated gitops resources | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
verify-updated-gitops-resources: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Run generate.sh and check if the ai-lab-app based charts are up-to-date | ||
run: | | ||
bash generate.sh | ||
if [[ ! -z $(git status -s) ]] | ||
then | ||
echo 'The script `./generate.sh` did introduce changes, which should ideally be checked in as part of the PR.' | ||
git status | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## ai-software-templates | ||
|
||
Apart from the [pipeline-install](./pipeline-install/) and the [pipeline-setup](./pipeline-setup/) which are tools to help you install the Tekton Pipelines along with your charts, the rest of charts under this directory are based on the [redhat-ai-dev/ai-lab-app](https://github.com/redhat-ai-dev/ai-lab-app) gitops resources repo. | ||
|
||
### Pull automatically latest changes | ||
|
||
To pull all the latest changes for the charts from the `ai-lab-app` repository you can simply run the `generate.sh` script placed in the root dir of this repository. | ||
|
||
The script will clone the `ai-lab-app` and will convert the necessary resources to Helm chart template files. Each chart has a corresponding `env` file under the `scripts/envs` dir which helps us configure the behavior of the conversion process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 52 additions & 59 deletions
111
charts/ai-software-templates/chatbot/templates/deployment-model-server.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,80 @@ | ||
{{ if not .Values.model.existingModelServer }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
labels: | ||
app.kubernetes.io/instance: {{ .Release.Name }}-model-server | ||
app.kubernetes.io/name: {{ .Release.Name }}-model-server | ||
app.kubernetes.io/part-of: {{ .Release.Name }} | ||
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: {{ .Release.Name }}-model-server | ||
app.kubernetes.io/instance: {{ .Release.Name }}-model-server | ||
template: | ||
metadata: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: {{ .Release.Name }}-model-server | ||
app.kubernetes.io/instance: {{ .Release.Name }}-model-server | ||
spec: | ||
{{- if or (not .Values.model.vllmSelected) (eq .Values.model.vllmSelected nil) }} | ||
initContainers: | ||
- name: model-file | ||
image: {{ .Values.model.initContainer }} | ||
command: {{ .Values.model.modelInitCommand }} | ||
volumeMounts: | ||
- name: model-file | ||
mountPath: /shared | ||
image: {{ .Values.model.initContainer }} | ||
command: {{ .Values.model.modelInitCommand }} | ||
volumeMounts: | ||
- name: model-file | ||
mountPath: /shared | ||
{{ end }} | ||
containers: | ||
{{ if .Values.model.vllmSelected }} | ||
- image: {{ .Values.model.vllmModelServiceContainer }} | ||
args: ["--model", "{{ .Values.model.modelName }}", "--port", "{{ .Values.model.modelServicePort }}", "--download-dir", "/models-cache", "--max-model-len", "{{ .Values.model.maxModelLength }}"] | ||
resources: | ||
limits: | ||
nvidia.com/gpu: '1' | ||
volumeMounts: | ||
- name: dshm | ||
mountPath: /dev/shm | ||
- name: models-cache | ||
mountPath: /models-cache | ||
{{ else }} | ||
- env: | ||
- name: HOST | ||
value: "0.0.0.0" | ||
- name: PORT | ||
value: "{{ .Values.model.modelServicePort }}" | ||
- name: MODEL_PATH | ||
value: {{ .Values.model.modelPath }} | ||
- name: CHAT_FORMAT | ||
value: openchat | ||
image: {{ .Values.model.modelServiceContainer }} | ||
volumeMounts: | ||
- name: model-file | ||
mountPath: /model | ||
{{ end }} | ||
name: app-model-service | ||
ports: | ||
- containerPort: {{ .Values.model.modelServicePort }} | ||
securityContext: | ||
runAsNonRoot: true | ||
{{ if .Values.model.vllmSelected }} | ||
- image: {{ .Values.model.vllmModelServiceContainer }} | ||
args: [ | ||
"--model", | ||
"{{ .Values.model.modelName }}", | ||
"--port", | ||
"{{ .Values.model.modelServicePort }}", | ||
"--download-dir", | ||
"/models-cache", | ||
"--max-model-len", | ||
"{{values.maxModelLength}}"] | ||
resources: | ||
limits: | ||
nvidia.com/gpu: '1' | ||
volumeMounts: | ||
volumes: | ||
- name: dshm | ||
mountPath: /dev/shm | ||
emptyDir: | ||
medium: Memory | ||
sizeLimit: "2Gi" | ||
- name: models-cache | ||
mountPath: /models-cache | ||
{{ else }} | ||
- env: | ||
- name: HOST | ||
value: "0.0.0.0" | ||
- name: PORT | ||
value: "{{ .Values.model.modelServicePort }}" | ||
- name: MODEL_PATH | ||
value: {{ .Values.model.modelPath }} | ||
- name: CHAT_FORMAT | ||
value: openchat | ||
image: {{ .Values.model.modelServiceContainer }} | ||
volumeMounts: | ||
- name: model-file | ||
mountPath: /model | ||
{{ end }} | ||
name: app-model-service | ||
ports: | ||
- containerPort: {{ .Values.model.modelServicePort }} | ||
securityContext: | ||
runAsNonRoot: true | ||
{{ if .Values.model.vllmSelected }} | ||
volumes: | ||
- name: dshm | ||
emptyDir: | ||
medium: Memory | ||
sizeLimit: "2Gi" | ||
- name: models-cache | ||
persistentVolumeClaim: | ||
claimName: {{ .Release.Name }} | ||
|
||
persistentVolumeClaim: | ||
claimName: {{ .Release.Name }} | ||
tolerations: | ||
- key: nvidia.com/gpu | ||
operator: Exists | ||
effect: NoSchedule | ||
{{ else }} | ||
volumes: | ||
- name: model-file | ||
emptyDir: {} | ||
- name: model-file | ||
emptyDir: {} | ||
{{ end }} | ||
{{ end }} |
54 changes: 25 additions & 29 deletions
54
charts/ai-software-templates/chatbot/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
annotations: | ||
tad.gitops.set/image: ".spec.template.spec.containers[0].image" | ||
tad.gitops.get/image: ".spec.template.spec.containers[0].image" | ||
tad.gitops.set/replicas: ".spec.replicas" | ||
tad.gitops.get/replicas: ".spec.replicas" | ||
labels: | ||
tad.gitops.get/replicas: ".spec.replicas" | ||
labels: | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/name: {{ .Release.Name }} | ||
app.kubernetes.io/part-of: {{ .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: {{ .Release.Name }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- image: {{ .Values.application.appContainer }} | ||
name: app-inference | ||
envFrom: | ||
- configMapRef: | ||
name: {{ .Release.Name }}-model-config | ||
{{ if .Values.model.dbRequired }} | ||
- configMapRef: | ||
name: {{ .Release.Name }}-database-config | ||
{{ end }} | ||
{{ if .Values.model.includeModelEndpointSecret }} | ||
env: | ||
- name: MODEL_ENDPOINT_BEARER | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Values.model.modelEndpointSecretName }} | ||
key: {{ .Values.model.modelEndpointSecretKey }} | ||
{{ end }} | ||
ports: | ||
- containerPort: {{ .Values.application.appPort }} | ||
securityContext: | ||
runAsNonRoot: true | ||
- image: {{ .Values.application.appContainer }} | ||
name: app-inference | ||
envFrom: | ||
- configMapRef: | ||
name: {{ .Release.Name }}-model-config | ||
{{ if .Values.model.includeModelEndpointSecret }} | ||
env: | ||
- name: MODEL_ENDPOINT_BEARER | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Values.model.modelEndpointSecretName }} | ||
key: {{ .Values.model.modelEndpointSecretKey }} | ||
{{ end }} | ||
ports: | ||
- containerPort: {{ .Values.application.appPort }} | ||
securityContext: | ||
runAsNonRoot: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.