From 1c9b6fe2ed30b70407bd4f89068d7bbc28cff454 Mon Sep 17 00:00:00 2001 From: m Date: Fri, 19 Apr 2024 14:50:35 +0300 Subject: [PATCH] Adds template for OpenStackVersion for container registry and tag override See related CIX at [1] but the periodic adoption jobs are no longer testing the candidate content, but defaulting to quay.io/curren-tripleo. This removes the redundant periodic_ci kustomize files since we now only need OpenStackVersion to set the container image override. [1] https://issues.redhat.com/browse/OSPCIX-258 --- .../container_image_overrides.yaml | 130 ------------------ tests/config/periodic_ci/kustomization.yaml | 5 - tests/roles/backend_services/tasks/main.yaml | 35 +++-- .../templates/container_overrides.j2 | 88 ------------ .../templates/openstack_version.j2 | 74 ++++++++++ 5 files changed, 90 insertions(+), 242 deletions(-) delete mode 100644 tests/config/periodic_ci/container_image_overrides.yaml delete mode 100644 tests/config/periodic_ci/kustomization.yaml delete mode 100644 tests/roles/backend_services/templates/container_overrides.j2 create mode 100644 tests/roles/backend_services/templates/openstack_version.j2 diff --git a/tests/config/periodic_ci/container_image_overrides.yaml b/tests/config/periodic_ci/container_image_overrides.yaml deleted file mode 100644 index d8e01c8b7..000000000 --- a/tests/config/periodic_ci/container_image_overrides.yaml +++ /dev/null @@ -1,130 +0,0 @@ -# This will be templated at run-time by the backend_services role to pass -# the values for the container parameters (namespace, registry, tag) -apiVersion: core.openstack.org/v1beta1 -kind: OpenStackControlPlane -metadata: - name: openstack -spec: - cinder: - template: - cinderAPI: {} - cinderScheduler: {} - cinderBackup: {} - cinderVolumes: {} - - dns: - template: - override: - service: - metadata: - annotations: - metallb.universe.tf/address-pool: ctlplane - metallb.universe.tf/allow-shared-ip: ctlplane - metallb.universe.tf/loadBalancerIPs: 192.168.122.80 - spec: - type: LoadBalancer - options: - - key: server - values: - - 192.168.122.1 - replicas: 1 - - glance: - enabled: false - template: - glanceAPIs: {} - - horizon: - enabled: false - template: {} - - ironic: - enabled: false - template: - ironicConductors: [] - - keystone: - enabled: false - template: {} - - manila: - enabled: false - template: - manilaAPI: {} - manilaScheduler: {} - manilaShares: {} - - mariadb: - enabled: false - templates: {} - - galera: - enabled: true - templates: - openstack: - secret: osp-secret - replicas: 1 - storageRequest: 500M - openstack-cell1: - secret: osp-secret - replicas: 1 - storageRequest: 500M - - memcached: - enabled: true - - neutron: - enabled: false - template: {} - - nova: - enabled: false - template: {} - - ovn: - enabled: false - template: - ovnDBCluster: - ovndbcluster-nb: - dbType: NB - storageRequest: 10G - networkAttachment: internalapi - ovndbcluster-sb: - dbType: SB - storageRequest: 10G - networkAttachment: internalapi - ovnNorthd: - replicas: 0 - ovnController: - networkAttachment: tenant - nodeSelector: - node: non-existing-node-name - - placement: - enabled: false - template: {} - - rabbitmq: - templates: - rabbitmq: - override: - service: - metadata: - annotations: - metallb.universe.tf/address-pool: internalapi - metallb.universe.tf/loadBalancerIPs: 172.17.0.85 - spec: - type: LoadBalancer - rabbitmq-cell1: - override: - service: - metadata: - annotations: - metallb.universe.tf/address-pool: internalapi - metallb.universe.tf/loadBalancerIPs: 172.17.0.86 - spec: - type: LoadBalancer - - telemetry: - enabled: false - template: {} diff --git a/tests/config/periodic_ci/kustomization.yaml b/tests/config/periodic_ci/kustomization.yaml deleted file mode 100644 index a17d26f26..000000000 --- a/tests/config/periodic_ci/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -bases: -- ../base -patchesStrategicMerge: -- ../base/tls_overrides.yaml -- container_image_overrides.yaml diff --git a/tests/roles/backend_services/tasks/main.yaml b/tests/roles/backend_services/tasks/main.yaml index 6d7216f34..d6cdcb774 100644 --- a/tests/roles/backend_services/tasks/main.yaml +++ b/tests/roles/backend_services/tasks/main.yaml @@ -59,41 +59,38 @@ mode: '644' force: true -- name: when not a periodic CI job use the base deployment - when: not periodic|default(false) - ansible.builtin.shell: | - {{ shell_header }} - {{ oc_header }} - mkdir -p tmp - oc kustomize base > tmp/test_deployment.yaml - oc apply -f tmp/test_deployment.yaml - args: - chdir: "../config" - -- name: when periodic, create kustomize container_images_overrides.yaml +- name: when periodic, create OpenStackVersion CR with container overrides when: - periodic|default(false) - container_registry is defined - container_tag is defined - container_namespace is defined block: - - name: template out the override deployment + - name: template out the OpenStackVersion deployment with container overrides ansible.builtin.template: - src: container_overrides.j2 - dest: "../config/periodic_ci/container_image_overrides.yaml" + src: openstack_version.j2 + dest: "../config/openstack_version_overrides.yaml" mode: '644' force: true - - name: run kustomize and create controlplane with container overrides + - name: Apply OpenStackVersion with container overrides to environment ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} - mkdir -p tmp - oc kustomize periodic_ci > tmp/test_deployment.yaml - oc apply -f tmp/test_deployment.yaml + oc apply -f openstack_version_overrides.yaml args: chdir: "../config" +- name: Deploy the podified control plane + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + mkdir -p tmp + oc kustomize base > tmp/test_deployment.yaml + oc apply -f tmp/test_deployment.yaml + args: + chdir: "../config" + - name: wait for mariadb to start up ansible.builtin.shell: | {{ shell_header }} diff --git a/tests/roles/backend_services/templates/container_overrides.j2 b/tests/roles/backend_services/templates/container_overrides.j2 deleted file mode 100644 index a8d7f835d..000000000 --- a/tests/roles/backend_services/templates/container_overrides.j2 +++ /dev/null @@ -1,88 +0,0 @@ -apiVersion: core.openstack.org/v1beta1 -kind: OpenStackControlPlane -metadata: - name: openstack -spec: - cinder: - template: - cinderAPI: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-api:{{ container_tag }} - cinderScheduler: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-scheduler:{{ container_tag }} - cinderBackup: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-backup:{{ container_tag }} - cinderVolumes: - volume1: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-volume:{{ container_tag }} - - glance: - template: - glanceAPIs: - default: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-glance-api:{{ container_tag }} - - horizon: - template: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-horizon:{{ container_tag }} - - ironic: - template: - ironicConductors: [] - - keystone: - template: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-keystone:{{ container_tag }} - - manila: - template: - manilaAPI: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-manila-api:{{ container_tag }} - manilaScheduler: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-manila-scheduler:{{ container_tag }} - manilaShares: - volume1: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-manila-share:{{ container_tag }} - - galera: - templates: - openstack: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-mariadb:{{ container_tag }} - openstack-cell1: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-mariadb:{{ container_tag }} - - memcached: - templates: - memcached: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-memcached:{{ container_tag }} - - neutron: - template: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-neutron-server:{{ container_tag }} - - nova: - enabled: false - template: {} - - ovn: - template: - ovnController: - ovnContainerImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-controller:{{ container_tag }} - ovsContainerImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-base:{{ container_tag }} - ovnDBCluster: - ovndbcluster-nb: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-nb-db-server:{{ container_tag }} - ovndbcluster-sb: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-sb-db-server:{{ container_tag }} - ovnNorthd: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-northd:{{ container_tag }} - - placement: - template: - containerImage: {{ container_registry }}/{{ container_namespace }}/openstack-placement-api:{{ container_tag }} - - rabbitmq: - templates: - rabbitmq: - image: {{ container_registry }}/{{ container_namespace }}/openstack-rabbitmq:{{ container_tag }} - rabbitmq-cell1: - image: {{ container_registry }}/{{ container_namespace }}/openstack-rabbitmq:{{ container_tag }} diff --git a/tests/roles/backend_services/templates/openstack_version.j2 b/tests/roles/backend_services/templates/openstack_version.j2 new file mode 100644 index 000000000..186167bd1 --- /dev/null +++ b/tests/roles/backend_services/templates/openstack_version.j2 @@ -0,0 +1,74 @@ +apiVersion: core.openstack.org/v1beta1 +kind: OpenStackVersion +metadata: + name: openstack + namespace: openstack +spec: + customContainerImages: + aodhAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-aodh-api:{{ container_tag }} + aodhEvaluatorImage: {{ container_registry }}/{{ container_namespace }}/openstack-aodh-evaluator:{{ container_tag }} + aodhListenerImage: {{ container_registry }}/{{ container_namespace }}/openstack-aodh-listener:{{ container_tag }} + aodhNotifierImage: {{ container_registry }}/{{ container_namespace }}/openstack-aodh-notifier:{{ container_tag }} + barbicanAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-barbican-api:{{ container_tag }} + barbicanKeystoneListenerImage: {{ container_registry }}/{{ container_namespace }}/openstack-barbican-keystone-listener:{{ container_tag }} + barbicanWorkerImage: {{ container_registry }}/{{ container_namespace }}/openstack-barbican-worker:{{ container_tag }} + ceilometerCentralImage: {{ container_registry }}/{{ container_namespace }}/openstack-ceilometer-central:{{ container_tag }} + ceilometerComputeImage: {{ container_registry }}/{{ container_namespace }}/openstack-ceilometer-compute:{{ container_tag }} + ceilometerIpmiImage: {{ container_registry }}/{{ container_namespace }}/openstack-ceilometer-ipmi:{{ container_tag }} + ceilometerNotificationImage: {{ container_registry }}/{{ container_namespace }}/openstack-ceilometer-notification:{{ container_tag }} + cinderAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-api:{{ container_tag }} + cinderBackupImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-backup:{{ container_tag }} + cinderSchedulerImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-scheduler:{{ container_tag }} + cinderVolumeImage: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-volume:{{ container_tag }} + edpmFrrImage: {{ container_registry }}/{{ container_namespace }}/openstack-frr:{{ container_tag }} + edpmIscsidImage: {{ container_registry }}/{{ container_namespace }}/openstack-iscsid:{{ container_tag }} + edpmLogrotateCrondImage: {{ container_registry }}/{{ container_namespace }}/openstack-cron:{{ container_tag }} + edpmMultipathdImage: {{ container_registry }}/{{ container_namespace }}/openstack-multipathd:{{ container_tag }} + edpmNeutronMetadataAgentImage: {{ container_registry }}/{{ container_namespace }}/openstack-neutron-metadata-agent-ovn:{{ container_tag }} + edpmNeutronSriovAgentImage: {{ container_registry }}/{{ container_namespace }}/openstack-neutron-sriov-agent:{{ container_tag }} + edpmOvnBgpAgentImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-bgp-agent:{{ container_tag }} + glanceAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-glance-api:{{ container_tag }} + heatAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-heat-api:{{ container_tag }} + heatCfnapiImage: {{ container_registry }}/{{ container_namespace }}/openstack-heat-api-cfn:{{ container_tag }} + heatEngineImage: {{ container_registry }}/{{ container_namespace }}/openstack-heat-engine:{{ container_tag }} + horizonImage: {{ container_registry }}/{{ container_namespace }}/openstack-horizon:{{ container_tag }} + infraDnsmasqImage: {{ container_registry }}/{{ container_namespace }}/openstack-neutron-server:{{ container_tag }} + infraMemcachedImage: {{ container_registry }}/{{ container_namespace }}/openstack-memcached:{{ container_tag }} + ironicAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-ironic-api:{{ container_tag }} + ironicConductorImage: {{ container_registry }}/{{ container_namespace }}/openstack-ironic-conductor:{{ container_tag }} + ironicInspectorImage: {{ container_registry }}/{{ container_namespace }}/openstack-ironic-inspector:{{ container_tag }} + ironicNeutronAgentImage: {{ container_registry }}/{{ container_namespace }}/openstack-ironic-neutron-agent:{{ container_tag }} + ironicPxeImage: {{ container_registry }}/{{ container_namespace }}/openstack-ironic-pxe:{{ container_tag }} + ironicPythonAgentImage: {{ container_registry }}/{{ container_namespace }}/ironic-python-agent:{{ container_tag }} + keystoneAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-keystone:{{ container_tag }} + manilaAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-manila-api:{{ container_tag }} + manilaSchedulerImage: {{ container_registry }}/{{ container_namespace }}/openstack-manila-scheduler:{{ container_tag }} + manilaShareImage: {{ container_registry }}/{{ container_namespace }}/openstack-manila-share:{{ container_tag }} + mariadbImage: {{ container_registry }}/{{ container_namespace }}/openstack-mariadb:{{ container_tag }} + neutronAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-neutron-server:{{ container_tag }} + novaAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-nova-api:{{ container_tag }} + novaComputeImage: {{ container_registry }}/{{ container_namespace }}/openstack-nova-compute:{{ container_tag }} + novaConductorImage: {{ container_registry }}/{{ container_namespace }}/openstack-nova-conductor:{{ container_tag }} + novaNovncImage: {{ container_registry }}/{{ container_namespace }}/openstack-nova-novncproxy:{{ container_tag }} + novaSchedulerImage: {{ container_registry }}/{{ container_namespace }}/openstack-nova-scheduler:{{ container_tag }} + octaviaAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-octavia-api:{{ container_tag }} + octaviaHealthmanagerImage: {{ container_registry }}/{{ container_namespace }}/openstack-octavia-health-manager:{{ container_tag }} + octaviaHousekeepingImage: {{ container_registry }}/{{ container_namespace }}/openstack-octavia-housekeeping:{{ container_tag }} + octaviaWorkerImage: {{ container_registry }}/{{ container_namespace }}/openstack-octavia-worker:{{ container_tag }} + openstackClientImage: {{ container_registry }}/{{ container_namespace }}/openstack-openstackclient:{{ container_tag }} + osContainerImage: {{ container_registry }}/{{ container_namespace }}/edpm-hardened-uefi:{{ container_tag }} + ovnControllerImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-controller:{{ container_tag }} + ovnControllerOvsImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-base:{{ container_tag }} + ovnNbDbclusterImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-nb-db-server:{{ container_tag }} + ovnNorthdImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-northd:{{ container_tag }} + ovnSbDbclusterImage: {{ container_registry }}/{{ container_namespace }}/openstack-ovn-sb-db-server:{{ container_tag }} + placementAPIImage: {{ container_registry }}/{{ container_namespace }}/openstack-placement-api:{{ container_tag }} + rabbitmqImage: {{ container_registry }}/{{ container_namespace }}/openstack-rabbitmq:{{ container_tag }} + swiftAccountImage: {{ container_registry }}/{{ container_namespace }}/openstack-swift-account:{{ container_tag }} + swiftContainerImage: {{ container_registry }}/{{ container_namespace }}/openstack-swift-container:{{ container_tag }} + swiftObjectImage: {{ container_registry }}/{{ container_namespace }}/openstack-swift-object:{{ container_tag }} + swiftProxyImage: {{ container_registry }}/{{ container_namespace }}/openstack-swift-proxy-server:{{ container_tag }} + cinderVolumeImages: + default: {{ container_registry }}/{{ container_namespace }}/openstack-cinder-volume:{{ container_tag }} + manilaShareImages: + default: {{ container_registry }}/{{ container_namespace }}/openstack-manila-share:{{ container_tag }}