Skip to content

Commit

Permalink
Merge pull request #96 from rh-aiservices-bu/fix/auto-project-cleanup
Browse files Browse the repository at this point in the history
Cleanup and added tools for managing failing users
  • Loading branch information
guimou authored Apr 24, 2024
2 parents 94675db + 19d0a62 commit fc1687f
Show file tree
Hide file tree
Showing 5 changed files with 572 additions and 13 deletions.
21 changes: 15 additions & 6 deletions bootstrap/ic-user-projects/create-projects-and-resources-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ spec:
# Get user count
user_count=$(oc get namespaces | grep showroom | wc -l)
echo -n 'Waiting for minio-root-user secret'
while [ -z "\$(oc get secret -n ic-shared-minio minio-root-user -oname 2>/dev/null)" ]; do
echo -n .
sleep 5
done; echo
echo -n 'Waiting for rhods-dashboard route'
while [ -z "\$(oc get route -n redhat-ods-applications rhods-dashboard -oname 2>/dev/null)" ]; do
echo -n .
sleep 5
done; echo
# Get needed variables
MINIO_ROOT_USER=$(oc get secret minio-root-user -n ic-shared-minio -o template --template '{{.data.MINIO_ROOT_USER|base64decode}}')
MINIO_ROOT_PASSWORD=$(oc get secret minio-root-user -n ic-shared-minio -o template --template '{{.data.MINIO_ROOT_PASSWORD|base64decode}}')
Expand Down Expand Up @@ -141,12 +153,6 @@ spec:
- args:
- -ec
- |-
echo -n "Waiting for minio-root-user to exist"
while [ -z "\$(oc get secret -n ic-shared-minio minio-root-user -oname 2>/dev/null)" ]; do
echo -n '.'
sleep 1
done; echo
echo "Minio user: $MINIO_ROOT_USER"
echo "Minio pass: $MINIO_ROOT_PASSWORD"
echo "Internal service url: http://minio.ic-shared-minio.svc.cluster.local:9000/"
Expand Down Expand Up @@ -513,5 +519,8 @@ spec:
pod_name=\$(oc get pods --selector=app=$WORKBENCH_NAME -o jsonpath='{.items[0].metadata.name}') && oc exec \$pod_name -- git clone https://github.com/rh-aiservices-bu/parasol-insurance
restartPolicy: Never
EOF
sleep 20
done
restartPolicy: Never
21 changes: 15 additions & 6 deletions bootstrap/ic-user-projects/create-projects-and-resources.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
# Get user count
user_count=$(oc get namespaces | grep showroom | wc -l)

echo -n 'Waiting for minio-root-user secret'
while [ -z "\$(oc get secret -n ic-shared-minio minio-root-user -oname 2>/dev/null)" ]; do
echo -n .
sleep 5
done; echo

echo -n 'Waiting for rhods-dashboard route'
while [ -z "\$(oc get route -n redhat-ods-applications rhods-dashboard -oname 2>/dev/null)" ]; do
echo -n .
sleep 5
done; echo

# Get needed variables
MINIO_ROOT_USER=$(oc get secret minio-root-user -n ic-shared-minio -o template --template '{{.data.MINIO_ROOT_USER|base64decode}}')
MINIO_ROOT_PASSWORD=$(oc get secret minio-root-user -n ic-shared-minio -o template --template '{{.data.MINIO_ROOT_PASSWORD|base64decode}}')
Expand Down Expand Up @@ -119,12 +131,6 @@ spec:
- args:
- -ec
- |-
echo -n "Waiting for minio-root-user to exist"
while [ -z "\$(oc get secret -n ic-shared-minio minio-root-user -oname 2>/dev/null)" ]; do
echo -n '.'
sleep 1
done; echo
echo "Minio user: $MINIO_ROOT_USER"
echo "Minio pass: $MINIO_ROOT_PASSWORD"
echo "Internal service url: http://minio.ic-shared-minio.svc.cluster.local:9000/"
Expand Down Expand Up @@ -491,4 +497,7 @@ spec:
pod_name=\$(oc get pods --selector=app=$WORKBENCH_NAME -o jsonpath='{.items[0].metadata.name}') && oc exec \$pod_name -- git clone https://github.com/rh-aiservices-bu/parasol-insurance
restartPolicy: Never
EOF

sleep 20

done
Loading

0 comments on commit fc1687f

Please sign in to comment.