From 54cd7b4c67185ab24472b31298286cd3c1aef3cd Mon Sep 17 00:00:00 2001 From: malingatembo Date: Mon, 2 Nov 2026 13:05:10 +0100 Subject: [PATCH] [ci] Remove the Lightspeed deployment hook from CI Framework The Lightspeed deployment hook is maintained in lightspeed-operator through PR #110. Remove the old framework playbook and its README entry so there is one place to maintain it. Related-PR: https://github.com/openstack-k8s-operators/lightspeed-operator/pull/110 Related-Issue: #OSPRH-33344 Signed-off-by: malingatembo --- hooks/playbooks/README.md | 26 -- .../install-openstack-lightspeed.yml | 326 ------------------ 2 files changed, 352 deletions(-) delete mode 100644 hooks/playbooks/install-openstack-lightspeed.yml diff --git a/hooks/playbooks/README.md b/hooks/playbooks/README.md index b893a258a..56e64b60b 100644 --- a/hooks/playbooks/README.md +++ b/hooks/playbooks/README.md @@ -24,32 +24,6 @@ on removing "import_playbook" usage in ci-framework project. ### Output None -## install-openstack-lightspeed.yml -Installs OpenStack Lightspeed operator and creates the OpenStackLightspeed custom resource. -This hook deploys the operator, waits for it to be ready, then creates a CR to deploy the service. The CI job calling this hook is responsible for waiting for full service health. - -### Input - -**Required variables:** -* `cifmw_openstack_lightspeed_llm_endpoint`: (String) **REQUIRED.** LLM service endpoint URL. Example: `https://your-llm-service/v1/chat/completions` -* `cifmw_openstack_lightspeed_model_name`: (String) **REQUIRED.** LLM model name. Example: `gpt-4`, `llama3.1:8b`, `granite-3.1-8b` - -**Optional variables:** -* `cifmw_openstack_lightspeed_namespace`: (String) Namespace for OpenStack Lightspeed operator. Defaults to `openstack-lightspeed`. -* `cifmw_openstack_lightspeed_operator_group`: (String) OperatorGroup name for OpenStack Lightspeed. Defaults to `openstack-lightspeed-operator-group`. -* `cifmw_openstack_lightspeed_catalog_image`: (String) Container image for OpenStack Lightspeed catalog source. Defaults to `quay.io/openstack-lightspeed/operator-catalog:latest`. -* `cifmw_openstack_lightspeed_catalog_name`: (String) Name for OpenStack Lightspeed CatalogSource resource. Defaults to `openstack-lightspeed-catalog`. -* `cifmw_openstack_lightspeed_llm_endpoint_type`: (String) LLM endpoint API format. Defaults to `openai`. -* `cifmw_openstack_lightspeed_llm_credentials`: (String) Secret name containing LLM API token. Defaults to `openstack-lightspeed-apitoken`. -* `cifmw_openstack_lightspeed_api_token`: (String) LLM API token value. If provided, playbook creates the secret. If not provided, playbook validates secret exists. -* `cifmw_openstack_lightspeed_tls_ca_cert_bundle`: (String) ConfigMap name containing TLS CA certificates. Defaults to `openstack-lightspeed-certs`. -* `cifmw_openstack_lightspeed_ca_cert_url`: (String) URL to download TLS CA certificate from. If provided, playbook downloads cert from URL and creates the ConfigMap. Example: `https://certs.corp.redhat.com/certs/Current-IT-Root-CAs.pem` -* `cifmw_openstack_lightspeed_ca_cert`: (String) TLS CA certificate content. If provided (and URL not provided), playbook creates the ConfigMap from this content. If neither URL nor content provided, playbook validates ConfigMap exists. -* `cifmw_openstack_lightspeed_cr_name`: (String) Name for OpenStackLightspeed CR. Defaults to `openstacklightspeed-sample`. - -### Output -None - ## kustomize_cr.yml This hook enables customization of CR files, using oc kustomize. ### Input diff --git a/hooks/playbooks/install-openstack-lightspeed.yml b/hooks/playbooks/install-openstack-lightspeed.yml deleted file mode 100644 index aabe77370..000000000 --- a/hooks/playbooks/install-openstack-lightspeed.yml +++ /dev/null @@ -1,326 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -- name: Deploy OpenStack Lightspeed operator - hosts: "{{ cifmw_target_hook_host | default('localhost') }}" - connection: local - vars: - # OpenStack Lightspeed configuration - # Note: Using openstack-lightspeed namespace per operator's suggested namespace - openstack_lightspeed_namespace: "{{ cifmw_openstack_lightspeed_namespace | default('openstack-lightspeed') }}" - openstack_lightspeed_operator_group: "{{ cifmw_openstack_lightspeed_operator_group | default('openstack-lightspeed-operator-group') }}" - openstack_lightspeed_catalog_image: "{{ cifmw_openstack_lightspeed_catalog_image | default('quay.io/openstack-lightspeed/operator-catalog:latest') }}" - openstack_lightspeed_catalog_name: "{{ cifmw_openstack_lightspeed_catalog_name | default('openstack-lightspeed-catalog') }}" - - # Kubeconfig path - use user-provided or default to CRC location - kubeconfig_path: "{{ cifmw_openshift_kubeconfig | default(ansible_env.HOME ~ '/.crc/machines/crc/kubeconfig') }}" - environment: - KUBECONFIG: "{{ kubeconfig_path }}" - - tasks: - # STEP 1: Deploy OpenStack Lightspeed catalog - - - name: Create CatalogSource for OpenStack Lightspeed - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - metadata: - name: "{{ openstack_lightspeed_catalog_name }}" - namespace: "openshift-marketplace" - spec: - sourceType: grpc - image: "{{ openstack_lightspeed_catalog_image }}" - displayName: "OpenStack Lightspeed Operator" - publisher: "Red Hat" - - - name: Wait for CatalogSource to be ready - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: "{{ openstack_lightspeed_catalog_name }}" - namespace: "openshift-marketplace" - register: catalog_source - until: - - catalog_source.resources is defined - - catalog_source.resources | length > 0 - - catalog_source.resources[0].status.connectionState.lastObservedState is defined - - catalog_source.resources[0].status.connectionState.lastObservedState == "READY" - retries: 30 - delay: 10 - - # STEP 2: Deploy OpenStack Lightspeed operator - # Note: OpenStack Lightspeed operator will automatically install - # and manage the OpenShift Lightspeed operator as a dependency - - - name: Create namespace for OpenStack Lightspeed - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Namespace - metadata: - name: "{{ openstack_lightspeed_namespace }}" - - - name: Create ClusterRole for Lightspeed tests - kubernetes.core.k8s: - state: present - definition: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - name: "lightspeed-test-role" - rules: - - nonResourceURLs: ["/ls-access"] - verbs: ["get"] - register: _result - retries: 5 - delay: 10 - until: _result is not failed - - - name: Create ClusterRoleBinding for Lightspeed tests - kubernetes.core.k8s: - state: present - definition: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - name: "lightspeed-test-role-binding" - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: "lightspeed-test-role" - subjects: - - kind: ServiceAccount - name: "default" - namespace: "{{ openstack_lightspeed_namespace }}" - register: _result - retries: 5 - delay: 10 - until: _result is not failed - - - name: Create OperatorGroup for OpenStack Lightspeed - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1 - kind: OperatorGroup - metadata: - name: "{{ openstack_lightspeed_operator_group }}" - namespace: "{{ openstack_lightspeed_namespace }}" - spec: - targetNamespaces: - - "{{ openstack_lightspeed_namespace }}" - - - name: Subscribe to OpenStack Lightspeed operator - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: Subscription - metadata: - name: "openstack-lightspeed-operator" - namespace: "{{ openstack_lightspeed_namespace }}" - spec: - channel: "alpha" - name: "openstack-lightspeed-operator" - source: "{{ openstack_lightspeed_catalog_name }}" - sourceNamespace: "openshift-marketplace" - installPlanApproval: "Automatic" - - - name: Wait for OpenStack Lightspeed CSV to be ready - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: ClusterServiceVersion - namespace: "{{ openstack_lightspeed_namespace }}" - label_selectors: - - "operators.coreos.com/openstack-lightspeed-operator.{{ openstack_lightspeed_namespace }}" - register: osls_csv - until: - - osls_csv.resources is defined - - osls_csv.resources | length > 0 - - osls_csv.resources[0].status.phase is defined - - osls_csv.resources[0].status.phase == "Succeeded" - retries: 30 - delay: 10 - - # STEP 3: Create prerequisites (secrets and certificates) - - - name: Create LLM API token secret - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Secret - metadata: - name: "{{ cifmw_openstack_lightspeed_llm_credentials | default('openstack-lightspeed-apitoken') }}" - namespace: "{{ openstack_lightspeed_namespace }}" - stringData: - apitoken: "{{ cifmw_openstack_lightspeed_api_token }}" - when: cifmw_openstack_lightspeed_api_token is defined - no_log: true - - - name: Verify LLM credentials secret exists - kubernetes.core.k8s_info: - kind: Secret - name: "{{ cifmw_openstack_lightspeed_llm_credentials | default('openstack-lightspeed-apitoken') }}" - namespace: "{{ openstack_lightspeed_namespace }}" - register: secret_check - failed_when: secret_check.resources | length == 0 - when: cifmw_openstack_lightspeed_api_token is not defined - no_log: true - - - name: Download TLS CA certificate from URL - ansible.builtin.uri: - url: "{{ cifmw_openstack_lightspeed_ca_cert_url }}" - return_content: true - register: ca_cert_download - when: cifmw_openstack_lightspeed_ca_cert_url is defined - - - name: Create TLS CA certificate bundle ConfigMap - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: ConfigMap - metadata: - name: "{{ cifmw_openstack_lightspeed_tls_ca_cert_bundle | default('openstack-lightspeed-certs') }}" - namespace: "{{ openstack_lightspeed_namespace }}" - data: - ca-bundle.crt: >- - {{ ca_cert_download.content if cifmw_openstack_lightspeed_ca_cert_url is defined else cifmw_openstack_lightspeed_ca_cert }} - when: cifmw_openstack_lightspeed_ca_cert_url is defined or cifmw_openstack_lightspeed_ca_cert is defined - - - name: Verify TLS certificate bundle ConfigMap exists - kubernetes.core.k8s_info: - kind: ConfigMap - name: "{{ cifmw_openstack_lightspeed_tls_ca_cert_bundle | default('openstack-lightspeed-certs') }}" - namespace: "{{ openstack_lightspeed_namespace }}" - register: cert_check - failed_when: cert_check.resources | length == 0 - when: - - cifmw_openstack_lightspeed_ca_cert is not defined - - cifmw_openstack_lightspeed_ca_cert_url is not defined - - - name: Create test-operator dummy config ConfigMap - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: ConfigMap - metadata: - name: "test-operator-dummy-config" - namespace: "{{ openstack_lightspeed_namespace }}" - labels: - app: "lightspeed-tests" - persistent: "true" - managed-by: "test-operator" - data: - clouds.yaml: | - # Dummy file - not used by lightspeed tests - # Required by test-operator but lightspeed tests don't need OpenStack - register: _result - retries: 5 - delay: 10 - until: _result is not failed - - - name: Create test-operator dummy secret - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Secret - metadata: - name: "test-operator-dummy-secret" - namespace: "{{ openstack_lightspeed_namespace }}" - labels: - app: "lightspeed-tests" - persistent: "true" - managed-by: "test-operator" - type: Opaque - stringData: - secure.yaml: | - # Dummy file - not used by lightspeed tests - # Required by test-operator but lightspeed tests don't need OpenStack - register: _result - retries: 5 - delay: 10 - until: _result is not failed - - - name: Create dataplane-ansible-ssh-private-key-secret - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Secret - metadata: - name: "dataplane-ansible-ssh-private-key-secret" - namespace: "{{ openstack_lightspeed_namespace }}" - labels: - app: "lightspeed-tests" - persistent: "true" - managed-by: "test-operator" - type: Opaque - stringData: - ssh-privatekey: | - # Dummy SSH key - not used by lightspeed tests - register: _result - retries: 5 - delay: 10 - until: _result is not failed - - # STEP 4: Create OpenStackLightspeed CR to deploy the service - # Note: Uses configurable parameters for LLM integration - - - name: Create OpenStackLightspeed custom resource - kubernetes.core.k8s: - state: present - definition: - apiVersion: lightspeed.openstack.org/v1beta1 - kind: OpenStackLightspeed - metadata: - name: "{{ cifmw_openstack_lightspeed_cr_name | default('openstacklightspeed-sample') }}" - namespace: "{{ openstack_lightspeed_namespace }}" - spec: - llmEndpoint: "{{ cifmw_openstack_lightspeed_llm_endpoint }}" - llmEndpointType: "{{ cifmw_openstack_lightspeed_llm_endpoint_type | default('openai') }}" - modelName: "{{ cifmw_openstack_lightspeed_model_name }}" - llmCredentials: "{{ cifmw_openstack_lightspeed_llm_credentials | default('openstack-lightspeed-apitoken') }}" - tlsCACertBundle: "{{ cifmw_openstack_lightspeed_tls_ca_cert_bundle | default('openstack-lightspeed-certs') if (cifmw_openstack_lightspeed_ca_cert is defined or cifmw_openstack_lightspeed_ca_cert_url is defined) else omit }}" - - - name: Wait for OpenStackLightspeed CR to be ready - kubernetes.core.k8s_info: - api_version: lightspeed.openstack.org/v1beta1 - kind: OpenStackLightspeed - name: "{{ cifmw_openstack_lightspeed_cr_name | default('openstacklightspeed-sample') }}" - namespace: "{{ openstack_lightspeed_namespace }}" - register: cr_status - until: - - cr_status.resources is defined - - cr_status.resources | length > 0 - - cr_status.resources[0].status is defined - - cr_status.resources[0].status.conditions is defined - - cr_status.resources[0].status.conditions | selectattr('type', 'equalto', 'Ready') | map(attribute='status') | select('equalto', 'True') | list | length > 0 - retries: 30 - delay: 10 - - - name: Display deployment summary - ansible.builtin.debug: - msg: - - "✓ OpenStack Lightspeed operator deployed in namespace: {{ openstack_lightspeed_namespace }}" - - "✓ OpenStack Lightspeed CR created: {{ cifmw_openstack_lightspeed_cr_name | default('openstacklightspeed-sample') }}" - - "✓ OpenShift Lightspeed operator will be automatically managed by OpenStack Lightspeed"