Skip to content

Commit

Permalink
feat: example with MCG pre-configured as a data connection
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Butler <[email protected]>
  • Loading branch information
butler54 committed May 16, 2024
1 parent 088fe4e commit 72123d4
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/all/mcg/templates/bucket-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
placementPolicy:
tiers:
- backingStores:
- mcg-backingstore
- local-backingstore
placement: Spread
2 changes: 2 additions & 0 deletions charts/all/rhoai/templates/rhoai-datasciencecluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ spec:
trustyai:
managementState: Managed
workbenches:
managementState: Managed
kueue:
managementState: Managed
15 changes: 15 additions & 0 deletions charts/all/test-dsp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
description: Example helm chart for configuring a OpenShift AI project
name: test-dsp
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
21 changes: 21 additions & 0 deletions charts/all/test-dsp/templates/data-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# apiVersion: v1
# data:
# AWS_ACCESS_KEY_ID: b0VQQ2lpamo2NnpwYnVNUUR0ZU0=
# AWS_DEFAULT_REGION: ""
# AWS_S3_BUCKET: dGVzdC1vYmMtZDZhYzdmOGYtMjIxMC00MjFkLWJjY2YtNjQ2MGEyNTc1OTNh
# AWS_S3_ENDPOINT: aHR0cHM6Ly9zMy5vcGVuc2hpZnQtc3RvcmFnZS5zdmM6NDQz
# AWS_SECRET_ACCESS_KEY: VTBaa1BmTXNINXBkMEZwV2ZKdW50UWFpbk1qcHNKU3dNay9VOEk1aA==
# kind: Secret
# metadata:
# annotations:
# opendatahub.io/connection-type: s3
# openshift.io/display-name: test
# creationTimestamp: "2024-05-16T01:14:47Z"
# labels:
# opendatahub.io/dashboard: "true"
# opendatahub.io/managed: "true"
# name: aws-connection-test
# namespace: test2
# resourceVersion: "178464"
# uid: da7dd0a8-7256-48d0-ac24-2aa95f7436c1
# type: Opaque
10 changes: 10 additions & 0 deletions charts/all/test-dsp/templates/dsp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: Namespace
apiVersion: v1
metadata:
name: {{ .Values.dsp.name }}
labels:
opendatahub.io/dashboard: 'true'
annotations:
openshift.io/description: 'RHOAI llm demo project'
openshift.io/display-name: {{ .Values.dsp.name }}
spec: {}
177 changes: 177 additions & 0 deletions charts/all/test-dsp/templates/notebook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
apiVersion: kubeflow.org/v1
kind: Notebook
metadata:
annotations:
notebooks.opendatahub.io/inject-oauth: "true"
notebooks.opendatahub.io/last-image-selection: s2i-minimal-notebook:2024.1
notebooks.opendatahub.io/last-size-selection: Small
notebooks.opendatahub.io/oauth-logout-url: https://rhods-dashboard-redhat-ods-applications.apps.cluster-vwmdn.dynamic.redhatworkshops.io/projects/test2?notebookLogout=test
opendatahub.io/accelerator-name: ""
opendatahub.io/image-display-name: Minimal Python
openshift.io/description: ""
openshift.io/display-name: test
creationTimestamp: "2024-05-16T01:15:21Z"
generation: 1
labels:
app: test
opendatahub.io/dashboard: "true"
opendatahub.io/odh-managed: "true"
opendatahub.io/user: admin
name: test
namespace: {{ .Values.dsp.name }}
resourceVersion: "180908"
uid: f7e4e737-1ff1-4349-b01d-75edcc530e75
spec:
template:
spec:
affinity: {}
containers:
- env:
- name: NOTEBOOK_ARGS
value: |-
--ServerApp.port=8888
--ServerApp.token=''
--ServerApp.password=''
--ServerApp.base_url=/notebook/test2/test
--ServerApp.quit_button=False
--ServerApp.tornado_settings={"user":"admin","hub_host":"https://rhods-dashboard-redhat-ods-applications.apps.cluster-vwmdn.dynamic.redhatworkshops.io","hub_prefix":"/projects/test2"}
- name: JUPYTER_IMAGE
value: image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook:2024.1
- name: SSL_CERT_FILE
value: /etc/pki/tls/custom-certs/ca-bundle.crt
- name: PIPELINES_SSL_SA_CERTS
value: /etc/pki/tls/custom-certs/ca-bundle.crt
- name: PIP_CERT
value: /etc/pki/tls/custom-certs/ca-bundle.crt
- name: REQUESTS_CA_BUNDLE
value: /etc/pki/tls/custom-certs/ca-bundle.crt
envFrom:
- secretRef:
name: aws-connection-test
image: image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook:2024.1
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /notebook/test2/test/api
port: notebook-port
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
name: test
ports:
- containerPort: 8888
name: notebook-port
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /notebook/test2/test/api
port: notebook-port
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: "2"
memory: 8Gi
requests:
cpu: "1"
memory: 8Gi
volumeMounts:
- mountPath: /opt/app-root/src
name: test
- mountPath: /dev/shm
name: shm
- mountPath: /etc/pki/tls/custom-certs/ca-bundle.crt
name: trusted-ca
readOnly: true
subPath: ca-bundle.crt
workingDir: /opt/app-root/src
- args:
- --provider=openshift
- --https-address=:8443
- --http-address=
- --openshift-service-account=test
- --cookie-secret-file=/etc/oauth/config/cookie_secret
- --cookie-expire=24h0m0s
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --upstream=http://localhost:8888
- --upstream-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- --email-domain=*
- --skip-provider-button
- --openshift-sar={"verb":"get","resource":"notebooks","resourceAPIGroup":"kubeflow.org","resourceName":"test","namespace":"$(NAMESPACE)"}
- --logout-url=https://rhods-dashboard-redhat-ods-applications.apps.cluster-vwmdn.dynamic.redhatworkshops.io/projects/test2?notebookLogout=test
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: registry.redhat.io/openshift4/ose-oauth-proxy@sha256:4bef31eb993feb6f1096b51b4876c65a6fb1f4401fee97fa4f4542b6b7c9bc46
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /oauth/healthz
port: oauth-proxy
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
name: oauth-proxy
ports:
- containerPort: 8443
name: oauth-proxy
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /oauth/healthz
port: oauth-proxy
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 100m
memory: 64Mi
volumeMounts:
- mountPath: /etc/oauth/config
name: oauth-config
- mountPath: /etc/tls/private
name: tls-certificates
enableServiceLinks: false
serviceAccountName: test
volumes:
- name: test
persistentVolumeClaim:
claimName: test
- emptyDir:
medium: Memory
name: shm
- configMap:
items:
- key: ca-bundle.crt
path: ca-bundle.crt
name: workbench-trusted-ca-bundle
optional: true
name: trusted-ca
- name: oauth-config
secret:
defaultMode: 420
secretName: test-oauth-config
- name: tls-certificates
secret:
defaultMode: 420
secretName: test-tls
15 changes: 15 additions & 0 deletions charts/all/test-dsp/templates/obc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: objectbucket.io/v1alpha1
kind: ObjectBucketClaim
metadata:
labels:
app: noobaa
bucket-provisioner: openshift-storage.noobaa.io-obc
noobaa-domain: openshift-storage.noobaa.io
name: test-obc
namespace: {{ .Values.dsp.name }}
spec:
additionalConfig:
bucketclass: default-bucket
bucketName: test-obc-{{ .Values.dsp.name }}
objectBucketName: obc-default-test-obc
storageClassName: openshift-storage.noobaa.io
39 changes: 39 additions & 0 deletions charts/all/test-dsp/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# apiVersion: v1
# items:
# - apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# annotations:
# openshift.io/description: ""
# openshift.io/display-name: test-workbench
# pv.kubernetes.io/bind-completed: "yes"
# pv.kubernetes.io/bound-by-controller: "yes"
# volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
# volume.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
# creationTimestamp: "2024-03-18T03:25:58Z"
# finalizers:
# - kubernetes.io/pvc-protection
# labels:
# opendatahub.io/dashboard: "true"
# name: test-workbench
# namespace: test001
# resourceVersion: "556509"
# uid: 70358b71-aa56-456b-890b-9f00f5ac8cc1
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 20Gi
# storageClassName: ocs-external-storagecluster-ceph-rbd
# volumeMode: Filesystem
# volumeName: pvc-70358b71-aa56-456b-890b-9f00f5ac8cc1
# status:
# accessModes:
# - ReadWriteOnce
# capacity:
# storage: 20Gi
# phase: Bound
# kind: List
# metadata:
# resourceVersion: ""
20 changes: 20 additions & 0 deletions charts/all/test-dsp/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@



secretStore:
name: vault-backend
kind: ClusterSecretStore

# Secret provisioned for the AWS Controller for Kubernetes - S3
# Begin global parameters


dsp:
name: test-project
description: "My dsp test project"
bucketName: bucket
notebookStorage: '20Gi'


# https://github.com/openshift-ai-examples/openshift-ai-examples/blob/main/openshift-ai-deploy-llm/manifests/3-notebook-template.yaml

9 changes: 8 additions & 1 deletion values-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ clusterGroup:
channel: production
source: certified-operators



# rhdh:
# name: rhdh
# namespace: rhdh-operator
Expand Down Expand Up @@ -109,7 +111,12 @@ clusterGroup:
namespace: redhat-ods-operator
project: hub
path: charts/all/rhoai

# Example project
test-dsp:
name: test-dsp
namespace: default
project: hub
path: charts/all/test-dsp
imperative:
# NOTE: We *must* use lists and not hashes. As hashes lose ordering once parsed by helm
# The default schedule is every 10 minutes: imperative.schedule
Expand Down

0 comments on commit 72123d4

Please sign in to comment.