-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Scaffolder
committed
Nov 8, 2024
0 parents
commit 679bb9a
Showing
33 changed files
with
812 additions
and
0 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,25 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: test-missingvars-nov8-app | ||
namespace: ai-rhdh | ||
finalizers: ["resources-finalizer.argocd.argoproj.io"] | ||
spec: | ||
project: default | ||
source: | ||
path: ./components/test-missingvars-nov8/overlays/development | ||
repoURL: https://github.com/jdubrick-ai/test-missingvars-nov8-gitops.git | ||
targetRevision: main | ||
destination: | ||
namespace: rhdh-app | ||
server: https://kubernetes.default.svc | ||
syncPolicy: | ||
managedNamespaceMetadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: ai-rhdh | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true | ||
- PruneLast=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
rhtap/gitops: test-missingvars-nov8 | ||
janus-idp.io/tekton: test-missingvars-nov8 | ||
backstage.io/kubernetes-id: test-missingvars-nov8 | ||
backstage.io/kubernetes-namespace: rhdh-app | ||
app.kubernetes.io/part-of: test-missingvars-nov8 | ||
resources: | ||
- application-dev.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: test-missingvars-nov8 | ||
namespace: ai-rhdh | ||
finalizers: ["resources-finalizer.argocd.argoproj.io"] | ||
spec: | ||
project: default | ||
source: | ||
path: ./app-of-apps | ||
repoURL: https://github.com/jdubrick-ai/test-missingvars-nov8-gitops.git | ||
targetRevision: main | ||
destination: | ||
namespace: rhdh-app | ||
server: https://kubernetes.default.svc | ||
syncPolicy: | ||
managedNamespaceMetadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: ai-rhdh | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true | ||
- PruneLast=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Resource | ||
metadata: | ||
name: test-missingvars-nov8-gitops | ||
description: This is GitOps manifest for test-missingvars-nov8 | ||
links: | ||
- url: https://www.redhat.com/en/solutions/trusted-software-supply-chain | ||
title: Trusted Secure Supply Chain | ||
icon: dashboard | ||
type: admin-dashboard | ||
annotations: | ||
argocd/app-name: test-missingvars-nov8 | ||
janus-idp.io/tekton: test-missingvars-nov8 | ||
backstage.io/kubernetes-id: test-missingvars-nov8 | ||
backstage.io/techdocs-ref: dir:. | ||
spec: | ||
type: gitops | ||
owner: user:guest | ||
lifecycle: experimental | ||
dependsOn: | ||
- component:test-missingvars-nov8 |
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,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-missingvars-nov8-database-config | ||
data: | ||
VECTORDB_HOST: "test-missingvars-nov8-database" | ||
VECTORDB_PORT: "" |
38 changes: 38 additions & 0 deletions
38
components/test-missingvars-nov8/base/deployment-database.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: test-missingvars-nov8-database | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: test-missingvars-nov8-database | ||
app.kubernetes.io/part-of: test-missingvars-nov8 | ||
name: test-missingvars-nov8-database | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: test-missingvars-nov8-database | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: test-missingvars-nov8-database | ||
spec: | ||
containers: | ||
- image: | ||
name: database | ||
args: [ | ||
"--workers", | ||
"1", | ||
"--host", | ||
"0.0.0.0", | ||
"--port", | ||
"", | ||
"--proxy-headers", | ||
"--log-config", | ||
"chromadb/log_config.yml", | ||
"--timeout-keep-alive", | ||
"30"] | ||
ports: | ||
- containerPort: | ||
securityContext: | ||
runAsNonRoot: true |
48 changes: 48 additions & 0 deletions
48
components/test-missingvars-nov8/base/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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: test-missingvars-nov8-model-server | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: test-missingvars-nov8-model-server | ||
app.kubernetes.io/part-of: test-missingvars-nov8 | ||
name: test-missingvars-nov8-model-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: test-missingvars-nov8-model-server | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: test-missingvars-nov8-model-server | ||
spec: | ||
initContainers: | ||
- name: model-file | ||
image: quay.io/redhat-ai-dev/granite-7b-lab:latest | ||
command: ['/usr/bin/install', '/model/model.file', '/shared/'] | ||
volumeMounts: | ||
- name: model-file | ||
mountPath: /shared | ||
containers: | ||
- env: | ||
- name: HOST | ||
value: "0.0.0.0" | ||
- name: PORT | ||
value: "8001" | ||
- name: MODEL_PATH | ||
value: /model/model.file | ||
- name: CHAT_FORMAT | ||
value: openchat | ||
image: quay.io/ai-lab/llamacpp_python:latest | ||
volumeMounts: | ||
- name: model-file | ||
mountPath: /model | ||
name: app-model-service | ||
ports: | ||
- containerPort: 8001 | ||
securityContext: | ||
runAsNonRoot: true | ||
volumes: | ||
- name: model-file | ||
emptyDir: {} |
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,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
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: | ||
app.kubernetes.io/instance: test-missingvars-nov8 | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: test-missingvars-nov8 | ||
app.kubernetes.io/part-of: test-missingvars-nov8 | ||
name: test-missingvars-nov8 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: test-missingvars-nov8 | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: test-missingvars-nov8 | ||
spec: | ||
containers: | ||
- image: quay.io/redhat-ai-dev/ai-template-bootstrap-app:latest | ||
name: app-inference | ||
envFrom: | ||
- configMapRef: | ||
name: test-missingvars-nov8-model-config | ||
ports: | ||
- containerPort: 8501 | ||
securityContext: | ||
runAsNonRoot: true |
42 changes: 42 additions & 0 deletions
42
components/test-missingvars-nov8/base/initialize-namespace.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: initialize-namespace-test-missingvars-nov8-gitops | ||
spec: | ||
template: | ||
metadata: | ||
name: initialize-namespace-test-missingvars-nov8-gitops | ||
spec: | ||
serviceAccountName: pipeline | ||
containers: | ||
- name: initialize-namespace | ||
image: quay.io/redhat-ai-dev/utils:latest | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
NS=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) | ||
echo "Initialize RHDH Namespace: $NS" | ||
cat <<CONFIGURE_PIPELINE | oc create -f - | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: dev-namespace-setup- | ||
namespace: $NS | ||
spec: | ||
pipelineSpec: | ||
tasks: | ||
- name: configure-namespace | ||
taskRef: | ||
kind: Task | ||
params: | ||
- name: kind | ||
value: task | ||
- name: name | ||
value: dev-namespace-setup | ||
- name: namespace | ||
value: ai-rhdh | ||
resolver: cluster | ||
CONFIGURE_PIPELINE | ||
restartPolicy: Never |
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,16 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
argocd/app-name: test-missingvars-nov8 | ||
janus-idp.io/tekton: test-missingvars-nov8 | ||
backstage.io/kubernetes-id: test-missingvars-nov8 | ||
backstage.io/kubernetes-namespace: rhdh-app | ||
app.kubernetes.io/part-of: test-missingvars-nov8 | ||
resources: | ||
- initialize-namespace.yaml | ||
- deployment-model-server.yaml | ||
- service-model-server.yaml | ||
- deployment.yaml | ||
- route.yaml | ||
- service.yaml | ||
- model-config.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-missingvars-nov8-model-config | ||
data: | ||
MODEL_ENDPOINT: "http://test-missingvars-nov8-model-server:8001" |
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,16 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: test-missingvars-nov8 | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: test-missingvars-nov8 | ||
name: test-missingvars-nov8 | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
resources: | ||
requests: | ||
storage: 100Gi |
54 changes: 54 additions & 0 deletions
54
components/test-missingvars-nov8/base/rhoai/create-imagestream.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: create-imagestream-test-missingvars-nov8-gitops | ||
spec: | ||
template: | ||
metadata: | ||
name: create-imagestream-test-missingvars-nov8-gitops | ||
spec: | ||
serviceAccountName: test-missingvars-nov8-dsp-job | ||
containers: | ||
- name: create-imagestream | ||
image: quay.io/redhat-ai-dev/utils:latest | ||
|
||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
# Check for image stream and create it not present | ||
echo "Checking if the image stream exist" | ||
if ! oc get is custom-sqlite3-odh-minimal-notebook-container -n redhat-ods-applications >/dev/null 2>&1 ; then | ||
echo "The image stream does not exist, a new image stream will be created" | ||
cat <<EOF | oc apply -f - | ||
kind: ImageStream | ||
apiVersion: image.openshift.io/v1 | ||
metadata: | ||
annotations: | ||
opendatahub.io/notebook-image-name: custom-sqlite3-odh-minimal-notebook-container | ||
opendatahub.io/notebook-image-url: 'quay.io/redhat-ai-dev/odh-minimal-notebook-container:v2-2024a-20240523-sqlite3' | ||
name: custom-sqlite3-odh-minimal-notebook-container | ||
namespace: redhat-ods-applications | ||
labels: | ||
opendatahub.io/dashboard: 'true' | ||
opendatahub.io/notebook-image: 'true' | ||
spec: | ||
lookupPolicy: | ||
local: true | ||
tags: | ||
- name: v2-2024a-20240523-sqlite3 | ||
annotations: | ||
openshift.io/imported-from: 'quay.io/redhat-ai-dev/odh-minimal-notebook-container:v2-2024a-20240523-sqlite3' | ||
from: | ||
kind: DockerImage | ||
name: 'quay.io/redhat-ai-dev/odh-minimal-notebook-container:v2-2024a-20240523-sqlite3' | ||
generation: 2 | ||
importPolicy: | ||
importMode: Legacy | ||
referencePolicy: | ||
type: Source | ||
EOF | ||
else | ||
echo "Image stream is already present, skipping create" | ||
fi | ||
restartPolicy: Never |
21 changes: 21 additions & 0 deletions
21
components/test-missingvars-nov8/base/rhoai/dsp-clone-job.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: dsp-clone-job-test-missingvars-nov8-gitops | ||
spec: | ||
template: | ||
metadata: | ||
name: dsp-clone-job-test-missingvars-nov8-gitops | ||
spec: | ||
serviceAccountName: test-missingvars-nov8-dsp-job | ||
containers: | ||
- name: initialize-dsp | ||
image: quay.io/redhat-ai-dev/utils:latest | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
NS=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) | ||
oc wait -l statefulset=test-missingvars-nov8-notebook --for=condition=ready pod --timeout=300s | ||
oc exec StatefulSet/test-missingvars-nov8-notebook -- git clone https://github.com/jdubrick-ai/test-missingvars-nov8 | ||
restartPolicy: Never |
12 changes: 12 additions & 0 deletions
12
components/test-missingvars-nov8/base/rhoai/dsp-job-rb.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: test-missingvars-nov8-dsp-job-rolebinding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: test-missingvars-nov8-dsp-job | ||
namespace: rhdh-app | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: test-missingvars-nov8-dsp-job-role |
Oops, something went wrong.