From ddfcaff83664e36f96d4826df4ff18a2268aea43 Mon Sep 17 00:00:00 2001 From: wangxiyuan Date: Thu, 1 Sep 2022 10:19:32 +0800 Subject: [PATCH] Add kolla openeuler support and format spec --- ...VM-high-low-priority-feature-support.patch | 539 ++++++++++++++++++ ...openEuler-support-for-OpenStack-Helm.patch | 122 ++++ ...ler-support-for-OpenStack-Helm-infra.patch | 298 ++++++++++ 0003-openEuler-support-for-loci.patch | 78 +++ 0004-Add-isula-support-for-kolla.patch | 303 ++++++++++ openstack-plugin-Yoga.tar.gz | Bin 10829 -> 0 bytes openstack-plugin.spec | 87 ++- 7 files changed, 1406 insertions(+), 21 deletions(-) create mode 100644 0000-Add-VM-high-low-priority-feature-support.patch create mode 100644 0001-openEuler-support-for-OpenStack-Helm.patch create mode 100644 0002-openEuler-support-for-OpenStack-Helm-infra.patch create mode 100644 0003-openEuler-support-for-loci.patch create mode 100644 0004-Add-isula-support-for-kolla.patch delete mode 100644 openstack-plugin-Yoga.tar.gz diff --git a/0000-Add-VM-high-low-priority-feature-support.patch b/0000-Add-VM-high-low-priority-feature-support.patch new file mode 100644 index 0000000..4007344 --- /dev/null +++ b/0000-Add-VM-high-low-priority-feature-support.patch @@ -0,0 +1,539 @@ +From 7d2ed0c2874107809f9e1ef55db88e9bb48a9697 Mon Sep 17 00:00:00 2001 +From: FFrog +Date: Mon, 22 Aug 2022 19:23:05 +0800 +Subject: [PATCH] Add VM high low priority feature support + +--- + api/openstack/compute/schemas/servers.py | 3 + + api/validation/extra_specs/hw.py | 20 ++++++ + compute/api.py | 24 +++++++- + conf/compute.py | 8 +++ + .../d44517dc62a1_add_priority_mix_feature.py | 33 ++++++++++ + db/main/models.py | 4 ++ + exception.py | 5 ++ + objects/fields.py | 10 +++ + objects/instance.py | 7 ++- + virt/hardware.py | 61 ++++++++++++++++++- + virt/libvirt/config.py | 6 ++ + virt/libvirt/driver.py | 36 +++++++++-- + 12 files changed, 204 insertions(+), 13 deletions(-) + create mode 100644 db/main/migrations/versions/d44517dc62a1_add_priority_mix_feature.py + +diff --git a/api/openstack/compute/schemas/servers.py b/api/openstack/compute/schemas/servers.py +index 300411de40..8197e8bba2 100644 +--- a/api/openstack/compute/schemas/servers.py ++++ b/api/openstack/compute/schemas/servers.py +@@ -138,6 +138,9 @@ _hints = { + 'type': 'string', + 'pattern': '^/[0-9a-f.:]+$' + }, ++ 'priority': { ++ 'type': 'string', 'enum': ['high', 'low'], ++ }, + }, + # NOTE: As this Mail: + # http://lists.openstack.org/pipermail/openstack-dev/2015-June/067996.html +diff --git a/api/validation/extra_specs/hw.py b/api/validation/extra_specs/hw.py +index 4aaccf639a..4d3b82e3b0 100644 +--- a/api/validation/extra_specs/hw.py ++++ b/api/validation/extra_specs/hw.py +@@ -145,6 +145,26 @@ cpu_policy_validators = [ + 'pattern': r'\^?\d+((-\d+)?(,\^?\d+(-\d+)?)?)*', + }, + ), ++ base.ExtraSpecValidator( ++ name='hw:cpu_priority', ++ description=( ++ 'The CPU priority policy of creating instance. ' ++ 'If ``high``, the cpu of instance will be bound to the host cpu ' ++ ' which provided by cpu_dedicated_set config option.' ++ 'If ``low``, the cpu of instance will be bound to the the cpu ' ++ 'which provided by (cpu_dedicated_set + cpu_shared_set) if ' ++ 'cpu_priority_mix_enable option is set, otherwise the cpu range ' ++ 'equals to cpu_shared_set config option only.' ++ ), ++ value={ ++ 'type': str, ++ 'description': 'The CPU priority policy', ++ 'enum': [ ++ 'low', ++ 'high', ++ ], ++ }, ++ ), + ] + + hugepage_validators = [ +diff --git a/compute/api.py b/compute/api.py +index 43a0f66a10..77974f3642 100644 +--- a/compute/api.py ++++ b/compute/api.py +@@ -1036,7 +1036,7 @@ class API: + self._check_vnic_remote_managed_min_version(context) + + def _validate_and_build_base_options( +- self, context, flavor, boot_meta, image_href, image_id, kernel_id, ++ self, context, flavor, priority, boot_meta, image_href, image_id, kernel_id, + ramdisk_id, display_name, display_description, hostname, key_name, + key_data, security_groups, availability_zone, user_data, metadata, + access_ip_v4, access_ip_v6, requested_networks, config_drive, +@@ -1084,7 +1084,10 @@ class API: + boot_meta.get('properties', {}))) + + image_meta = _get_image_meta_obj(boot_meta) +- numa_topology = hardware.numa_get_constraints(flavor, image_meta) ++ ++ final_priority = hardware.get_final_priority(flavor, priority) ++ ++ numa_topology = hardware.numa_get_constraints(flavor, image_meta, final_priority) + + system_metadata = {} + +@@ -1158,6 +1161,7 @@ class API: + 'system_metadata': system_metadata, + 'port_resource_requests': port_resource_requests, + 'request_level_params': req_lvl_params, ++ 'priority': final_priority, + } + + options_from_image = self._inherit_properties_from_image( +@@ -1579,6 +1583,18 @@ class API: + + return objects.InstanceGroup.get_by_uuid(context, group_hint) + ++ def _get_requested_priority(self, filter_properties): ++ if (not filter_properties or ++ not filter_properties.get('scheduler_hints')): ++ return ++ ++ priority = filter_properties.get('scheduler_hints').get('priority') ++ if not priority: ++ return ++ ++ return priority ++ ++ + def _create_instance(self, context, flavor, + image_href, kernel_id, ramdisk_id, + min_count, max_count, +@@ -1626,11 +1642,13 @@ class API: + self._check_auto_disk_config(image=boot_meta, + auto_disk_config=auto_disk_config) + ++ priority = self._get_requested_priority(filter_properties) ++ + ( + base_options, max_net_count, key_pair, security_groups, + network_metadata, + ) = self._validate_and_build_base_options( +- context, flavor, boot_meta, image_href, image_id, ++ context, flavor, priority, boot_meta, image_href, image_id, + kernel_id, ramdisk_id, display_name, display_description, + hostname, key_name, key_data, security_groups, availability_zone, + user_data, metadata, access_ip_v4, access_ip_v6, +diff --git a/conf/compute.py b/conf/compute.py +index 263d777586..493e55503e 100644 +--- a/conf/compute.py ++++ b/conf/compute.py +@@ -1024,6 +1024,14 @@ Possible values: + * ``True``: Packing VM's NUMA cell on most used host NUMA cell. + * ``False``: Spreading VM's NUMA cell on host's NUMA cells with more resources + available. ++"""), ++ cfg.BoolOpt('cpu_priority_mix_enable', ++ default=False, ++ help=""" ++Whether allow low priority VM use dedicated cpu set. ++ ++If enabled, The low priority VM can bind cpu both on dedicated and shared cpu ++set. + """), + ] + +diff --git a/db/main/migrations/versions/d44517dc62a1_add_priority_mix_feature.py b/db/main/migrations/versions/d44517dc62a1_add_priority_mix_feature.py +new file mode 100644 +index 0000000000..33fada99fb +--- /dev/null ++++ b/db/main/migrations/versions/d44517dc62a1_add_priority_mix_feature.py +@@ -0,0 +1,33 @@ ++# 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. ++ ++"""add priority mix feature ++ ++Revision ID: d44517dc62a1 ++Revises: 16f1fbcab42b ++Create Date: 2022-05-31 07:27:31.234643 ++""" ++ ++from alembic import op ++import sqlalchemy as sa ++ ++ ++# revision identifiers, used by Alembic. ++revision = 'd44517dc62a1' ++down_revision = '16f1fbcab42b' ++branch_labels = None ++depends_on = None ++ ++ ++def upgrade(): ++ with op.batch_alter_table('instances', schema=None) as batch_op: ++ batch_op.add_column(sa.Column('priority', sa.String(length=255), nullable=True)) +diff --git a/db/main/models.py b/db/main/models.py +index f2f58b2db1..eb5579e377 100644 +--- a/db/main/models.py ++++ b/db/main/models.py +@@ -420,6 +420,10 @@ class Instance(BASE, NovaBase, models.SoftDeleteMixin): + + hidden = sa.Column(sa.Boolean, default=False) + ++ # Identifies the high or low priority of the Instance. ++ # If this property is not set, the current instance is a common instance. ++ priority = sa.Column(sa.String(255)) ++ + + class InstanceInfoCache(BASE, NovaBase, models.SoftDeleteMixin): + """Represents a cache of information about an instance +diff --git a/exception.py b/exception.py +index 4588898aae..0a09c34494 100644 +--- a/exception.py ++++ b/exception.py +@@ -2116,6 +2116,11 @@ class InvalidCPUAllocationPolicy(Invalid): + "given: '%(requested)s', available: '%(available)s'.") + + ++class InvalidCPUAllocationPriority(Invalid): ++ msg_fmt = _("CPU priority requested from '%(source)s' is invalid, " ++ "given: '%(requested)s', available: '%(available)s'.") ++ ++ + class InvalidCPUThreadAllocationPolicy(Invalid): + msg_fmt = _("CPU thread policy requested from '%(source)s' is invalid, " + "given: '%(requested)s', available: '%(available)s'.") +diff --git a/objects/fields.py b/objects/fields.py +index d8cb10f700..e4a4787676 100644 +--- a/objects/fields.py ++++ b/objects/fields.py +@@ -275,6 +275,13 @@ class CPUAllocationPolicy(BaseNovaEnum): + + ALL = (DEDICATED, SHARED, MIXED) + ++class CPUAllocationPriority(BaseNovaEnum): ++ ++ HIGH = "high" ++ LOW = "low" ++ ++ ALL = (HIGH, LOW) ++ + + class CPUThreadAllocationPolicy(BaseNovaEnum): + +@@ -1204,6 +1211,9 @@ class ConfigDrivePolicyField(BaseEnumField): + class CPUAllocationPolicyField(BaseEnumField): + AUTO_TYPE = CPUAllocationPolicy() + ++class CPUAllocationPriorityField(BaseEnumField): ++ AUTO_TYPE = CPUAllocationPriority() ++ + + class CPUThreadAllocationPolicyField(BaseEnumField): + AUTO_TYPE = CPUThreadAllocationPolicy() +diff --git a/objects/instance.py b/objects/instance.py +index e99762d277..dedd7e27f9 100644 +--- a/objects/instance.py ++++ b/objects/instance.py +@@ -114,7 +114,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject, + # Version 2.5: Added hard_delete kwarg in destroy + # Version 2.6: Added hidden + # Version 2.7: Added resources +- VERSION = '2.7' ++ # Version 2.8: Added priority ++ VERSION = '2.8' + + fields = { + 'id': fields.IntegerField(), +@@ -223,6 +224,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject, + 'trusted_certs': fields.ObjectField('TrustedCerts', nullable=True), + 'hidden': fields.BooleanField(default=False), + 'resources': fields.ObjectField('ResourceList', nullable=True), ++ ++ 'priority': fields.StringField(nullable=True), + } + + obj_extra_fields = ['name'] +@@ -230,6 +233,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject, + def obj_make_compatible(self, primitive, target_version): + super(Instance, self).obj_make_compatible(primitive, target_version) + target_version = versionutils.convert_version_to_tuple(target_version) ++ if target_version < (2, 8) and 'priority' in primitive: ++ del primitive['priority'] + if target_version < (2, 7) and 'resources' in primitive: + del primitive['resources'] + if target_version < (2, 6) and 'hidden' in primitive: +diff --git a/virt/hardware.py b/virt/hardware.py +index c4ebae11ca..94c25d4d86 100644 +--- a/virt/hardware.py ++++ b/virt/hardware.py +@@ -1480,6 +1480,59 @@ def get_cpu_policy_constraint( + return cpu_policy + + ++def _get_flavor_priority( ++ key: str, ++ flavor: 'objects.Flavor', ++ default: ty.Any = None, ++ prefix: str = 'hw', ++) -> ty.Any: ++ """Extract both flavor- and image-based variants of metadata.""" ++ flavor_key = ':'.join([prefix, key]) ++ ++ flavor_value = flavor.get('extra_specs', {}).get(flavor_key, None) ++ ++ return flavor_value ++ ++ ++def get_final_priority(flavor, priority): ++ flavor_priority = _get_flavor_priority( ++ 'cpu_priority', flavor) ++ ++ if flavor_priority and (flavor_priority not in fields.CPUAllocationPriority.ALL): ++ raise exception.InvalidCPUAllocationPriority( ++ source='flavor extra specs', ++ requested=flavor_priority, ++ available=str(fields.CPUAllocationPriority.ALL)) ++ if priority and (priority not in fields.CPUAllocationPriority.ALL): ++ raise exception.InvalidCPUAllocationPriority( ++ source='scheduler hints', ++ requested=priority, ++ available=str(fields.CPUAllocationPriority.ALL)) ++ final_priority = priority if priority else flavor_priority ++ return final_priority ++ ++ ++def _check_cpu_priority_constraint(final_priority, cpu_policy): ++ """Validate and return the requested CPU priority. ++ ++ :param flavor: ``nova.objects.Flavor`` instance ++ :param priority: priority string ++ :param cpu_policy: cpu_policy string ++ :raises: exception.HintsPriorityForbidden if priority is defined on both ++ api and flavor and these priorities conflict. ++ :raises: exception.InvalidCPUAllocationPriority if priority is defined with ++ invalid value in api or flavor. ++ """ ++ if final_priority == fields.CPUAllocationPriority.HIGH: ++ if not cpu_policy or cpu_policy != fields.CPUAllocationPolicy.DEDICATED: ++ msg = _('cpu policy must exist and be dedicated if priority is high') ++ raise exception.InvalidRequest(msg) ++ elif final_priority == fields.CPUAllocationPriority.LOW: ++ if cpu_policy and cpu_policy != fields.CPUAllocationPolicy.SHARED: ++ msg = _('cpu policy must be empty or shared if priority is low') ++ raise exception.InvalidRequest(msg) ++ ++ + # NOTE(stephenfin): This must be public as it's used elsewhere + def get_cpu_thread_policy_constraint( + flavor: 'objects.Flavor', +@@ -1955,11 +2008,12 @@ def get_secure_boot_constraint( + return policy + + +-def numa_get_constraints(flavor, image_meta): ++def numa_get_constraints(flavor, image_meta, final_priority=None): + """Return topology related to input request. + + :param flavor: a flavor object to read extra specs from + :param image_meta: nova.objects.ImageMeta object instance ++ :param final_priority: a priority string + + :raises: exception.InvalidNUMANodesNumber if the number of NUMA + nodes is less than 1 or not an integer +@@ -2019,9 +2073,7 @@ def numa_get_constraints(flavor, image_meta): + + # handle explicit VCPU/PCPU resource requests and the HW_CPU_HYPERTHREADING + # trait +- + requested_vcpus, requested_pcpus = _get_vcpu_pcpu_resources(flavor) +- + if cpu_policy and (requested_vcpus or requested_pcpus): + raise exception.InvalidRequest( + "It is not possible to use the 'resources:VCPU' or " +@@ -2073,6 +2125,9 @@ def numa_get_constraints(flavor, image_meta): + + # sanity checks + ++ if final_priority: ++ _check_cpu_priority_constraint(final_priority, cpu_policy) ++ + if cpu_policy in (fields.CPUAllocationPolicy.SHARED, None): + if cpu_thread_policy: + raise exception.CPUThreadPolicyConfigurationInvalid() +diff --git a/virt/libvirt/config.py b/virt/libvirt/config.py +index 1a81be3ade..6967df6270 100644 +--- a/virt/libvirt/config.py ++++ b/virt/libvirt/config.py +@@ -2831,6 +2831,7 @@ class LibvirtConfigGuest(LibvirtConfigObject): + self.idmaps = [] + self.perf_events = [] + self.launch_security = None ++ self.partition = None + + def _format_basic_props(self, root): + root.append(self._text_node("uuid", self.uuid)) +@@ -2859,6 +2860,11 @@ class LibvirtConfigGuest(LibvirtConfigObject): + metadata.append(m.format_dom()) + root.append(metadata) + ++ if self.partition is not None: ++ resource = etree.Element("resource") ++ resource.append(self._text_node("partition", self.partition)) ++ root.append(resource) ++ + def _format_os(self, root): + os = etree.Element("os") + +diff --git a/virt/libvirt/driver.py b/virt/libvirt/driver.py +index 94e7b1945a..f5a1b0523c 100644 +--- a/virt/libvirt/driver.py ++++ b/virt/libvirt/driver.py +@@ -5753,7 +5753,7 @@ class LibvirtDriver(driver.ComputeDriver): + cell_pairs.append((guest_config_cell, host_cell)) + return cell_pairs + +- def _get_pin_cpuset(self, vcpu, inst_cell, host_cell): ++ def _get_pin_cpuset(self, vcpu, inst_cell, host_cell, priority): + """Returns the config object of LibvirtConfigGuestCPUTuneVCPUPin. + + Prepares vcpupin config for the guest with the following caveats: +@@ -5761,6 +5761,8 @@ class LibvirtDriver(driver.ComputeDriver): + a) If the specified instance vCPU is intended to be pinned, we pin + it to the previously selected host CPU. + b) Otherwise we float over the whole host NUMA node ++ When the instance has low priority and cpu_priority_mix_enable ++ is true, it also floats over the dedicated_cpu_set. + """ + pin_cpuset = vconfig.LibvirtConfigGuestCPUTuneVCPUPin() + pin_cpuset.id = vcpu +@@ -5773,12 +5775,14 @@ class LibvirtDriver(driver.ComputeDriver): + pin_cpuset.cpuset = set([inst_cell.cpu_pinning[vcpu]]) + else: + pin_cpuset.cpuset = host_cell.cpuset ++ if CONF.compute.cpu_priority_mix_enable and priority == 'low': ++ pin_cpuset.cpuset |= host_cell.pcpuset + + return pin_cpuset + + def _get_emulatorpin_cpuset(self, vcpu, object_numa_cell, vcpus_rt, + emulator_threads_policy, +- pin_cpuset): ++ pin_cpuset, priority): + """Returns a set of cpu_ids to add to the cpuset for emulator threads + with the following caveats: + +@@ -5787,6 +5791,8 @@ class LibvirtDriver(driver.ComputeDriver): + b) If emulator threads policy is shared and CONF.cpu_shared_set is + defined, we pin emulator threads on the set of pCPUs defined by + CONF.cpu_shared_set ++ If the instance has low priority and cpu_priority_mix_enable is ++ true, CONF.cpu_dedicated_set is also included. + c) Otherwise; + c1) If realtime IS NOT enabled, the emulator threads are + allowed to float cross all the pCPUs associated with +@@ -5798,6 +5804,7 @@ class LibvirtDriver(driver.ComputeDriver): + """ + emulatorpin_cpuset = set([]) + shared_ids = hardware.get_cpu_shared_set() ++ dedicated_ids = hardware.get_cpu_dedicated_set() + + if emulator_threads_policy == fields.CPUEmulatorThreadsPolicy.ISOLATE: + if object_numa_cell.cpuset_reserved: +@@ -5814,6 +5821,9 @@ class LibvirtDriver(driver.ComputeDriver): + {'online': sorted(online_pcpus), + 'req': sorted(shared_ids)}) + raise exception.Invalid(msg) ++ if (CONF.compute.cpu_priority_mix_enable and priority == 'low' and ++ dedicated_ids): ++ cpuset |= dedicated_ids & online_pcpus + emulatorpin_cpuset = cpuset + elif not vcpus_rt or vcpu not in vcpus_rt: + emulatorpin_cpuset = pin_cpuset.cpuset +@@ -5821,7 +5831,7 @@ class LibvirtDriver(driver.ComputeDriver): + return emulatorpin_cpuset + + def _get_guest_numa_config(self, instance_numa_topology, flavor, +- image_meta): ++ image_meta, priority=None): + """Returns the config objects for the guest NUMA specs. + + Determines the CPUs that the guest can be pinned to if the guest +@@ -5862,6 +5872,10 @@ class LibvirtDriver(driver.ComputeDriver): + shared_cpus = None + if CONF.vcpu_pin_set or CONF.compute.cpu_shared_set: + shared_cpus = self._get_vcpu_available() ++ if CONF.compute.cpu_priority_mix_enable: ++ if shared_cpus and priority == 'low' and CONF.compute.cpu_dedicated_set: ++ dedicated_cpus = self._get_pcpu_available() ++ shared_cpus |= dedicated_cpus + + topology = self._get_host_numa_topology() + +@@ -5922,12 +5936,12 @@ class LibvirtDriver(driver.ComputeDriver): + object_numa_cell = instance_numa_topology.cells[guest_node_id] + for cpu in guest_config_cell.cpus: + pin_cpuset = self._get_pin_cpuset(cpu, object_numa_cell, +- host_cell) ++ host_cell, priority) + guest_cpu_tune.vcpupin.append(pin_cpuset) + + emu_pin_cpuset = self._get_emulatorpin_cpuset( + cpu, object_numa_cell, vcpus_rt, +- emulator_threads_policy, pin_cpuset) ++ emulator_threads_policy, pin_cpuset, priority) + guest_cpu_tune.emulatorpin.cpuset.update(emu_pin_cpuset) + + # TODO(berrange) When the guest has >1 NUMA node, it will +@@ -6853,7 +6867,7 @@ class LibvirtDriver(driver.ComputeDriver): + guest.vcpus = flavor.vcpus + + guest_numa_config = self._get_guest_numa_config( +- instance.numa_topology, flavor, image_meta) ++ instance.numa_topology, flavor, image_meta, instance.priority) + + guest.cpuset = guest_numa_config.cpuset + guest.cputune = guest_numa_config.cputune +@@ -6975,6 +6989,8 @@ class LibvirtDriver(driver.ComputeDriver): + if vpmems: + self._guest_add_vpmems(guest, vpmems) + ++ self._guest_add_partition(guest, instance) ++ + return guest + + def _get_ordered_vpmems(self, instance, flavor): +@@ -7134,6 +7150,14 @@ class LibvirtDriver(driver.ComputeDriver): + else: + raise exception.InvalidWatchdogAction(action=watchdog_action) + ++ def _guest_add_partition(self, guest, instance): ++ if instance.priority == 'high': ++ guest.partition = '/high_prio_machine' ++ elif instance.priority == 'low': ++ guest.partition = '/low_prio_machine' ++ else: ++ guest.partition = None ++ + def _guest_add_pci_devices(self, guest, instance): + if CONF.libvirt.virt_type in ('qemu', 'kvm'): + # Get all generic PCI devices (non-SR-IOV). +-- +2.23.0 diff --git a/0001-openEuler-support-for-OpenStack-Helm.patch b/0001-openEuler-support-for-OpenStack-Helm.patch new file mode 100644 index 0000000..25cd998 --- /dev/null +++ b/0001-openEuler-support-for-OpenStack-Helm.patch @@ -0,0 +1,122 @@ +From 28bf46a43f9c34a46f2800f9ac6d99094b872639 Mon Sep 17 00:00:00 2001 +From: Yinuo Deng +Date: Mon, 22 Aug 2022 17:55:37 +0800 +Subject: [PATCH] openEuler support for OpenStack-Helm codebase + +--- + .../neutron/templates/bin/_neutron-dhcp-agent-init.sh.tpl | 2 +- + .../neutron/templates/bin/_neutron-l3-agent-init.sh.tpl | 2 +- + .../templates/bin/_neutron-linuxbridge-agent-init.sh.tpl | 2 +- + .../neutron/templates/bin/_neutron-metadata-agent-init.sh.tpl | 2 +- + .../templates/bin/_neutron-openvswitch-agent-init.sh.tpl | 2 +- + .../neutron/templates/bin/_neutron-sriov-agent-init.sh.tpl | 2 +- + .../source/neutron/templates/daemonset-ovs-agent.yaml | 4 ++-- + .../source/nova/templates/bin/_nova-compute-init.sh.tpl | 4 +++- + 8 files changed, 11 insertions(+), 9 deletions(-) + +diff --git a/openstack-helm/source/neutron/templates/bin/_neutron-dhcp-agent-init.sh.tpl b/openstack-helm/source/neutron/templates/bin/_neutron-dhcp-agent-init.sh.tpl +index 3df3315..7a286f1 100644 +--- a/openstack-helm/source/neutron/templates/bin/_neutron-dhcp-agent-init.sh.tpl ++++ b/openstack-helm/source/neutron/templates/bin/_neutron-dhcp-agent-init.sh.tpl +@@ -20,6 +20,6 @@ set -ex + mkdir -p /tmp/pod-shared + tee > /tmp/pod-shared/neutron-agent.ini << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} +diff --git a/openstack-helm/source/neutron/templates/bin/_neutron-l3-agent-init.sh.tpl b/openstack-helm/source/neutron/templates/bin/_neutron-l3-agent-init.sh.tpl +index b9b93b2..4282bb2 100644 +--- a/openstack-helm/source/neutron/templates/bin/_neutron-l3-agent-init.sh.tpl ++++ b/openstack-helm/source/neutron/templates/bin/_neutron-l3-agent-init.sh.tpl +@@ -20,6 +20,6 @@ set -ex + mkdir -p /tmp/pod-shared + tee > /tmp/pod-shared/neutron-agent.ini << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} +diff --git a/openstack-helm/source/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl b/openstack-helm/source/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl +index ed95189..26bef05 100644 +--- a/openstack-helm/source/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl ++++ b/openstack-helm/source/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl +@@ -61,6 +61,6 @@ EOF + mkdir -p /tmp/pod-shared + tee > /tmp/pod-shared/neutron-agent.ini << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} +diff --git a/openstack-helm/source/neutron/templates/bin/_neutron-metadata-agent-init.sh.tpl b/openstack-helm/source/neutron/templates/bin/_neutron-metadata-agent-init.sh.tpl +index 5b6ce43..91f0e8b 100644 +--- a/openstack-helm/source/neutron/templates/bin/_neutron-metadata-agent-init.sh.tpl ++++ b/openstack-helm/source/neutron/templates/bin/_neutron-metadata-agent-init.sh.tpl +@@ -22,6 +22,6 @@ chown ${NEUTRON_USER_UID} /var/lib/neutron/openstack-helm + mkdir -p /tmp/pod-shared + tee > /tmp/pod-shared/neutron-agent.ini << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} +diff --git a/openstack-helm/source/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl b/openstack-helm/source/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl +index 3283e09..8bb540b 100644 +--- a/openstack-helm/source/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl ++++ b/openstack-helm/source/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl +@@ -491,6 +491,6 @@ fi + mkdir -p /tmp/pod-shared + tee > /tmp/pod-shared/neutron-agent.ini << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} +diff --git a/openstack-helm/source/neutron/templates/bin/_neutron-sriov-agent-init.sh.tpl b/openstack-helm/source/neutron/templates/bin/_neutron-sriov-agent-init.sh.tpl +index d98cfe8..5ced238 100644 +--- a/openstack-helm/source/neutron/templates/bin/_neutron-sriov-agent-init.sh.tpl ++++ b/openstack-helm/source/neutron/templates/bin/_neutron-sriov-agent-init.sh.tpl +@@ -99,7 +99,7 @@ ethtool --set-priv-flags ${NIC_FIRST_PORT} vf-true-promisc-support ${promisc_mod + mkdir -p /tmp/pod-shared + tee > /tmp/pod-shared/neutron-agent.ini << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} + +diff --git a/openstack-helm/source/neutron/templates/daemonset-ovs-agent.yaml b/openstack-helm/source/neutron/templates/daemonset-ovs-agent.yaml +index 59e33f0..0f6999c 100644 +--- a/openstack-helm/source/neutron/templates/daemonset-ovs-agent.yaml ++++ b/openstack-helm/source/neutron/templates/daemonset-ovs-agent.yaml +@@ -116,8 +116,8 @@ spec: + name: {{ $configMapName }} + key: update_dpdk_bond_config + {{- end }} +- command: +- - /tmp/neutron-openvswitch-agent-init.sh ++ command: ["/bin/sh","-c"] ++ args: ["chmod -R 777 /tmp/pod-shared; ls -l /tmp/pod-shared; /tmp/neutron-openvswitch-agent-init.sh"] + volumeMounts: + - name: pod-tmp + mountPath: /tmp +diff --git a/openstack-helm/source/nova/templates/bin/_nova-compute-init.sh.tpl b/openstack-helm/source/nova/templates/bin/_nova-compute-init.sh.tpl +index 0636b69..6e12537 100644 +--- a/openstack-helm/source/nova/templates/bin/_nova-compute-init.sh.tpl ++++ b/openstack-helm/source/nova/templates/bin/_nova-compute-init.sh.tpl +@@ -58,6 +58,8 @@ EOF + {{- if and ( empty .Values.conf.nova.DEFAULT.host ) ( .Values.pod.use_fqdn.compute ) }} + tee > /tmp/pod-shared/nova-compute-fqdn.conf << EOF + [DEFAULT] +-host = $(hostname --fqdn) ++host = $(hostname) + EOF + {{- end }} ++ ++chmod 777 /tmp/pod-shared/* +\ No newline at end of file +-- +2.36.1 + diff --git a/0002-openEuler-support-for-OpenStack-Helm-infra.patch b/0002-openEuler-support-for-OpenStack-Helm-infra.patch new file mode 100644 index 0000000..b444857 --- /dev/null +++ b/0002-openEuler-support-for-OpenStack-Helm-infra.patch @@ -0,0 +1,298 @@ +From e19e3e73b3ed906878c1f30e25192f7810f51361 Mon Sep 17 00:00:00 2001 +From: Yinuo Deng +Date: Mon, 22 Aug 2022 17:56:54 +0800 +Subject: [PATCH] openEuler support for OpenStack-Helm-Infra codebase + +--- + .../deployment/common/000-install-packages.sh | 18 +++- + .../source/tools/gate/deploy-k8s-kubeadm.sh | 84 +++++++++++++----- + .../source/tools/gate/deploy-k8s.sh | 87 ++++++++++++------- + .../source/tools/gate/devel/start.sh | 7 ++ + 4 files changed, 138 insertions(+), 58 deletions(-) + +diff --git a/openstack-helm-infra/source/tools/deployment/common/000-install-packages.sh b/openstack-helm-infra/source/tools/deployment/common/000-install-packages.sh +index 90118f9..f244d30 100755 +--- a/openstack-helm-infra/source/tools/deployment/common/000-install-packages.sh ++++ b/openstack-helm-infra/source/tools/deployment/common/000-install-packages.sh +@@ -14,8 +14,10 @@ + + set -xe + +-sudo apt-get update +-sudo apt-get install --no-install-recommends -y \ ++if command -v apt-get &> /dev/null ++then ++ sudo apt-get update ++ sudo apt-get install --no-install-recommends -y \ + ca-certificates \ + git \ + make \ +@@ -24,3 +26,15 @@ sudo apt-get install --no-install-recommends -y \ + bc \ + python3-pip \ + dnsutils ++else ++ sudo yum update --allowerasing --nobest ++ sudo yum install -y \ ++ ca-certificates \ ++ git \ ++ make \ ++ nmap \ ++ curl \ ++ bc \ ++ python3-pip \ ++ bind-utils ++fi +diff --git a/openstack-helm-infra/source/tools/gate/deploy-k8s-kubeadm.sh b/openstack-helm-infra/source/tools/gate/deploy-k8s-kubeadm.sh +index 507f0a9..ed44b01 100755 +--- a/openstack-helm-infra/source/tools/gate/deploy-k8s-kubeadm.sh ++++ b/openstack-helm-infra/source/tools/gate/deploy-k8s-kubeadm.sh +@@ -61,12 +61,15 @@ configure_resolvconf + . /etc/os-release + + # NOTE: Add docker repo +-curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +-sudo apt-key fingerprint 0EBFCD88 +-sudo add-apt-repository \ +- "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ +- $(lsb_release -cs) \ +- stable" ++if command -v apt-get &> /dev/null ++then ++ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ++ sudo apt-key fingerprint 0EBFCD88 ++ sudo add-apt-repository \ ++ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ ++ $(lsb_release -cs) \ ++ stable" ++fi + + # NOTE: Configure docker + docker_resolv="/run/systemd/resolve/resolv.conf" +@@ -75,7 +78,7 @@ docker_dns_list="$(awk '/^nameserver/ { printf "%s%s",sep,"\"" $NF "\""; sep=", + sudo -E mkdir -p /etc/docker + sudo -E tee /etc/docker/daemon.json < /dev/null ++then ++ wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add - ++ RELEASE_NAME=$(grep 'CODENAME' /etc/lsb-release | awk -F= '{print $2}') ++ sudo add-apt-repository "deb https://download.ceph.com/debian-nautilus/ ++ ${RELEASE_NAME} main" ++ ++ sudo -E apt-get update ++ sudo -E apt-get install -y \ ++ docker \ ++ socat \ ++ jq \ ++ util-linux \ ++ bridge-utils \ ++ iptables \ ++ conntrack \ ++ libffi-dev \ ++ ipvsadm \ ++ make \ ++ bc \ ++ git-review \ ++ notary \ ++ ceph-common \ ++ rbd-nbd \ ++ nfs-common ++else ++ sudo yum update --allowerasing --nobest ++ sudo -E yum install -y --nobest \ ++ docker \ ++ socat \ ++ jq \ ++ util-linux \ ++ bridge-utils \ ++ iptables \ ++ conntrack \ ++ libffi-devel \ ++ ipvsadm \ ++ make \ ++ bc \ ++ ceph-common \ ++ rbd-nbd \ ++ nfs-utils ++ curl https://github.com/notaryproject/notary/releases/download/v0.6.1/notary-Linux-amd64 -L -o /usr/bin/notary ++ chmod +x /usr/bin/notary ++fi + + # Prepare tmpfs for etcd when running on CI + # CI VMs can have slow I/O causing issues for etcd +@@ -140,10 +171,15 @@ sudo -E bash -c \ + sudo -E mv "${TMP_DIR}"/helm /usr/local/bin/helm + rm -rf "${TMP_DIR}" + ++sudo modprobe br_netfilter ++sudo echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables ++sudo echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables + # NOTE: Deploy kubernetes using kubeadm. A CNI that supports network policy is + # required for validation; use calico for simplicity. + sudo kubeadm init --pod-network-cidr=192.168.0.0/16 + ++sudo systemctl enable --now kubelet.service ++ + mkdir -p $HOME/.kube + sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config +diff --git a/openstack-helm-infra/source/tools/gate/deploy-k8s.sh b/openstack-helm-infra/source/tools/gate/deploy-k8s.sh +index 4e435cc..6e73bf2 100755 +--- a/openstack-helm-infra/source/tools/gate/deploy-k8s.sh ++++ b/openstack-helm-infra/source/tools/gate/deploy-k8s.sh +@@ -93,12 +93,15 @@ configure_resolvconf + . /etc/os-release + + # NOTE: Add docker repo +-curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +-sudo apt-key fingerprint 0EBFCD88 +-sudo add-apt-repository \ +- "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ +- $(lsb_release -cs) \ +- stable" ++if command -v apt-get &> /dev/null ++then ++ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ++ sudo apt-key fingerprint 0EBFCD88 ++ sudo add-apt-repository \ ++ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ ++ $(lsb_release -cs) \ ++ stable" ++fi + + # NOTE: Configure docker + docker_resolv="/run/systemd/resolve/resolv.conf" +@@ -107,7 +110,7 @@ docker_dns_list="$(awk '/^nameserver/ { printf "%s%s",sep,"\"" $NF "\""; sep=", + sudo -E mkdir -p /etc/docker + sudo -E tee /etc/docker/daemon.json < /dev/null ++then ++ wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add - ++ RELEASE_NAME=$(grep 'CODENAME' /etc/lsb-release | awk -F= '{print $2}') ++ sudo add-apt-repository "deb https://download.ceph.com/debian-nautilus/ ++ ${RELEASE_NAME} main" ++ ++ sudo -E apt-get update ++ sudo -E apt-get install -y \ ++ docker \ ++ socat \ ++ jq \ ++ util-linux \ ++ bridge-utils \ ++ iptables \ ++ conntrack \ ++ libffi-dev \ ++ ipvsadm \ ++ make \ ++ bc \ ++ git-review \ ++ notary \ ++ ceph-common \ ++ rbd-nbd \ ++ nfs-common ++else ++ sudo yum update --allowerasing --nobest ++ sudo -E yum install -y --nobest \ ++ docker \ ++ socat \ ++ jq \ ++ util-linux \ ++ bridge-utils \ ++ iptables \ ++ conntrack \ ++ libffi-devel \ ++ ipvsadm \ ++ make \ ++ bc \ ++ ceph-common \ ++ rbd-nbd \ ++ nfs-utils ++ curl https://github.com/notaryproject/notary/releases/download/v0.6.1/notary-Linux-amd64 -L -o /usr/bin/notary ++ chmod +x /usr/bin/notary ++fi + + sudo -E tee /etc/modprobe.d/rbd.conf << EOF + install rbd /bin/true +diff --git a/openstack-helm-infra/source/tools/gate/devel/start.sh b/openstack-helm-infra/source/tools/gate/devel/start.sh +index 7dbddf5..879846b 100755 +--- a/openstack-helm-infra/source/tools/gate/devel/start.sh ++++ b/openstack-helm-infra/source/tools/gate/devel/start.sh +@@ -43,6 +43,13 @@ function ansible_install { + curl + sudo curl -L -o /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 + sudo chmod +x /usr/bin/jq ++ elif [ "x$ID" == "xopenEuler" ]; then ++ sudo yum install -y \ ++ openEuler-rpm-config \ ++ gcc \ ++ curl ++ sudo curl -L -o /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 ++ sudo chmod +x /usr/bin/jq + elif [ "x$ID" == "xfedora" ]; then + sudo dnf install -y \ + python-devel \ +-- +2.36.1 + diff --git a/0003-openEuler-support-for-loci.patch b/0003-openEuler-support-for-loci.patch new file mode 100644 index 0000000..13a205b --- /dev/null +++ b/0003-openEuler-support-for-loci.patch @@ -0,0 +1,78 @@ +From c95840dfd718d016548e398e464a266ab63ed346 Mon Sep 17 00:00:00 2001 +From: Yinuo Deng +Date: Tue, 30 Aug 2022 05:20:51 +0000 +Subject: [PATCH] Added support for openEuler + +--- + scripts/cleanup.sh | 2 +- + scripts/collect_info.sh | 2 +- + scripts/install.sh | 13 +++++++++++++ + scripts/install_packages.sh | 2 +- + 4 files changed, 16 insertions(+), 3 deletions(-) + +diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh +index 75b02e8..4819d4e 100755 +--- a/scripts/cleanup.sh ++++ b/scripts/cleanup.sh +@@ -11,7 +11,7 @@ case ${distro} in + virtualenv + rm -rf /var/lib/apt/lists/* + ;; +- centos) ++ centos|openeuler) + # We should be removing 'patch' here, but that breaks + # centos as it tries to rip out systemd for some reason + yum -y autoremove \ +diff --git a/scripts/collect_info.sh b/scripts/collect_info.sh +index 96c963e..d31fd3c 100755 +--- a/scripts/collect_info.sh ++++ b/scripts/collect_info.sh +@@ -11,7 +11,7 @@ case ${distro} in + ubuntu) + dpkg -l > $PACKAGES_INFO + ;; +- centos) ++ centos|openeuler) + yum list installed > $PACKAGES_INFO + ;; + *) +diff --git a/scripts/install.sh b/scripts/install.sh +index 335c700..d32b493 100755 +--- a/scripts/install.sh ++++ b/scripts/install.sh +@@ -50,6 +50,19 @@ case ${distro} in + pip3 install virtualenv + fi + ;; ++ openeuler) ++ export LC_CTYPE=en_US.UTF-8 ++ yum upgrade -y --allowerasing --nobest ++ yum install -y --setopt=skip_missing_names_on_install=False \ ++ git \ ++ patch \ ++ redhat-lsb-core \ ++ sudo \ ++ ${rpm_python_packages[@]} ++ if [[ "${PYTHON3}" != "no" ]]; then ++ pip3 install virtualenv ++ fi ++ ;; + *) + echo "Unknown distro: ${distro}" + exit 1 +diff --git a/scripts/install_packages.sh b/scripts/install_packages.sh +index 2534a42..be8f2cd 100755 +--- a/scripts/install_packages.sh ++++ b/scripts/install_packages.sh +@@ -28,7 +28,7 @@ if [[ ! -z ${PACKAGES} ]]; then + apt-get purge -y wget + fi + ;; +- centos) ++ centos|openeuler) + yum -y --setopt=skip_missing_names_on_install=False install ${PACKAGES[@]} ${DIST_PACKAGES} + ;; + *) +-- +2.36.1 + diff --git a/0004-Add-isula-support-for-kolla.patch b/0004-Add-isula-support-for-kolla.patch new file mode 100644 index 0000000..6995ef2 --- /dev/null +++ b/0004-Add-isula-support-for-kolla.patch @@ -0,0 +1,303 @@ +From 27bc77e458db8f086e6c4de82d516f6a63c3a22b Mon Sep 17 00:00:00 2001 +From: lijiahui4 +Date: Wed, 31 Aug 2022 15:53:26 +0800 +Subject: [PATCH] Add isula support for kolla + +--- + common/config.py | 3 + + image/build.py | 58 ++++++------ + image/runtime.py | 140 ++++++++++++++++++++++++++++ + 3 files changed, 172 insertions(+), 29 deletions(-) + create mode 100644 image/runtime.py + +diff --git a/common/config.py b/common/config.py +index 6d067bf..dec8dcf 100755 +--- a/common/config.py ++++ b/common/config.py +@@ -154,6 +154,9 @@ _CLI_OPTS = [ + cfg.StrOpt('base-arch', default=hostarch, + choices=BASE_ARCH, + help='The base architecture. Default is same as host.'), ++ cfg.StrOpt('base-runtime', default='docker', ++ choices=['docker', 'isula'], ++ help='The base container runtime. Default is docker'), + cfg.BoolOpt('use-dumb-init', default=True, + help='Use dumb-init as init system in containers'), + cfg.BoolOpt('debug', short='d', default=False, +diff --git a/image/build.py b/image/build.py +index f2a2eaf..c4d7dee 100755 +--- a/image/build.py ++++ b/image/build.py +@@ -49,6 +49,7 @@ from kolla.common import config as common_config # noqa + from kolla.common import task # noqa + from kolla.common import utils # noqa + from kolla import exception # noqa ++from kolla.image import runtime + from kolla.template import filters as jinja_filters # noqa + from kolla.template import methods as jinja_methods # noqa + from kolla import version # noqa +@@ -184,19 +185,16 @@ def join_many(threads): + + + class DockerTask(task.Task): +- +- docker_kwargs = docker.utils.kwargs_from_env() +- +- def __init__(self): ++ def __init__(self, conf): + super(DockerTask, self).__init__() + self._dc = None ++ self.conf = conf + + @property + def dc(self): + if self._dc is not None: + return self._dc +- docker_kwargs = self.docker_kwargs.copy() +- self._dc = docker.APIClient(version='auto', **docker_kwargs) ++ self._dc = runtime.RuntimeAdapter(self.conf.base_runtime) + return self._dc + + +@@ -269,7 +267,7 @@ class PushTask(DockerTask): + """Task that pushes an image to a docker repository.""" + + def __init__(self, conf, image): +- super(PushTask, self).__init__() ++ super(PushTask, self).__init__(conf) + self.conf = conf + self.image = image + self.logger = image.logger +@@ -307,9 +305,10 @@ class PushTask(DockerTask): + + # Since docker 3.0.0, the argument of 'insecure_registry' is removed. + # To be compatible, set 'insecure_registry=True' for old releases. +- dc_running_ver = StrictVersion(docker.version) +- if dc_running_ver < StrictVersion('3.0.0'): +- kwargs['insecure_registry'] = True ++ if self.conf.base_runime == 'docker': ++ dc_running_ver = StrictVersion(docker.version) ++ if dc_running_ver < StrictVersion('3.0.0'): ++ kwargs['insecure_registry'] = True + + for response in self.dc.push(image.canonical_name, **kwargs): + if 'stream' in response: +@@ -325,7 +324,7 @@ class BuildTask(DockerTask): + """Task that builds out an image.""" + + def __init__(self, conf, image, push_queue): +- super(BuildTask, self).__init__() ++ super(BuildTask, self).__init__(conf) + self.conf = conf + self.image = image + self.push_queue = push_queue +@@ -558,23 +557,25 @@ class BuildTask(DockerTask): + pull=pull, + forcerm=self.forcerm, + buildargs=buildargs): +- if 'stream' in stream: +- for line in stream['stream'].split('\n'): +- if line: +- self.logger.info('%s', line) +- if 'errorDetail' in stream: +- image.status = Status.ERROR +- self.logger.error('Error\'d with the following message') +- for line in stream['errorDetail']['message'].split('\n'): +- if line: +- self.logger.error('%s', line) +- return +- ++ if self.conf.base_runtime == 'docker': ++ if 'stream' in stream: ++ for line in stream['stream'].split('\n'): ++ if line: ++ self.logger.info('%s', line) ++ if 'errorDetail' in stream: ++ image.status = Status.ERROR ++ self.logger.error('Error\'d with the following message') ++ for line in stream['errorDetail']['message'].split('\n'): ++ if line: ++ self.logger.error('%s', line) ++ return ++ else: ++ self.logger.info('%s', stream) + if image.status != Status.ERROR and self.conf.squash: + self.squash() +- except docker.errors.DockerException: ++ except runtime.InitException: + image.status = Status.ERROR +- self.logger.exception('Unknown docker error when building') ++ self.logger.exception('Init runtime client failed') + except Exception: + image.status = Status.ERROR + self.logger.exception('Unknown error when building') +@@ -724,16 +725,15 @@ class KollaWorker(object): + self.maintainer = conf.maintainer + self.distro_python_version = conf.distro_python_version + +- docker_kwargs = docker.utils.kwargs_from_env() + try: +- self.dc = docker.APIClient(version='auto', **docker_kwargs) +- except docker.errors.DockerException as e: ++ self.dc = runtime.RuntimeAdapter(conf.base_runtime) ++ except runtime.InitException as e: + self.dc = None + if not (conf.template_only or + conf.save_dependency or + conf.list_images or + conf.list_dependencies): +- LOG.error("Unable to connect to Docker, exiting") ++ LOG.error("Unable to connect to %s, exiting" % conf.base_runtime) + LOG.info("Exception caught: {0}".format(e)) + sys.exit(1) + +diff --git a/image/runtime.py b/image/runtime.py +new file mode 100644 +index 0000000..a733ac3 +--- /dev/null ++++ b/image/runtime.py +@@ -0,0 +1,140 @@ ++import os ++ ++import docker ++ ++ ++class DockerRuntime(object): ++ def __init__(self): ++ try: ++ docker_kwargs = docker.utils.kwargs_from_env() ++ self.client = docker.APIClient(version="auto", **docker_kwargs) ++ except docker.errors.DockerException: ++ raise InitException ++ ++ def images(self, name=None, quiet=None): ++ return self.client.images(name=name, quiet=quiet) ++ ++ def inspect_image(self, image_tag): ++ return self.client.history(image_tag) ++ ++ def history(self, name): ++ return self.client.history(name) ++ ++ def build( ++ self, ++ path=None, ++ tag=None, ++ nocache=None, ++ rm=None, ++ decode=None, ++ network_mode=None, ++ pull=None, ++ forcerm=None, ++ buildargs=None, ++ ): ++ return self.client.build( ++ path=path, ++ tag=tag, ++ nocache=nocache, ++ rm=rm, ++ decode=decode, ++ network_mode=network_mode, ++ pull=pull, ++ forcerm=forcerm, ++ buildargs=buildargs, ++ ) ++ ++ def push(self, name, **kwargs): ++ return self.client.push(name, **kwargs) ++ ++ ++class IsulaRuntime(object): ++ def __init__(self): ++ from isula import client ++ try: ++ self.builder_client = client.init_builder_client() ++ self.isulad_client = client.init_isulad_client() ++ except Exception: ++ raise InitException ++ ++ def images(self, name=None, quiet=None): ++ return self.builder_client.list_images(image_name=name) ++ ++ def inspect_image(self, image_tag): ++ # TODO(wxy): This API doesn't work now. Correct it. ++ #return self.isulad_client.inspect_image(image_tag) ++ raise NotImplementedError ++ ++ def history(self, name): ++ # isula doesn't support this API. ++ raise NotImplementedError ++ ++ def build( ++ self, ++ path=None, ++ tag=None, ++ nocache=None, ++ rm=None, ++ decode=None, ++ network_mode=None, ++ pull=None, ++ forcerm=None, ++ buildargs=None, ++ ): ++ docker_file = os.path.join(path, 'Dockerfile') ++ output = 'isulad:' + tag ++ image_format = 'oci' ++ return self.builder_client.build_image(docker_file, output, ++ image_format, path, nocache=nocache) ++ ++ def push(self, name, **kwargs): ++ return self.builder_client.push_image(name, "oci") ++ ++ ++class RuntimeAdapter(object): ++ def __init__(self, base_runtime): ++ if base_runtime == "docker": ++ self.runtime = DockerRuntime() ++ elif base_runtime == "isula": ++ self.runtime = IsulaRuntime() ++ ++ def images(self, name=None, quiet=None): ++ return self.runtime.images(name=name, quiet=quiet) ++ ++ def inspect_image(self, image_tag): ++ return self.runtime.inspect_image(image_tag) ++ ++ def history(self, name): ++ return self.runtime.history(name) ++ ++ def build( ++ self, ++ path=None, ++ tag=None, ++ nocache=None, ++ rm=None, ++ decode=None, ++ network_mode=None, ++ pull=None, ++ forcerm=None, ++ buildargs=None, ++ ): ++ return self.runtime.build( ++ path=path, ++ tag=tag, ++ nocache=nocache, ++ rm=rm, ++ decode=decode, ++ network_mode=network_mode, ++ pull=pull, ++ forcerm=forcerm, ++ buildargs=buildargs, ++ ) ++ ++ def push(self, name, **kwargs): ++ return self.runtime.push(name, **kwargs) ++ ++ ++class InitException(Exception): ++ def __init__(self): ++ super(InitException, self).__init__() +\ No newline at end of file +-- +2.17.1 + diff --git a/openstack-plugin-Yoga.tar.gz b/openstack-plugin-Yoga.tar.gz deleted file mode 100644 index 1401caaa6f8330037e06d9cd59f958466f49527f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10829 zcmV-TDzeodiwFP!000001MFLSbK6Fe_uu>!Q%bH#h9HOs36R_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diff --git a/openstack-plugin.spec b/openstack-plugin.spec index 6f0c096..e5b3d34 100644 --- a/openstack-plugin.spec +++ b/openstack-plugin.spec @@ -11,26 +11,47 @@ git reset --hard HEAD~;\ rm -rf %1/.git Name: openstack-plugin -Version: Yoga -Release: 3 +Version: 1.0.0 +Release: 1 Summary: The plug-in package of openstack for openEuler License: Apache-2.0 URL: https://gitee.com/openeuler/openstack-plugin -Source0: openstack-plugin-%{version}.tar.gz +Source0: 0000-Add-VM-high-low-priority-feature-support.patch +Source1: 0001-openEuler-support-for-OpenStack-Helm.patch +Source2: 0002-openEuler-support-for-OpenStack-Helm-infra.patch +Source3: 0003-openEuler-support-for-loci.patch +Source4: 0004-Add-isula-support-for-kolla.patch BuildArch: noarch %description Openstack-plugin provides openstack plug-in codes developed by openstack sig. -%package -n openstack-priority_vm +%package priority-vm Summary: The plug-in package of priority_vm for openEuler Requires: openstack-plugin-nova -%description -n openstack-priority_vm -Openstack-priority_vm provides priority_vm codes developed by openstack sig. +%description priority-vm +priority-vm provides priority_vm codes developed by openstack sig. + +%package openstack-helm-openeuler-support +Summary: The plug-in package of openstack-helm for openEuler +Requires: openstack-plugin-openstack-helm +Requires: openstack-plugin-openstack-helm-infra +Requires: openstack-plugin-loci + +%description openstack-helm-openeuler-support +openstack-helm-openeuler-support provides openeuler support codes developed by openstack sig. + +%package kolla-isula-support +Summary: The plug-in package of kolla for openEuler isula +Requires: openstack-plugin-kolla +Requires: python3-isula + +%description kolla-isula-support +kolla-isula-support provides openeuler support codes developed by openstack sig. %package nova -Summary: The plug-in package of openstack-nova for openEuler +Summary: The plug-in package of openstack-nova for openEuler isula Requires: git Requires: openstack-nova @@ -61,26 +82,37 @@ Requires: loci %description loci Loci contains codes adapted for openEuler. +%package kolla +Summary: The plug-in package of kolla for openEuler +Requires: git +Requires: openstack-kolla + +%description kolla +kolla codes adapted for openEuler. + %prep -%setup -q -n openstack-plugin-%{version} %install -install -D -p -m 644 nova/0001-Add-VM-high-low-priority-feature-support.patch %{buildroot}%{python3_sitelib}/openstack-plugin/nova/0001-Add-VM-high-low-priority-feature-support.patch -install -D -p -m 644 openstack-helm/0001-openEuler-support-for-OpenStack-Helm-codebase.patch %{buildroot}%{python3_sitelib}/openstack-plugin/openstack-helm/0001-openEuler-support-for-OpenStack-Helm-codebase.patch -install -D -p -m 644 openstack-helm-infra/0001-openEuler-support-for-OpenStack-Helm-Infra-codebase.patch %{buildroot}%{python3_sitelib}/openstack-plugin/openstack-helm-infra/0001-openEuler-support-for-OpenStack-Helm-codebase.patch -install -D -p -m 644 loci/0001-Added-support-for-openEuler.patch %{buildroot}%{python3_sitelib}/openstack-plugin/loci/0001-Added-support-for-openEuler.patch +install -D -p -m 644 %{SOURCE0} %{buildroot}%{python3_sitelib}/openstack-plugin/%{SOURCE0} +install -D -p -m 644 %{SOURCE1} %{buildroot}%{python3_sitelib}/openstack-plugin/%{SOURCE1} +install -D -p -m 644 %{SOURCE2} %{buildroot}%{python3_sitelib}/openstack-plugin/%{SOURCE2} +install -D -p -m 644 %{SOURCE3} %{buildroot}%{python3_sitelib}/openstack-plugin/%{SOURCE3} +install -D -p -m 644 %{SOURCE4} %{buildroot}%{python3_sitelib}/openstack-plugin/%{SOURCE4} %post nova -%gitPatch %{python3_sitelib}/nova %{python3_sitelib}/openstack-plugin/nova/0001-Add-VM-high-low-priority-feature-support.patch +%gitPatch %{python3_sitelib}/nova %{python3_sitelib}/openstack-plugin/%{SOURCE0} %post openstack-helm -%gitPatch %{_datadir}/openstack-helm/openstack-helm %{python3_sitelib}/openstack-plugin/openstack-helm/0001-openEuler-support-for-OpenStack-Helm-codebase.patch +%gitPatch %{_datadir}/openstack-helm/openstack-helm %{python3_sitelib}/openstack-plugin/%{SOURCE1} %post openstack-helm-infra -%gitPatch %{_datadir}/openstack-helm/openstack-helm-infra %{python3_sitelib}/openstack-plugin/openstack-helm-infra/0001-openEuler-support-for-OpenStack-Helm-codebase.patch +%gitPatch %{_datadir}/openstack-helm/openstack-helm-infra %{python3_sitelib}/openstack-plugin/%{SOURCE2} %post loci -%gitPatch %{_datadir}/loci %{python3_sitelib}/openstack-plugin/loci/0001-Added-support-for-openEuler.patch +%gitPatch %{_datadir}/loci %{python3_sitelib}/openstack-plugin/%{SOURCE3} + +%post kolla +%gitPatch %{_datadir}/kolla %{python3_sitelib}/openstack-plugin/%{SOURCE4} %preun nova %gitUnPatch %{python3_sitelib}/nova @@ -94,21 +126,34 @@ install -D -p -m 644 loci/0001-Added-support-for-openEuler.patch %{buildroot}%{p %preun loci %gitUnPatch %{_datadir}/loci -%files -n openstack-priority_vm +%preun kolla +%gitUnPatch %{_datadir}/kolla + +%files priority-vm + +%files openstack-helm-openeuler-support + +%files kolla-isula-support %files nova -%{python3_sitelib}/openstack-plugin/nova/0001-Add-VM-high-low-priority-feature-support.patch +%{python3_sitelib}/openstack-plugin/%{SOURCE0} %files openstack-helm -%{python3_sitelib}/openstack-plugin/openstack-helm/0001-openEuler-support-for-OpenStack-Helm-codebase.patch +%{python3_sitelib}/openstack-plugin/%{SOURCE1} %files openstack-helm-infra -%{python3_sitelib}/openstack-plugin/openstack-helm-infra/0001-openEuler-support-for-OpenStack-Helm-codebase.patch +%{python3_sitelib}/openstack-plugin/%{SOURCE2} %files loci -%{python3_sitelib}/openstack-plugin/loci/0001-Added-support-for-openEuler.patch +%{python3_sitelib}/openstack-plugin/%{SOURCE3} + +%files kolla +%{python3_sitelib}/openstack-plugin/%{SOURCE4} %changelog +* Thu Sep 01 2022 wangxiyuan - 1.0.0-1 +- Add kolla patch and format spec + * Wed Aug 31 2022 Yinuo Deng - Yoga-3 - Added OpenStack-Helm related files -- Gitee