From 18d92f0eb0b62ac291a5597cbe449a971338e345 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Tue, 23 Apr 2024 23:35:25 -0500 Subject: [PATCH] Add jobs consuming charts from Helm repos Depends-On: Ic92b97eb5df4f7f8c4185c06654de4b4d890fbc6 Change-Id: If5dd37db9ed6f75a789c0fc808446752bbf87890 --- tools/deployment/baremetal/005-setup-nodes.sh | 4 +- tools/deployment/baremetal/110-compute-kit.sh | 2 +- tools/deployment/common/lockdown-netpol.sh | 17 +++--- tools/deployment/common/openstack-exporter.sh | 18 +++--- tools/deployment/common/prepare-charts.sh | 3 +- .../common/prepare-helm-repos-local.sh | 31 ++++++++++ .../common/prepare-helm-repos-public.sh | 17 ++++++ tools/deployment/common/prepare-k8s.sh | 7 --- ...-changes-do-not-update-other-components.sh | 2 +- tools/deployment/component/aodh/aodh.sh | 21 ++++--- .../deployment/component/barbican/barbican.sh | 8 ++- .../component/ceilometer/ceilometer.sh | 9 ++- .../component/ceph/ceph-ns-activate.sh | 17 +++--- tools/deployment/component/ceph/ceph.sh | 18 +++--- tools/deployment/component/cinder/cinder.sh | 2 +- tools/deployment/component/common/ldap.sh | 14 ++--- tools/deployment/component/common/mariadb.sh | 10 ++-- .../deployment/component/common/memcached.sh | 10 ++-- .../deployment/component/common/openstack.sh | 30 +++++----- tools/deployment/component/common/rabbitmq.sh | 9 +-- .../component/compute-kit/compute-kit.sh | 30 ++++------ .../component/compute-kit/libvirt.sh | 10 ++-- .../component/compute-kit/openvswitch.sh | 9 +-- .../component/compute-kit/tungsten-fabric.sh | 4 +- tools/deployment/component/glance/glance.sh | 12 ++-- tools/deployment/component/heat/heat.sh | 9 +-- tools/deployment/component/horizon/horizon.sh | 8 ++- .../deployment/component/keystone/keystone.sh | 12 ++-- tools/deployment/component/manila/manila.sh | 2 +- .../component/ovn/120-openvswitch.sh | 2 +- .../component/ovn/140-compute-kit.sh | 6 +- tools/deployment/component/ovn/ovn.sh | 2 +- tools/deployment/component/tacker/tacker.sh | 8 ++- zuul.d/2024.1.yaml | 24 ++++++++ zuul.d/base.yaml | 59 +++++++++++++++++++ zuul.d/project.yaml | 4 ++ 36 files changed, 294 insertions(+), 156 deletions(-) create mode 100755 tools/deployment/common/prepare-helm-repos-local.sh create mode 100755 tools/deployment/common/prepare-helm-repos-public.sh diff --git a/tools/deployment/baremetal/005-setup-nodes.sh b/tools/deployment/baremetal/005-setup-nodes.sh index 8965515e91..6f495ea584 100755 --- a/tools/deployment/baremetal/005-setup-nodes.sh +++ b/tools/deployment/baremetal/005-setup-nodes.sh @@ -36,7 +36,7 @@ helm install ${OSH_INFRA_PATH}/libvirt \ #NOTE: Wait for deploy sleep 5 #NOTE(portdirect): work around k8s not immedately assigning pods to nodes -./tools/deployment/common/wait-for-pods.sh libvirt +helm osh wait-for-pods libvirt #NOTE: Create domains and start vbmc for ironic to manage as baremetal nodes LIBVIRT_PODS=$(kubectl get --namespace libvirt pods \ @@ -73,7 +73,7 @@ helm install ${OSH_INFRA_PATH}/openvswitch \ --name=openvswitch #NOTE: Wait for deploy -./tools/deployment/common/wait-for-pods.sh openstack +helm osh wait-for-pods openstack #NOTE: Setup GRE tunnels between deployment node and libvirt hosts OSH_IRONIC_PXE_DEV="${OSH_IRONIC_PXE_DEV:="ironic-pxe"}" diff --git a/tools/deployment/baremetal/110-compute-kit.sh b/tools/deployment/baremetal/110-compute-kit.sh index dbd843d564..4a354ca046 100755 --- a/tools/deployment/baremetal/110-compute-kit.sh +++ b/tools/deployment/baremetal/110-compute-kit.sh @@ -131,7 +131,7 @@ helm upgrade --install nova ./nova \ ${OSH_EXTRA_HELM_ARGS_NOVA} #NOTE: Wait for deploy -./tools/deployment/common/wait-for-pods.sh openstack +helm osh wait-for-pods openstack #NOTE: Validate Deployment info export OS_CLOUD=openstack_helm diff --git a/tools/deployment/common/lockdown-netpol.sh b/tools/deployment/common/lockdown-netpol.sh index 93d0a2e06b..3465e46fc7 100755 --- a/tools/deployment/common/lockdown-netpol.sh +++ b/tools/deployment/common/lockdown-netpol.sh @@ -13,19 +13,16 @@ # under the License. set -xe -#NOTE: Get the over-rides to use -export HELM_CHART_ROOT_PATH="${HELM_CHART_ROOT_PATH:="${OSH_INFRA_PATH:="../openstack-helm-infra"}"}" -: ${OSH_EXTRA_HELM_ARGS_LOCKDOWN:="$(./tools/deployment/common/get-values-overrides.sh lockdown)"} - -#NOTE: Lint and package chart -make -C ${HELM_CHART_ROOT_PATH} lockdown +#NOTE: Define variables +: ${OSH_INFRA_HELM_REPO:="../openstack-helm-infra"} +: ${OSH_INFRA_PATH:="../openstack-helm-infra"} +: ${OSH_EXTRA_HELM_ARGS_LOCKDOWN:="$(helm osh get-values-overrides ${DOWLOAD_OVERRIDES:-} -p ${OSH_INFRA_PATH} -c lockdown ${FEATURES})"} #NOTE: Deploy command -: ${OSH_EXTRA_HELM_ARGS:=""} -helm upgrade --install lockdown ${HELM_CHART_ROOT_PATH}/lockdown \ +helm upgrade --install lockdown ${OSH_INFRA_HELM_REPO}/lockdown \ --namespace=openstack \ - ${OSH_EXTRA_HELM_ARGS} \ + ${OSH_EXTRA_HELM_ARGS:=} \ ${OSH_EXTRA_HELM_ARGS_LOCKDOWN} #NOTE: Wait for deploy -./tools/deployment/common/wait-for-pods.sh openstack +helm osh wait-for-pods openstack diff --git a/tools/deployment/common/openstack-exporter.sh b/tools/deployment/common/openstack-exporter.sh index b0c2e4f65b..b310b58d98 100755 --- a/tools/deployment/common/openstack-exporter.sh +++ b/tools/deployment/common/openstack-exporter.sh @@ -14,18 +14,16 @@ set -xe -#NOTE: Get the over-rides to use -export HELM_CHART_ROOT_PATH="${HELM_CHART_ROOT_PATH:="${OSH_INFRA_PATH:="../openstack-helm-infra"}"}" -: ${OSH_EXTRA_HELM_ARGS_OSEXPORTER:="$(./tools/deployment/common/get-values-overrides.sh prometheus-openstack-exporter)"} +#NOTE: Define variables +: ${OSH_INFRA_HELM_REPO:="../openstack-helm-infra"} +: ${OSH_INFRA_PATH:="../openstack-helm-infra"} +: ${OSH_EXTRA_HELM_ARGS_OSEXPORTER:="$(helm osh get-values-overrides ${DOWLOAD_OVERRIDES:-} -p ${OSH_INFRA_PATH} -c prometheus-openstack-exporter ${FEATURES})"} -#NOTE: Lint and package chart -make -C ${HELM_CHART_ROOT_PATH} prometheus-openstack-exporter - -: ${OSH_EXTRA_HELM_ARGS:=""} -helm upgrade --install prometheus-openstack-exporter ${HELM_CHART_ROOT_PATH}/prometheus-openstack-exporter \ +#NOTE: Deploy command +helm upgrade --install prometheus-openstack-exporter ${OSH_INFRA_HELM_REPO}/prometheus-openstack-exporter \ --namespace=openstack \ - ${OSH_EXTRA_HELM_ARGS} \ + ${OSH_EXTRA_HELM_ARGS:=} \ ${OSH_EXTRA_HELM_ARGS_OSEXPORTER} #NOTE: Wait for deploy -./tools/deployment/common/wait-for-pods.sh openstack +helm osh wait-for-pods openstack diff --git a/tools/deployment/common/prepare-charts.sh b/tools/deployment/common/prepare-charts.sh index 0faccb3e8a..b53d0ae379 100755 --- a/tools/deployment/common/prepare-charts.sh +++ b/tools/deployment/common/prepare-charts.sh @@ -14,9 +14,8 @@ set -ex # Build all OSH Infra charts (necessary for Openstack deployment) -: ${OSH_INFRA_PATH:="../openstack-helm-infra"} ( - cd ${OSH_INFRA_PATH} && + cd ${OSH_INFRA_PATH:-"../openstack-helm-infra"} && make all ) diff --git a/tools/deployment/common/prepare-helm-repos-local.sh b/tools/deployment/common/prepare-helm-repos-local.sh new file mode 100755 index 0000000000..782818e8f0 --- /dev/null +++ b/tools/deployment/common/prepare-helm-repos-local.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# 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. + +set -ex + +: ${OSH_INFRA_PATH:="../openstack-helm-infra"} +( + cd ${OSH_INFRA_PATH} && + helm repo index ./ +) + +helm repo index ./ + +docker run -d --name nginx_charts \ + -v $(pwd):/usr/share/nginx/html/openstack-helm:ro \ + -v $(readlink -f ${OSH_INFRA_PATH}):/usr/share/nginx/html/openstack-helm-infra:ro \ + -p 80:80 \ + nginx + +helm repo add ${OSH_HELM_REPO:-"openstack-helm"} http://localhost/openstack-helm +helm repo add ${OSH_INFRA_HELM_REPO:-"openstack-helm-infra"} http://localhost/openstack-helm-infra diff --git a/tools/deployment/common/prepare-helm-repos-public.sh b/tools/deployment/common/prepare-helm-repos-public.sh new file mode 100755 index 0000000000..b7ca2bc397 --- /dev/null +++ b/tools/deployment/common/prepare-helm-repos-public.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# 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. + +set -ex + +helm repo add ${OSH_HELM_REPO:-"openstack-helm"} https://tarballs.opendev.org/openstack/openstack-helm +helm repo add ${OSH_INFRA_HELM_REPO:-"openstack-helm-infra"} https://tarballs.opendev.org/openstack/openstack-helm-infra diff --git a/tools/deployment/common/prepare-k8s.sh b/tools/deployment/common/prepare-k8s.sh index f1146a9b6f..033ad50bb1 100755 --- a/tools/deployment/common/prepare-k8s.sh +++ b/tools/deployment/common/prepare-k8s.sh @@ -46,10 +46,3 @@ EOF kubectl apply -f /tmp/${NAMESPACE}-ns.yaml done - -#NOTE: Build helm-toolkit, most charts depend on helm-toolkit -export HELM_CHART_ROOT_PATH="${HELM_CHART_ROOT_PATH:="${OSH_INFRA_PATH:="../openstack-helm-infra"}"}" -make -C ${HELM_CHART_ROOT_PATH} helm-toolkit - -# Build all charts -make all diff --git a/tools/deployment/common/validate-umbrella-upgrade-config-changes-do-not-update-other-components.sh b/tools/deployment/common/validate-umbrella-upgrade-config-changes-do-not-update-other-components.sh index 9aeef6eaff..9ef05884a1 100755 --- a/tools/deployment/common/validate-umbrella-upgrade-config-changes-do-not-update-other-components.sh +++ b/tools/deployment/common/validate-umbrella-upgrade-config-changes-do-not-update-other-components.sh @@ -37,7 +37,7 @@ validate_only_expected_application_changes () { ${config_change} \ --wait - ./tools/deployment/common/wait-for-pods.sh openstack + helm osh wait-for-pods openstack kubectl get daemonsets,deployments,statefulsets \ --namespace openstack \ diff --git a/tools/deployment/component/aodh/aodh.sh b/tools/deployment/component/aodh/aodh.sh index ccc2059c30..26be7ae9e9 100755 --- a/tools/deployment/component/aodh/aodh.sh +++ b/tools/deployment/component/aodh/aodh.sh @@ -13,15 +13,20 @@ # under the License. set -xe +#NOTE: Define variables +: ${OSH_HELM_REPO:="../openstack-helm"} +: ${OSH_PATH:="../openstack-helm"} +: ${OSH_EXTRA_HELM_ARGS_AODH:="$(helm osh get-values-overrides ${DOWLOAD_OVERRIDES:-} -p ${OSH_PATH} -c aodh ${FEATURES})"} + #NOTE: Wait for deploy -helm upgrade --install aodh ./aodh \ - --namespace=openstack \ - --set pod.replicas.api=2 \ - --set pod.replicas.evaluator=2 \ - --set pod.replicas.listener=2 \ - --set pod.replicas.notifier=2 \ - ${OSH_EXTRA_HELM_ARGS} \ - ${OSH_EXTRA_HELM_ARGS_AODH} +helm upgrade --install aodh ${OSH_HELM_REPO}/aodh \ + --namespace=openstack \ + --set pod.replicas.api=2 \ + --set pod.replicas.evaluator=2 \ + --set pod.replicas.listener=2 \ + --set pod.replicas.notifier=2 \ + ${OSH_EXTRA_HELM_ARGS:=} \ + ${OSH_EXTRA_HELM_ARGS_AODH} #NOTE: Wait for deploy helm osh wait-for-pods openstack diff --git a/tools/deployment/component/barbican/barbican.sh b/tools/deployment/component/barbican/barbican.sh index 03ff596081..b316089986 100755 --- a/tools/deployment/component/barbican/barbican.sh +++ b/tools/deployment/component/barbican/barbican.sh @@ -14,12 +14,14 @@ set -xe -#NOTE: Get the over-rides to use -: ${OSH_EXTRA_HELM_ARGS_BARBICAN:="$(helm osh get-values-overrides -c barbican ${FEATURES})"} +#NOTE: Define variables +: ${OSH_HELM_REPO:="../openstack-helm"} +: ${OSH_PATH:="../openstack-helm"} +: ${OSH_EXTRA_HELM_ARGS_BARBICAN:="$(helm osh get-values-overrides ${DOWLOAD_OVERRIDES:-} -p ${OSH_PATH} -c barbican ${FEATURES})"} : ${RUN_HELM_TESTS:="yes"} #NOTE: Deploy command -helm upgrade --install barbican ./barbican \ +helm upgrade --install barbican ${OSH_HELM_REPO}/barbican \ --namespace=openstack \ ${OSH_EXTRA_HELM_ARGS:=} \ ${OSH_EXTRA_HELM_ARGS_BARBICAN} diff --git a/tools/deployment/component/ceilometer/ceilometer.sh b/tools/deployment/component/ceilometer/ceilometer.sh index 654af3d914..71ac30ace2 100755 --- a/tools/deployment/component/ceilometer/ceilometer.sh +++ b/tools/deployment/component/ceilometer/ceilometer.sh @@ -13,14 +13,19 @@ # under the License. set -xe +#NOTE: Define variables +: ${OSH_HELM_REPO:="../openstack-helm"} +: ${OSH_PATH:="../openstack-helm"} +: ${OSH_EXTRA_HELM_ARGS_CEILOMETER:="$(helm osh get-values-overrides ${DOWLOAD_OVERRIDES:-} -p ${OSH_PATH} -c ceilometer ${FEATURES})"} + #NOTE: Wait for deploy -helm upgrade --install ceilometer ./ceilometer \ +helm upgrade --install ceilometer ${OSH_HELM_REPO}/ceilometer \ --namespace=openstack \ --set pod.replicas.api=2 \ --set pod.replicas.central=2 \ --set pod.replicas.collector=2 \ --set pod.replicas.notification=2 \ - ${OSH_EXTRA_HELM_ARGS} \ + ${OSH_EXTRA_HELM_ARGS:=} \ ${OSH_EXTRA_HELM_ARGS_CEILOMETER} #NOTE: Wait for deploy diff --git a/tools/deployment/component/ceph/ceph-ns-activate.sh b/tools/deployment/component/ceph/ceph-ns-activate.sh index e9b481ea96..87c5ccac0a 100755 --- a/tools/deployment/component/ceph/ceph-ns-activate.sh +++ b/tools/deployment/component/ceph/ceph-ns-activate.sh @@ -14,9 +14,10 @@ set -xe -#NOTE: Get the over-rides to use -export HELM_CHART_ROOT_PATH="${HELM_CHART_ROOT_PATH:="${OSH_INFRA_PATH:="../openstack-helm-infra"}"}" -: ${OSH_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE:="$(helm osh get-values-overrides -p ${HELM_CHART_ROOT_PATH} -c ceph-provisioners ${FEATURES})"} +#NOTE: Define variables +: ${OSH_INFRA_HELM_REPO:="../openstack-helm-infra"} +: ${OSH_INFRA_PATH:="../openstack-helm-infra"} +: ${OSH_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE:="$(helm osh get-values-overrides ${DOWLOAD_OVERRIDES:-} -p ${OSH_INFRA_PATH} -c ceph-provisioners ${FEATURES})"} #NOTE: Deploy command tee /tmp/ceph-openstack-config.yaml <