diff --git a/.wordlist-md b/.wordlist-md index 5dc1b52c..6e7931a2 100644 --- a/.wordlist-md +++ b/.wordlist-md @@ -151,6 +151,7 @@ httpErrorCodePages https iam IAM +ide idp IgnoreExtraneous igor @@ -321,6 +322,8 @@ RollingUpdate Rollout rolloutStrategy rpardini +rstudio +RStudio runtime sagemaker Sagemaker diff --git a/components/app-configs/custom-notebook-images/NOTES.md b/components/app-configs/rhoai-custom-images/NOTES.md similarity index 100% rename from components/app-configs/custom-notebook-images/NOTES.md rename to components/app-configs/rhoai-custom-images/NOTES.md diff --git a/components/app-configs/custom-notebook-images/base/code-server/imagestream.yaml b/components/app-configs/rhoai-custom-images/base/code-server/imagestream.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/code-server/imagestream.yaml rename to components/app-configs/rhoai-custom-images/base/code-server/imagestream.yaml diff --git a/components/app-configs/custom-notebook-images/base/code-server/kustomization.yaml b/components/app-configs/rhoai-custom-images/base/code-server/kustomization.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/code-server/kustomization.yaml rename to components/app-configs/rhoai-custom-images/base/code-server/kustomization.yaml diff --git a/components/app-configs/custom-notebook-images/base/kustomization.yaml b/components/app-configs/rhoai-custom-images/base/kustomization.yaml similarity index 92% rename from components/app-configs/custom-notebook-images/base/kustomization.yaml rename to components/app-configs/rhoai-custom-images/base/kustomization.yaml index 98aaf978..58184790 100644 --- a/components/app-configs/custom-notebook-images/base/kustomization.yaml +++ b/components/app-configs/rhoai-custom-images/base/kustomization.yaml @@ -1,6 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization +namespace: custom-notebooks + commonAnnotations: opendatahub.io/notebook-image-creator: ai-catalog @@ -12,12 +14,8 @@ labels: # note: byon = bring your own notebook? app.kubernetes.io/created-by: byon -namespace: custom-notebooks - resources: - ./code-server - ./lightgbm - ./opencv - ./rstudio - - namespace.yaml - - namespace-rb.yaml diff --git a/components/app-configs/custom-notebook-images/base/lightgbm/Containerfile b/components/app-configs/rhoai-custom-images/base/lightgbm/Containerfile similarity index 100% rename from components/app-configs/custom-notebook-images/base/lightgbm/Containerfile rename to components/app-configs/rhoai-custom-images/base/lightgbm/Containerfile diff --git a/components/app-configs/custom-notebook-images/base/lightgbm/Pipfile b/components/app-configs/rhoai-custom-images/base/lightgbm/Pipfile similarity index 100% rename from components/app-configs/custom-notebook-images/base/lightgbm/Pipfile rename to components/app-configs/rhoai-custom-images/base/lightgbm/Pipfile diff --git a/components/app-configs/custom-notebook-images/base/lightgbm/Pipfile.lock b/components/app-configs/rhoai-custom-images/base/lightgbm/Pipfile.lock similarity index 100% rename from components/app-configs/custom-notebook-images/base/lightgbm/Pipfile.lock rename to components/app-configs/rhoai-custom-images/base/lightgbm/Pipfile.lock diff --git a/components/app-configs/custom-notebook-images/base/lightgbm/buildconfig.yml b/components/app-configs/rhoai-custom-images/base/lightgbm/buildconfig.yml similarity index 100% rename from components/app-configs/custom-notebook-images/base/lightgbm/buildconfig.yml rename to components/app-configs/rhoai-custom-images/base/lightgbm/buildconfig.yml diff --git a/components/app-configs/custom-notebook-images/base/lightgbm/imagestream.yml b/components/app-configs/rhoai-custom-images/base/lightgbm/imagestream.yml similarity index 100% rename from components/app-configs/custom-notebook-images/base/lightgbm/imagestream.yml rename to components/app-configs/rhoai-custom-images/base/lightgbm/imagestream.yml diff --git a/components/app-configs/custom-notebook-images/base/lightgbm/kustomization.yaml b/components/app-configs/rhoai-custom-images/base/lightgbm/kustomization.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/lightgbm/kustomization.yaml rename to components/app-configs/rhoai-custom-images/base/lightgbm/kustomization.yaml diff --git a/components/app-configs/custom-notebook-images/base/opencv/Containerfile b/components/app-configs/rhoai-custom-images/base/opencv/Containerfile similarity index 100% rename from components/app-configs/custom-notebook-images/base/opencv/Containerfile rename to components/app-configs/rhoai-custom-images/base/opencv/Containerfile diff --git a/components/app-configs/custom-notebook-images/base/opencv/buildconfig-graphviz.yaml b/components/app-configs/rhoai-custom-images/base/opencv/buildconfig-graphviz.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/opencv/buildconfig-graphviz.yaml rename to components/app-configs/rhoai-custom-images/base/opencv/buildconfig-graphviz.yaml diff --git a/components/app-configs/custom-notebook-images/base/opencv/buildconfig.yaml b/components/app-configs/rhoai-custom-images/base/opencv/buildconfig.yaml similarity index 86% rename from components/app-configs/custom-notebook-images/base/opencv/buildconfig.yaml rename to components/app-configs/rhoai-custom-images/base/opencv/buildconfig.yaml index f4635862..f39c9278 100644 --- a/components/app-configs/custom-notebook-images/base/opencv/buildconfig.yaml +++ b/components/app-configs/rhoai-custom-images/base/opencv/buildconfig.yaml @@ -7,7 +7,8 @@ spec: type: Git git: uri: https://github.com/redhat-na-ssa/demo-ai-gitops-catalog.git - contextDir: components/app-configs/custom-notebook-images/base/opencv + ref: main + contextDir: components/app-configs/rhoai-custom-images/base/opencv strategy: type: Docker dockerStrategy: diff --git a/components/app-configs/custom-notebook-images/base/opencv/imagestream.yaml b/components/app-configs/rhoai-custom-images/base/opencv/imagestream.yaml similarity index 92% rename from components/app-configs/custom-notebook-images/base/opencv/imagestream.yaml rename to components/app-configs/rhoai-custom-images/base/opencv/imagestream.yaml index a8f39b48..be31f2fb 100644 --- a/components/app-configs/custom-notebook-images/base/opencv/imagestream.yaml +++ b/components/app-configs/rhoai-custom-images/base/opencv/imagestream.yaml @@ -9,8 +9,8 @@ metadata: CUDA, TensorFlow, OpenCV, mesa-libGL, Graphviz for Computer Vision opendatahub.io/notebook-image-name: 'OpenCV' opendatahub.io/notebook-image-order: '10' - opendatahub.io/notebook-image-url: >- - https://github.com/redhat-na-ssa/demo-ai-gitops-catalog + opendatahub.io/notebook-image-url: https://github.com/redhat-na-ssa/demo-ai-gitops-catalog + opendatahub.io/recommended-accelerators: '["nvidia.com/gpu"]' name: opencv-notebook labels: # note: the following label allows the notebook to show up in the dashboard diff --git a/components/app-configs/custom-notebook-images/base/opencv/kustomization.yaml b/components/app-configs/rhoai-custom-images/base/opencv/kustomization.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/opencv/kustomization.yaml rename to components/app-configs/rhoai-custom-images/base/opencv/kustomization.yaml diff --git a/components/app-configs/custom-notebook-images/base/rstudio/imagestream.yaml b/components/app-configs/rhoai-custom-images/base/rstudio/imagestream.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/rstudio/imagestream.yaml rename to components/app-configs/rhoai-custom-images/base/rstudio/imagestream.yaml diff --git a/components/app-configs/custom-notebook-images/base/rstudio/kustomization.yaml b/components/app-configs/rhoai-custom-images/base/rstudio/kustomization.yaml similarity index 100% rename from components/app-configs/custom-notebook-images/base/rstudio/kustomization.yaml rename to components/app-configs/rhoai-custom-images/base/rstudio/kustomization.yaml diff --git a/components/app-configs/rhoai-custom-images/components/namespace/kustomization.yaml b/components/app-configs/rhoai-custom-images/components/namespace/kustomization.yaml new file mode 100644 index 00000000..e1fa3359 --- /dev/null +++ b/components/app-configs/rhoai-custom-images/components/namespace/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: + - namespace.yaml diff --git a/components/app-configs/custom-notebook-images/base/namespace.yaml b/components/app-configs/rhoai-custom-images/components/namespace/namespace.yaml similarity index 59% rename from components/app-configs/custom-notebook-images/base/namespace.yaml rename to components/app-configs/rhoai-custom-images/components/namespace/namespace.yaml index dc4ed3bc..872b68b7 100644 --- a/components/app-configs/custom-notebook-images/base/namespace.yaml +++ b/components/app-configs/rhoai-custom-images/components/namespace/namespace.yaml @@ -3,4 +3,4 @@ kind: Namespace metadata: name: custom-notebooks annotations: - openshift.io/display-name: Custom Jupyter Notebooks + openshift.io/display-name: Custom Notebook Images diff --git a/components/app-configs/rhoai-custom-images/components/rbac/kustomization.yaml b/components/app-configs/rhoai-custom-images/components/rbac/kustomization.yaml new file mode 100644 index 00000000..e88bcbbe --- /dev/null +++ b/components/app-configs/rhoai-custom-images/components/rbac/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: +- rb-notebooks.yaml +- rb-ods-apps.yaml diff --git a/components/app-configs/custom-notebook-images/base/namespace-rb.yaml b/components/app-configs/rhoai-custom-images/components/rbac/rb-notebooks.yaml similarity index 70% rename from components/app-configs/custom-notebook-images/base/namespace-rb.yaml rename to components/app-configs/rhoai-custom-images/components/rbac/rb-notebooks.yaml index 72fa6dc4..59c63510 100644 --- a/components/app-configs/custom-notebook-images/base/namespace-rb.yaml +++ b/components/app-configs/rhoai-custom-images/components/rbac/rb-notebooks.yaml @@ -1,17 +1,4 @@ --- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: custom-notebooks-admin -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: admin -subjects: -- apiGroup: rbac.authorization.k8s.io - kind: Group - name: workshop-admins ---- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: diff --git a/components/app-configs/rhoai-custom-images/components/rbac/rb-ods-apps.yaml b/components/app-configs/rhoai-custom-images/components/rbac/rb-ods-apps.yaml new file mode 100644 index 00000000..09cb24bb --- /dev/null +++ b/components/app-configs/rhoai-custom-images/components/rbac/rb-ods-apps.yaml @@ -0,0 +1,14 @@ +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: custom-notebooks-pusher + namespace: redhat-ods-applications +subjects: + - kind: ServiceAccount + name: builder + namespace: custom-notebooks +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: 'system:image-pusher' diff --git a/components/app-configs/rhoai-custom-images/components/workshop/kustomization.yaml b/components/app-configs/rhoai-custom-images/components/workshop/kustomization.yaml new file mode 100644 index 00000000..301ebe9e --- /dev/null +++ b/components/app-configs/rhoai-custom-images/components/workshop/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: +- rolebinding.yaml diff --git a/components/app-configs/rhoai-custom-images/components/workshop/rolebinding.yaml b/components/app-configs/rhoai-custom-images/components/workshop/rolebinding.yaml new file mode 100644 index 00000000..274f86a8 --- /dev/null +++ b/components/app-configs/rhoai-custom-images/components/workshop/rolebinding.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: custom-notebooks-admin +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: admin +subjects: +- apiGroup: rbac.authorization.k8s.io + kind: Group + name: workshop-admins diff --git a/components/app-configs/custom-notebook-images/overlays/rhoai/kustomization.yaml b/components/app-configs/rhoai-custom-images/overlays/default/kustomization.yaml similarity index 92% rename from components/app-configs/custom-notebook-images/overlays/rhoai/kustomization.yaml rename to components/app-configs/rhoai-custom-images/overlays/default/kustomization.yaml index 65d6e145..83ad2cfc 100644 --- a/components/app-configs/custom-notebook-images/overlays/rhoai/kustomization.yaml +++ b/components/app-configs/rhoai-custom-images/overlays/default/kustomization.yaml @@ -1,6 +1,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization +components: +- ../../components/namespace +- ../../components/rbac + resources: - ../../base @@ -29,7 +33,6 @@ patches: - target: group: build.openshift.io kind: BuildConfig - # name: opencv-notebook-graphviz patch: |- - op: replace path: /spec/strategy/dockerStrategy/from/namespace diff --git a/components/app-configs/rhoai-rbac-notebooks/custom-notebooks-rb.yaml b/components/app-configs/rhoai-rbac-notebooks/custom-notebooks-rb.yaml deleted file mode 100644 index ecea5133..00000000 --- a/components/app-configs/rhoai-rbac-notebooks/custom-notebooks-rb.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: custom-notebooks-pusher - namespace: redhat-ods-applications -subjects: - - kind: ServiceAccount - name: builder - namespace: custom-notebooks -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: 'system:image-pusher' -# --- -# kind: RoleBinding -# apiVersion: rbac.authorization.k8s.io/v1 -# metadata: -# name: system-image-puller -# namespace: redhat-ods-applications -# subjects: -# - kind: Group -# apiGroup: rbac.authorization.k8s.io -# name: 'system:serviceaccounts' -# roleRef: -# apiGroup: rbac.authorization.k8s.io -# kind: ClusterRole -# name: 'system:image-puller' diff --git a/components/app-configs/rhoai-rbac-notebooks/kustomization.yaml b/components/app-configs/rhoai-rbac-notebooks/kustomization.yaml deleted file mode 100644 index c1422523..00000000 --- a/components/app-configs/rhoai-rbac-notebooks/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - custom-notebooks-rb.yaml diff --git a/components/app-configs/rhoai-rhel-subscription/README.md b/components/app-configs/rhoai-rhel-subscription/README.md new file mode 100644 index 00000000..52878f45 --- /dev/null +++ b/components/app-configs/rhoai-rhel-subscription/README.md @@ -0,0 +1,3 @@ +# Build RStudio Images + +See https://docs.redhat.com/en/documentation/red_hat_openshift_ai_self-managed/2.13/html/getting_started_with_red_hat_openshift_ai_self-managed/creating-a-workbench-select-ide_get-started#building-the-rstudio-server-workbench-images_get-started diff --git a/components/app-configs/rhoai-kludge/rhel-subscription-secret.yaml b/components/app-configs/rhoai-rhel-subscription/rhel-subscription-secret.yaml similarity index 100% rename from components/app-configs/rhoai-kludge/rhel-subscription-secret.yaml rename to components/app-configs/rhoai-rhel-subscription/rhel-subscription-secret.yaml diff --git a/components/cluster-configs/console-config/base/kustomization.yaml b/components/cluster-configs/console-config/base/kustomization.yaml index d84314e8..80fb0b70 100644 --- a/components/cluster-configs/console-config/base/kustomization.yaml +++ b/components/cluster-configs/console-config/base/kustomization.yaml @@ -3,5 +3,5 @@ kind: Kustomization resources: - banner-cluster.yaml - - link-github.yaml + - link-gh-ssa.yaml - link-help.yaml diff --git a/demos/components/branding/link-github.yaml b/components/cluster-configs/console-config/base/link-gh-ssa.yaml similarity index 63% rename from demos/components/branding/link-github.yaml rename to components/cluster-configs/console-config/base/link-gh-ssa.yaml index 1f426644..ae10975c 100644 --- a/demos/components/branding/link-github.yaml +++ b/components/cluster-configs/console-config/base/link-gh-ssa.yaml @@ -9,3 +9,5 @@ spec: applicationMenu: section: Git Repos imageURL: /static/assets/public/imgs/logos/github.svg + # see /static/assets in the web console for more icons + # oc -n openshift-console exec -it deploy/console -- find /opt/bridge/static/assets/public -type f diff --git a/components/operators/nfd/instance/base/node-feature-discovery.yaml b/components/operators/nfd/instance/base/node-feature-discovery.yaml index a4cb0d80..924a1da5 100644 --- a/components/operators/nfd/instance/base/node-feature-discovery.yaml +++ b/components/operators/nfd/instance/base/node-feature-discovery.yaml @@ -15,7 +15,7 @@ spec: operand: # bug: an image has to be defined otherwise the deployment fails # bug: this behavior recently changed - image: registry.redhat.io/openshift4/ose-node-feature-discovery@sha256:06408039019ce11ce4a3913b04eadf37091c105ebe592bad66284636af601e8c + image: registry.redhat.io/openshift4/ose-node-feature-discovery-rhel9:v4.16 # image: registry.redhat.io/openshift4/ose-node-feature-discovery:latest servicePort: 12000 workerConfig: diff --git a/components/operators/rhacs-operator/README.md b/components/operators/rhacs-operator/README.md index 1041911d..7cf943c3 100644 --- a/components/operators/rhacs-operator/README.md +++ b/components/operators/rhacs-operator/README.md @@ -23,25 +23,27 @@ The current *overlays* available are for the following channels: * [rhacs-4.1](operator/overlays/rhacs-4.1) * [rhacs-4.2](operator/overlays/rhacs-4.2) * [rhacs-4.3](operator/overlays/rhacs-4.3) +* [rhacs-4.4](operator/overlays/rhacs-4.4) +* [rhacs-4.5](operator/overlays/rhacs-4.5) * [stable](operator/overlays/stable) ## Usage If you have cloned the `gitops-catalog` repository, you can install Advanced Cluster Security for Kubernetes based on the overlay of your choice by running from the root (`gitops-catalog`) directory. -``` +```sh oc apply -k rhacs-operator/operator/overlays/ ``` Or, without cloning: -``` +```sh oc apply -k https://github.com/redhat-cop/gitops-catalog/rhacs-operator/operator/overlays/ ``` As part of a different overlay in your own GitOps repo: -``` +```yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: diff --git a/components/operators/rhacs-operator/instance/base/create-cluster-init-bundle-job.yaml b/components/operators/rhacs-operator/instance/base/create-cluster-init-bundle-job.yaml index ef0524e7..5dce280d 100644 --- a/components/operators/rhacs-operator/instance/base/create-cluster-init-bundle-job.yaml +++ b/components/operators/rhacs-operator/instance/base/create-cluster-init-bundle-job.yaml @@ -26,24 +26,23 @@ spec: else # Wait for central to be ready - attempt_counter=0 max_attempts=20 + echo "Waiting for central to be available..." - until $(curl -k --output /dev/null --silent --head --fail https://central); do - if [ ${attempt_counter} -eq ${max_attempts} ];then - echo "Max attempts reached" - exit 1 - fi + until $(curl -s -k --output /dev/null --head --fail https://central); do + if [ ${max_attempts} -lt 1 ];then + echo "Max attempts reached" + exit 1 + fi - printf '.' - attempt_counter=$(($attempt_counter+1)) - echo "Made attempt $attempt_counter, waiting..." - sleep 5 + max_attempts=$(($max_attempts-1)) + echo "Attempts remaining $max_attempts, waiting..." + sleep 5 done echo "Configuring cluster-init bundle" export DATA={\"name\":\"local-cluster\"} - curl -k -o /tmp/bundle.json -X POST -u "admin:${PASSWORD}" -H "Content-Type: application/json" --data ${DATA} https://central/v1/cluster-init/init-bundles + curl -s -k -o /tmp/bundle.json -X POST -u "admin:${PASSWORD}" -H "Content-Type: application/json" --data ${DATA} https://central/v1/cluster-init/init-bundles echo "Bundle received" cat /tmp/bundle.json diff --git a/components/operators/rhacs-operator/operator/overlays/rhacs-4.4/kustomization.yaml b/components/operators/rhacs-operator/operator/overlays/rhacs-4.4/kustomization.yaml new file mode 100644 index 00000000..afac3e18 --- /dev/null +++ b/components/operators/rhacs-operator/operator/overlays/rhacs-4.4/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: rhacs-operator + path: patch-channel.yaml diff --git a/components/operators/rhacs-operator/operator/overlays/rhacs-4.4/patch-channel.yaml b/components/operators/rhacs-operator/operator/overlays/rhacs-4.4/patch-channel.yaml new file mode 100644 index 00000000..27fcaab2 --- /dev/null +++ b/components/operators/rhacs-operator/operator/overlays/rhacs-4.4/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: rhacs-4.4 diff --git a/components/operators/rhacs-operator/operator/overlays/rhacs-4.5/kustomization.yaml b/components/operators/rhacs-operator/operator/overlays/rhacs-4.5/kustomization.yaml new file mode 100644 index 00000000..afac3e18 --- /dev/null +++ b/components/operators/rhacs-operator/operator/overlays/rhacs-4.5/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: rhacs-operator + path: patch-channel.yaml diff --git a/components/operators/rhacs-operator/operator/overlays/rhacs-4.5/patch-channel.yaml b/components/operators/rhacs-operator/operator/overlays/rhacs-4.5/patch-channel.yaml new file mode 100644 index 00000000..8e097198 --- /dev/null +++ b/components/operators/rhacs-operator/operator/overlays/rhacs-4.5/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: rhacs-4.5 diff --git a/components/operators/rhods-operator/instance/components/approve-install/README.md b/components/operators/rhods-operator/instance/components/approve-install/README.md new file mode 100644 index 00000000..887b66e8 --- /dev/null +++ b/components/operators/rhods-operator/instance/components/approve-install/README.md @@ -0,0 +1,20 @@ +# wait-for-servicemesh + +## Purpose + +This component is designed prevent OpenShift AI before the ServiceMesh resources have been successfully installed that are required for KServe. + +## Usage + +This component can be added to a base by adding the `components` section to your overlay `kustomization.yaml` file: + +```yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +components: + - ../../components/wait-for-servicemesh +``` diff --git a/components/operators/rhods-operator/instance/components/approve-install/job.sh b/components/operators/rhods-operator/instance/components/approve-install/job.sh new file mode 100755 index 00000000..939511b3 --- /dev/null +++ b/components/operators/rhods-operator/instance/components/approve-install/job.sh @@ -0,0 +1,56 @@ +#!/usr/bin/bash +set -e + +TIMEOUT_SECONDS=60 + +patch_approval(){ + APPROVAL=${1:-Automatic} + + echo -n 'Waiting for RHOAI subscription.' + until oc get -n redhat-ods-operator subscription rhods-operator -o name 2>/dev/null + do + echo -n . + sleep 5 + done; echo + + oc -n redhat-ods-operator \ + patch subscription rhods-operator \ + --type=merge --patch '{"spec":{"installPlanApproval":"'"${APPROVAL}"'"}}' + + echo -n 'Waiting for RHOAI install plan.' + until oc -n redhat-ods-operator get installplan -l operators.coreos.com/rhods-operator.redhat-ods-operator 2>/dev/null + do + echo -n . + sleep 5 + done; echo + + INSTALL_PLAN=$(oc -n redhat-ods-operator get installplan -l operators.coreos.com/rhods-operator.redhat-ods-operator -o name) + oc -n redhat-ods-operator \ + patch "${INSTALL_PLAN}" \ + --type=merge --patch '{"spec":{"approved":true}}' +} + +wait_for_service_mesh(){ + echo "Checking status of all service_mesh pre-reqs" + + SERVICEMESH_RESOURCES=( + crd/knativeservings.operator.knative.dev:condition=established + crd/servicemeshcontrolplanes.maistra.io:condition=established + ) + + for crd in "${SERVICEMESH_RESOURCES[@]}" + do + RESOURCE=$(echo "$crd" | cut -d ":" -f 1) + CONDITION=$(echo "$crd" | cut -d ":" -f 2) + + echo "Waiting for ${RESOURCE} state to be ${CONDITION}..." + + oc wait --for="${CONDITION}" "${RESOURCE}" --timeout="1s" 2>/dev/null && continue + patch_approval Manual + + oc wait --for="${CONDITION}" "${RESOURCE}" --timeout="${TIMEOUT_SECONDS}s" + done +} + +wait_for_service_mesh +patch_approval diff --git a/components/operators/rhods-operator/instance/components/approve-install/job.yaml b/components/operators/rhods-operator/instance/components/approve-install/job.yaml new file mode 100644 index 00000000..528011ba --- /dev/null +++ b/components/operators/rhods-operator/instance/components/approve-install/job.yaml @@ -0,0 +1,69 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: wait-for-servicemesh + namespace: redhat-ods-operator +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: wait-for-servicemesh +rules: + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - get + - list + - apiGroups: + - operators.coreos.com + resources: + - subscriptions + - installplans + verbs: + - get + - list + - patch +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: wait-for-servicemesh +subjects: + - kind: ServiceAccount + name: wait-for-servicemesh + namespace: redhat-ods-operator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: wait-for-servicemesh +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: wait-for-servicemesh + namespace: redhat-ods-operator +spec: + template: + spec: + containers: + - name: minion + image: registry.redhat.io/openshift4/ose-cli + command: + - /bin/bash + - -c + - /scripts/job.sh + volumeMounts: + - name: scripts + mountPath: /scripts + volumes: + - name: scripts + configMap: + name: wait-for-servicemesh + defaultMode: 0755 + restartPolicy: Never + serviceAccount: wait-for-servicemesh + serviceAccountName: wait-for-servicemesh + backoffLimit: 4 diff --git a/components/operators/rhods-operator/instance/components/approve-install/kustomization.yaml b/components/operators/rhods-operator/instance/components/approve-install/kustomization.yaml new file mode 100644 index 00000000..f54dd034 --- /dev/null +++ b/components/operators/rhods-operator/instance/components/approve-install/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: +- job.yaml + +generatorOptions: + disableNameSuffixHash: true + +configMapGenerator: + - name: wait-for-servicemesh + namespace: redhat-ods-operator + files: + - job.sh diff --git a/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.sh b/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.sh index e7a7f460..6b543b76 100755 --- a/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.sh +++ b/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.sh @@ -3,30 +3,10 @@ set -e TIMEOUT_SECONDS=60 -patch_approval(){ - APPROVAL=${1:-Automatic} - - echo -n 'Waiting for RHOAI subscription.' - until oc get -n redhat-ods-operator subscription rhods-operator -o name 2>/dev/null - do - echo -n . - sleep 5 - done; echo - - oc -n redhat-ods-operator \ - patch subscription rhods-operator \ - --type=merge --patch '{"spec":{"installPlanApproval":"'"${APPROVAL}"'"}}' - - INSTALL_PLAN=$(oc -n redhat-ods-operator get installplan -l operators.coreos.com/rhods-operator.redhat-ods-operator -o name) - oc -n redhat-ods-operator \ - patch "${INSTALL_PLAN}" \ - --type=merge --patch '{"spec":{"approved":true}}' -} - wait_for_service_mesh(){ echo "Checking status of all service_mesh pre-reqs" -SERVICEMESH_RESOURCES=( + SERVICEMESH_RESOURCES=( crd/knativeservings.operator.knative.dev:condition=established crd/servicemeshcontrolplanes.maistra.io:condition=established ) @@ -37,13 +17,8 @@ SERVICEMESH_RESOURCES=( CONDITION=$(echo "$crd" | cut -d ":" -f 2) echo "Waiting for ${RESOURCE} state to be ${CONDITION}..." - - oc wait --for="${CONDITION}" "${RESOURCE}" --timeout="1s" 2>/dev/null && continue - patch_approval Manual - oc wait --for="${CONDITION}" "${RESOURCE}" --timeout="${TIMEOUT_SECONDS}s" done } wait_for_service_mesh -patch_approval diff --git a/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.yaml b/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.yaml index e4467e62..c22b72a7 100644 --- a/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.yaml +++ b/components/operators/rhods-operator/instance/components/wait-for-servicemesh/job.yaml @@ -21,15 +21,6 @@ rules: verbs: - get - list - - apiGroups: - - operators.coreos.com - resources: - - subscriptions - - installplans - verbs: - - get - - list - - patch --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/demos/components/branding/kustomization.yaml b/demos/components/branding/kustomization.yaml index 0946246a..84ee3887 100644 --- a/demos/components/branding/kustomization.yaml +++ b/demos/components/branding/kustomization.yaml @@ -10,5 +10,6 @@ labels: demo: catalog resources: + - ../../../components/cluster-configs/console-config/overlays/default - banner-demo.yaml - - link-github.yaml + - link-gh-demo.yaml diff --git a/components/cluster-configs/console-config/base/link-github.yaml b/demos/components/branding/link-gh-demo.yaml similarity index 100% rename from components/cluster-configs/console-config/base/link-github.yaml rename to demos/components/branding/link-gh-demo.yaml diff --git a/demos/components/rhoai-prereqs/kustomization.yaml b/demos/components/rhoai-prereqs/kustomization.yaml index be5962e3..10cc052a 100644 --- a/demos/components/rhoai-prereqs/kustomization.yaml +++ b/demos/components/rhoai-prereqs/kustomization.yaml @@ -1,6 +1,9 @@ apiVersion: kustomize.config.k8s.io/v1alpha1 kind: Component +commonAnnotations: + argocd.argoproj.io/hook: PreSync + resources: - ../../../components/operators/authorino-operator/operator/overlays/tech-preview-v1 - ../../../components/operators/openshift-pipelines-operator-rh/operator/overlays/latest