Skip to content

Commit

Permalink
Merge pull request #10 from tonyxrmdavidson/openshiftCIModelRegistryD…
Browse files Browse the repository at this point in the history
…eploy

This commit will deploy model-registry to the openshift-ci deployment
  • Loading branch information
openshift-merge-bot[bot] authored Feb 22, 2024
2 parents 6616c3e + d58b22b commit 771a124
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
21 changes: 21 additions & 0 deletions openshift-ci/resources/model-registry-DSCInitialization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: dscinitialization.opendatahub.io/v1
kind: DSCInitialization
metadata:
name: model-registry-dsci
labels:
app.kubernetes.io/created-by: opendatahub-operator
app.kubernetes.io/instance: default
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: dscinitialization
app.kubernetes.io/part-of: opendatahub-operator
spec:
applicationsNamespace: opendatahub
monitoring:
namespace: opendatahub
managementState: Managed
serviceMesh:
controlPlane:
metricsCollection: Istio
name: data-science-smcp
namespace: istio-system
managementState: Managed
38 changes: 38 additions & 0 deletions openshift-ci/resources/model-registry-data-science-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
kind: DataScienceCluster
apiVersion: datasciencecluster.opendatahub.io/v1
metadata:
labels:
app.kubernetes.io/created-by: opendatahub-operator
app.kubernetes.io/instance: default
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: datasciencecluster
app.kubernetes.io/part-of: opendatahub-operator
name: default-dsc
spec:
components:
codeflare:
managementState: Removed
dashboard:
managementState: Managed
datasciencepipelines:
managementState: Managed
kserve:
managementState: Managed
serving:
ingressGateway:
certificate:
type: SelfSigned
managementState: Managed
name: knative-serving
kueue:
managementState: Removed
modelmeshserving:
managementState: Managed
modelregistry:
managementState: Managed
ray:
managementState: Removed
trustyai:
managementState: Managed
workbenches:
managementState: Managed
11 changes: 11 additions & 0 deletions openshift-ci/resources/model-registry-operator-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: opendatahub-operator
namespace: openshift-operators
spec:
channel: fast
installPlanApproval: Automatic
name: opendatahub-operator
source: community-operators
sourceNamespace: openshift-marketplace
40 changes: 40 additions & 0 deletions openshift-ci/scripts/oci-model-registry-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Define variables
MODEL_REGISTRY_DEPLOY_MANIFEST="model-registry-operator-deploy.yaml"
DSC_INITIALIZATION_MANIFEST="model-registry-DSCInitialization.yaml"
DATA_SCIENCE_CLUSTER_MANIFEST="model-registry-data-science-cluster.yaml"
TIMEOUT=${DEPLOY_TIMEOUT:-300s} # Default timeout is 300 seconds, can be overridden by setting DEPLOY_TIMEOUT environment variable

# Function to deploy and wait for deployment
deploy_and_wait() {
local manifest=$1
local resource_name=$(basename -s .yaml $manifest)

echo "Deploying $resource_name from $manifest..."
oc apply -f $manifest

echo "Waiting for $resource_name to be ready with timeout $TIMEOUT..."
if ! oc wait --for=condition=Available deployment/$resource_name --timeout=$TIMEOUT; then
echo "Error: $resource_name deployment failed or timed out."
exit 1
fi

echo "$resource_name deployed successfully!"
}

# Deploy resource and wait for readiness
deploy_resource() {
local manifest=$1
deploy_and_wait $manifest
}

# Main function for orchestrating deployments
main() {
deploy_resource $MODEL_REGISTRY_DEPLOY_MANIFEST
deploy_resource $DSC_INITIALIZATION_MANIFEST
deploy_resource $DATA_SCIENCE_CLUSTER_MANIFEST
}

# Execute main function
main

0 comments on commit 771a124

Please sign in to comment.