Skip to content

Commit

Permalink
Update (#192)
Browse files Browse the repository at this point in the history
* Create user projects in batches of 5

* remove rolling sync strategy
  • Loading branch information
guimou authored Nov 28, 2024
1 parent 01c2865 commit f0e6636
Show file tree
Hide file tree
Showing 47 changed files with 617 additions and 205 deletions.
42 changes: 0 additions & 42 deletions bootstrap/applicationset/applicationset-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,48 +57,6 @@ spec:
repoURL: https://github.com/rh-aiservices-bu/parasol-insurance.git
targetRevision: main-rhoai-2.13
path: bootstrap/ic-shared-app
strategy:
type: RollingSync
rollingSync:
steps:
- matchExpressions:
- key: purpose
operator: In
values:
- ic-rhoai-operator
- matchExpressions:
- key: purpose
operator: In
values:
- ic-rhoai-installation
- matchExpressions:
- key: purpose
operator: In
values:
- ic-rhoai-configuration
- matchExpressions:
- key: purpose
operator: In
values:
- ic-shared-minio-app
- ic-shared-database-app
- matchExpressions:
- key: purpose
operator: In
values:
- ic-shared-milvus
- matchExpressions:
- key: purpose
operator: In
values:
- ic-shared-llm-app
- matchExpressions:
- key: purpose
operator: In
values:
- ic-shared-app
- ic-user-projects
- ic-shared-img-det
template:
metadata:
name: "{{name}}"
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/ic-rhoai-configuration/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ commonLabels:
component: ic-rhoai-configuration

resources:
# presync
- presync.yaml
# wave 0
- gp3-remove-default.yaml
- ceph-rbd-set-default.yaml
Expand Down
32 changes: 32 additions & 0 deletions bootstrap/ic-rhoai-configuration/presync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: batch/v1
kind: Job
metadata:
name: check-rhoai-status
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/hook: PreSync
spec:
template:
spec:
restartPolicy: Never
containers:
- name: phase-check
image: 'image-registry.openshift-image-registry.svc:5000/openshift/tools:latest'
command:
- /bin/sh
- -c
- |
while true; do
echo "Checking DSC and DSCi status..."
DSC_PHASE=$(oc get DataScienceCluster -o jsonpath='{.items[0].status.phase}')
DSCI_PHASE=$(oc get DSCInitialization -o jsonpath='{.items[0].status.phase}')
if [[ "$DSC_PHASE" = "Ready" && "$DSCI_PHASE" = "Ready" ]]; then
echo "DSCi and DSC are ready."
exit 0
else
echo "DSC is in $DSC_PHASE phase."
echo "DSCi is in $DSCI_PHASE phase."
fi
sleep 5
done
serviceAccountName: presync-monitoring-sa
2 changes: 2 additions & 0 deletions bootstrap/ic-rhoai-installation/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
# presync
- presync.yaml
# wave 1
- dsci.yaml
30 changes: 30 additions & 0 deletions bootstrap/ic-rhoai-installation/presync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: batch/v1
kind: Job
metadata:
name: check-rhods-operator-status
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/hook: PreSync
spec:
template:
spec:
restartPolicy: Never
containers:
- name: phase-check
image: 'image-registry.openshift-image-registry.svc:5000/openshift/tools:latest'
command:
- /bin/sh
- -c
- |
while true; do
echo "Checking Pod status.phase..."
POD_PHASE=$(oc get pod -n redhat-ods-operator -l name=rhods-operator -o jsonpath='{.items[0].status.phase}')
if [ "$POD_PHASE" = "Running" ]; then
echo "Pod is in Running phase."
exit 0
else
echo "Pod is in $POD_PHASE phase."
fi
sleep 5
done
serviceAccountName: presync-monitoring-sa
6 changes: 4 additions & 2 deletions bootstrap/ic-rhoai-operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: Kustomization

resources:
# wave 0
- subscription-authorino.yaml
# wave 1
- namespace.yaml
# wave 1
- rbac-presync-monitoring.yaml
- subscription-authorino.yaml
# wave 2
- operator-group.yaml
- subscription.yaml
4 changes: 2 additions & 2 deletions bootstrap/ic-rhoai-operator/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v1
kind: Namespace
metadata:
annotations:
openshift.io/display-name: "Red Hat OpenShift AI"
argocd.argoproj.io/sync-wave: "1"
openshift.io/display-name: "OpenShift AI Operator"
argocd.argoproj.io/sync-wave: "0"
labels:
openshift.io/cluster-monitoring: "true"
name: redhat-ods-operator
2 changes: 1 addition & 1 deletion bootstrap/ic-rhoai-operator/operator-group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ metadata:
name: rhods-operator-group
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/sync-wave: "1"
argocd.argoproj.io/sync-wave: "2"
46 changes: 46 additions & 0 deletions bootstrap/ic-rhoai-operator/rbac-presync-monitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: presync-monitoring-sa
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/sync-wave: "1"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: presync-monitoring-cluster-role
annotations:
argocd.argoproj.io/sync-wave: "1"
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
- apiGroups: ["dscinitialization.opendatahub.io"]
resources: ["dscinitializations"]
verbs: ["get", "list", "watch"]
- apiGroups: ["datasciencecluster.opendatahub.io"]
resources: ["datascienceclusters"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: presync-monitoring-cluster-role-binding
annotations:
argocd.argoproj.io/sync-wave: "1"
subjects:
- kind: ServiceAccount
name: presync-monitoring-sa
namespace: redhat-ods-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: presync-monitoring-cluster-role
2 changes: 1 addition & 1 deletion bootstrap/ic-rhoai-operator/subscription-authorino.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: authorino-operator
namespace: openshift-operators
annotations:
argocd.argoproj.io/sync-wave: "0"
argocd.argoproj.io/sync-wave: "2"
spec:
channel: tech-preview-v1
installPlanApproval: Automatic
Expand Down
25 changes: 16 additions & 9 deletions bootstrap/ic-shared-app/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: ic-shared-app
#namespace: ic-shared-app
# replaced by transformer

commonLabels:
component: ic-claim-app

resources:
# wave 0
- namespace.yaml
- secret-db.yaml
- secret-minio.yaml
# wave 1
- deployment-app.yaml
- service-app.yaml
- route-app.yaml
# presync
- presync-database.yaml
- presync-minio.yaml
# wave 0
- namespace.yaml
- secret-db.yaml
- secret-minio.yaml
# wave 1
- deployment-app.yaml
- service-app.yaml
- route-app.yaml

transformers:
- namespace-transformer.yaml
6 changes: 6 additions & 0 deletions bootstrap/ic-shared-app/namespace-transformer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: notImportantHere
namespace: ic-shared-app
unsetOnly: true
30 changes: 30 additions & 0 deletions bootstrap/ic-shared-app/presync-database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: batch/v1
kind: Job
metadata:
name: check-database-ready-app
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/hook: PreSync
spec:
template:
spec:
restartPolicy: Never
containers:
- name: phase-check
image: 'image-registry.openshift-image-registry.svc:5000/openshift/tools:latest'
command:
- /bin/sh
- -c
- |
while true; do
echo "Checking Pod status.phase..."
POD_PHASE=$(oc get pod -n ic-shared-db -l app=ic-shared-db -o jsonpath='{.items[0].status.phase}')
if [ "$POD_PHASE" = "Running" ]; then
echo "Pod is in Running phase."
exit 0
else
echo "Pod is in $POD_PHASE phase."
fi
sleep 5
done
serviceAccountName: presync-monitoring-sa
30 changes: 30 additions & 0 deletions bootstrap/ic-shared-app/presync-minio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: batch/v1
kind: Job
metadata:
name: check-minio-ready-app
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/hook: PreSync
spec:
template:
spec:
restartPolicy: Never
containers:
- name: phase-check
image: 'image-registry.openshift-image-registry.svc:5000/openshift/tools:latest'
command:
- /bin/sh
- -c
- |
while true; do
echo "Checking Pod status.phase..."
POD_PHASE=$(oc get pod -n ic-shared-minio -l app=minio -o jsonpath='{.items[0].status.phase}')
if [ "$POD_PHASE" = "Running" ]; then
echo "Pod is in Running phase."
exit 0
else
echo "Pod is in $POD_PHASE phase."
fi
sleep 5
done
serviceAccountName: presync-monitoring-sa
32 changes: 19 additions & 13 deletions bootstrap/ic-shared-database/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: ic-shared-db
#namespace: ic-shared-db
# replaced by transformer

commonLabels:
component: ic-shared-db

resources:
# wave 0
- namespace.yaml
# wave 1
- pvc.yaml
- secret.yaml
- secret-minio.yaml
- deployment.yaml
- service.yaml
- sql-script-configmap.yaml
# wave 2
- db-init-job.yaml
- populate-images.yaml
# presync
- presync.yaml
# wave 0
- namespace.yaml
# wave 1
- pvc.yaml
- secret.yaml
- secret-minio.yaml
- deployment.yaml
- service.yaml
- sql-script-configmap.yaml
# wave 2
- db-init-job.yaml
- populate-images.yaml

transformers:
- namespace-transformer.yaml
6 changes: 6 additions & 0 deletions bootstrap/ic-shared-database/namespace-transformer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: notImportantHere
namespace: ic-shared-db
unsetOnly: true
30 changes: 30 additions & 0 deletions bootstrap/ic-shared-database/presync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: batch/v1
kind: Job
metadata:
name: check-default-storageclass-db
namespace: redhat-ods-operator
annotations:
argocd.argoproj.io/hook: PreSync
spec:
template:
spec:
restartPolicy: Never
containers:
- name: phase-check
image: 'image-registry.openshift-image-registry.svc:5000/openshift/tools:latest'
command:
- /bin/sh
- -c
- |
while true; do
echo "Checking default StorageClass..."
SC=$(oc get StorageClass ocs-storagecluster-ceph-rbd -o jsonpath='{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}')
if [ "$SC" = "true" ]; then
echo "Storage class is ready."
exit 0
else
echo "Storage class is not ready yet."
fi
sleep 5
done
serviceAccountName: presync-monitoring-sa
Loading

0 comments on commit f0e6636

Please sign in to comment.