Build separately for each supported series and use binary builds

Charms for OpenStack Yoga supports both Ubuntu Focal and Jammy
which means Python 3.8 and Python 3.10.  Managing dependencies
across those two versions is non-trivial and we need to build
the charm on the series the charm is supposed to support.

Switch to using a binary build which allows pip's dependency
resolution to work.

This patch also drops the impish bundle and unused overlay
bundles.

Change-Id: I85d45fd390eccfef2fbdcd9de96b7b7cf01483f4
This commit is contained in:
Corey Bryant 2022-10-11 17:20:38 +00:00
parent e7fd6815c9
commit 123e8e06f6
19 changed files with 49 additions and 466 deletions

View File

@ -6,28 +6,52 @@ parts:
- tox
- git
- python3-dev
- libffi-dev
- libssl-dev
- rustc
- cargo
build-environment:
- CHARM_INTERFACES_DIR: /root/project/interfaces/
- CHARM_LAYERS_DIR: /root/project/layers/
- MAKEFLAGS: -j$(nproc)
override-build: |
apt-get install ca-certificates -y
tox -e build-reactive
override-stage: |
echo "Copying charm to staging area: $CHARMCRAFT_STAGE"
NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds)
cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/
echo "Copying charm to staging area: $CRAFT_STAGE"
NAME=$(ls $CRAFT_PART_BUILD/build/builds)
cp -r $CRAFT_PART_BUILD/build/builds/$NAME/* $CRAFT_STAGE/
override-prime: |
# For some reason, the normal priming chokes on the fact that there's a
# hooks directory.
cp -r $CHARMCRAFT_STAGE/* .
cp -r $CRAFT_STAGE/* .
# Charmcraft looks for this specific entry point.
mkdir -p src
touch src/charm.py
chmod +x src/charm.py
bases:
- build-on:
- name: ubuntu
channel: "20.04"
architectures:
- amd64
run-on:
- name: ubuntu
channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64]
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
- name: ubuntu
channel: "20.04"
architectures: [amd64]
- name: ubuntu
channel: "20.04"
architectures: [arm64]
- name: ubuntu
channel: "20.04"
architectures: [ppc64el]
- name: ubuntu
channel: "20.04"
architectures: [s390x]
- name: ubuntu
channel: "22.04"
architectures: [amd64]
- name: ubuntu
channel: "22.04"
architectures: [arm64]
- name: ubuntu
channel: "22.04"
architectures: [ppc64el]
- name: ubuntu
channel: "22.04"
architectures: [s390x]

View File

@ -8,3 +8,4 @@
needs_charm_build: true
charm_build_name: masakari-monitors
build_type: charmcraft
charmcraft_channel: 2.0/stable

View File

@ -1,7 +1,7 @@
variables:
openstack-origin: &openstack-origin cloud:focal-xena
local_overlay_enabled: False
local_overlay_enabled: True
series: focal
@ -220,7 +220,7 @@ applications:
channel: yoga/edge
masakari-monitors:
charm: ../../../masakari-monitors.charm
charm: ../../../masakari-monitors_ubuntu-20.04-amd64.charm
hacluster:
charm: ch:hacluster

View File

@ -1,7 +1,7 @@
variables:
openstack-origin: &openstack-origin cloud:focal-yoga
local_overlay_enabled: False
local_overlay_enabled: True
series: focal
@ -220,7 +220,7 @@ applications:
channel: yoga/edge
masakari-monitors:
charm: ../../../masakari-monitors.charm
charm: ../../../masakari-monitors_ubuntu-20.04-amd64.charm
hacluster:
charm: ch:hacluster

View File

@ -1,417 +0,0 @@
variables:
openstack-origin: &openstack-origin distro
local_overlay_enabled: False
series: impish
comment:
- 'machines section to decide order of deployment. database sooner = faster'
machines:
'0':
constraints: mem=3072M
'1':
constraints: mem=3072M
'2':
constraints: mem=3072M
'3':
'4':
'5':
'6':
'7':
'8':
constraints: mem=4096M
'9':
constraints: mem=4096M
'10':
constraints: mem=4096M
'11':
'12':
'13':
'14':
'15':
'16':
'17':
'18':
'19':
'20':
'21':
'22':
'23':
applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
cinder-mysql-router:
charm: ch:mysql-router
channel: latest/edge
neutron-api-mysql-router:
charm: ch:mysql-router
channel: latest/edge
glance-mysql-router:
charm: ch:mysql-router
channel: latest/edge
nova-cloud-controller-mysql-router:
charm: ch:mysql-router
channel: latest/edge
masakari-mysql-router:
charm: ch:mysql-router
channel: latest/edge
vault-mysql-router:
charm: ch:mysql-router
channel: latest/edge
placement-mysql-router:
charm: ch:mysql-router
channel: latest/edge
mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
num_units: 3
options:
source: *openstack-origin
to:
- '0'
- '1'
- '2'
channel: latest/edge
glance:
charm: ch:glance
num_units: 1
options:
openstack-origin: *openstack-origin
worker-multiplier: 0.25
to:
- '3'
channel: yoga/edge
cinder:
charm: ch:cinder
num_units: 1
options:
openstack-origin: *openstack-origin
block-device: "None"
glance-api-version: 2
to:
- '4'
channel: yoga/edge
keystone:
charm: ch:keystone
num_units: 1
options:
admin-password: openstack
openstack-origin: *openstack-origin
worker-multiplier: 0.25
to:
- '5'
channel: yoga/edge
neutron-api:
charm: ch:neutron-api
num_units: 1
options:
manage-neutron-plugin-legacy-mode: true
flat-network-providers: physnet1
neutron-security-groups: true
openstack-origin: *openstack-origin
worker-multiplier: 0.25
to:
- '6'
channel: yoga/edge
neutron-gateway:
charm: ch:neutron-gateway
num_units: 1
options:
bridge-mappings: physnet1:br-ex
openstack-origin: *openstack-origin
worker-multiplier: 0.25
to:
- '7'
channel: yoga/edge
neutron-openvswitch:
charm: ch:neutron-openvswitch
num_units: 0
channel: yoga/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
num_units: 1
options:
network-manager: Neutron
openstack-origin: *openstack-origin
worker-multiplier: 0.25
debug: true
to:
- '23'
channel: yoga/edge
nova-compute:
charm: ch:nova-compute
num_units: 3
constraints: mem=4G
options:
config-flags: default_ephemeral_format=ext4
enable-live-migration: true
enable-resize: true
migration-auth-type: ssh
openstack-origin: *openstack-origin
debug: true
cpu-model: kvm64
cpu-mode: custom
# Allow for more retries when testing ontop of openstack
config-flags: block_device_allocate_retries=120
to:
- '8'
- '9'
- '10'
channel: yoga/edge
rabbitmq-server:
charm: ch:rabbitmq-server
num_units: 1
to:
- '11'
channel: latest/edge
masakari:
charm: ch:masakari
num_units: 3
options:
openstack-origin: *openstack-origin
to:
- '12'
- '13'
- '14'
channel: yoga/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
source: *openstack-origin
expected-osd-count: 3
to:
- '15'
- '16'
- '17'
channel: quincy/edge
ceph-osd:
charm: ch:ceph-osd
constraints: mem=1G
num_units: 3
options:
source: *openstack-origin
storage:
osd-devices: cinder,40G
to:
- '18'
- '19'
- '20'
channel: quincy/edge
cinder-ceph:
charm: ch:cinder-ceph
channel: yoga/edge
masakari-monitors:
charm: ../../../masakari-monitors.charm
hacluster:
charm: ch:hacluster
options:
corosync_transport: unicast
cluster_count: 3
channel: latest/edge
pacemaker-remote:
charm: ch:pacemaker-remote
options:
enable-stonith: False
enable-resources: False
vault:
num_units: 1
charm: ch:vault
to:
- '21'
channel: latest/edge
placement:
charm: ch:placement
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '22'
channel: yoga/edge
relations:
- - 'nova-compute:amqp'
- 'rabbitmq-server:amqp'
- - 'neutron-gateway:amqp'
- 'rabbitmq-server:amqp'
- - 'neutron-gateway:amqp-nova'
- 'rabbitmq-server:amqp'
- - 'keystone:shared-db'
- 'keystone-mysql-router:shared-db'
- - 'keystone-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'cinder:identity-service'
- 'keystone:identity-service'
- - 'nova-cloud-controller:identity-service'
- 'keystone:identity-service'
- - 'glance:identity-service'
- 'keystone:identity-service'
- - 'neutron-api:identity-service'
- 'keystone:identity-service'
- - 'neutron-openvswitch:neutron-plugin-api'
- 'neutron-api:neutron-plugin-api'
- - 'cinder:shared-db'
- 'cinder-mysql-router:shared-db'
- - 'cinder-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'neutron-api:shared-db'
- 'neutron-api-mysql-router:shared-db'
- - 'neutron-api-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'cinder:amqp'
- 'rabbitmq-server:amqp'
- - 'neutron-api:amqp'
- 'rabbitmq-server:amqp'
- - 'neutron-gateway:neutron-plugin-api'
- 'neutron-api:neutron-plugin-api'
- - 'glance:shared-db'
- 'glance-mysql-router:shared-db'
- - 'glance-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'glance:amqp'
- 'rabbitmq-server:amqp'
- - 'nova-cloud-controller:image-service'
- 'glance:image-service'
- - 'nova-compute:image-service'
- 'glance:image-service'
- - 'nova-cloud-controller:amqp'
- 'rabbitmq-server:amqp'
- - 'nova-cloud-controller:quantum-network-service'
- 'neutron-gateway:quantum-network-service'
- - 'nova-compute:neutron-plugin'
- 'neutron-openvswitch:neutron-plugin'
- - 'neutron-openvswitch:amqp'
- 'rabbitmq-server:amqp'
- - 'nova-cloud-controller:shared-db'
- 'nova-cloud-controller-mysql-router:shared-db'
- - 'nova-cloud-controller-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'nova-cloud-controller:neutron-api'
- 'neutron-api:neutron-api'
- - 'nova-cloud-controller:cloud-compute'
- 'nova-compute:cloud-compute'
- - 'masakari:shared-db'
- 'masakari-mysql-router:shared-db'
- - 'masakari-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'masakari:amqp'
- 'rabbitmq-server:amqp'
- - 'masakari:identity-service'
- 'keystone:identity-service'
- - 'glance:ceph'
- 'ceph-mon:client'
- - 'ceph-mon:osd'
- 'ceph-osd:mon'
- - 'cinder:storage-backend'
- 'cinder-ceph:storage-backend'
- - 'cinder-ceph:ceph'
- 'ceph-mon:client'
- - 'cinder-ceph:ceph-access'
- 'nova-compute:ceph-access'
- - 'nova-compute:juju-info'
- 'masakari-monitors:container'
- - 'masakari:ha'
- 'hacluster:ha'
- - 'keystone:identity-credentials'
- 'masakari-monitors:identity-credentials'
- - 'nova-compute:juju-info'
- 'pacemaker-remote:juju-info'
- - 'hacluster:pacemaker-remote'
- 'pacemaker-remote:pacemaker-remote'
- - 'vault:shared-db'
- 'vault-mysql-router:shared-db'
- - 'vault-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'vault:certificates'
- 'keystone:certificates'
- - 'vault:certificates'
- 'neutron-api:certificates'
- - 'vault:certificates'
- 'cinder:certificates'
- - 'vault:certificates'
- 'glance:certificates'
- - 'vault:certificates'
- 'nova-cloud-controller:certificates'
- - 'vault:certificates'
- 'masakari:certificates'
- - 'placement:shared-db'
- 'placement-mysql-router:shared-db'
- - 'placement-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'placement:identity-service'
- 'keystone:identity-service'
- - 'placement:placement'
- 'nova-cloud-controller:placement'
- - 'vault:certificates'
- 'placement:certificates'

View File

@ -1,7 +1,7 @@
variables:
openstack-origin: &openstack-origin distro
local_overlay_enabled: False
local_overlay_enabled: True
series: jammy
@ -220,7 +220,7 @@ applications:
channel: yoga/edge
masakari-monitors:
charm: ../../../masakari-monitors.charm
charm: ../../../masakari-monitors_ubuntu-22.04-amd64.charm
hacluster:
charm: ch:hacluster

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

View File

@ -1 +0,0 @@
bionic-rocky.yaml.j2

18
tox.ini
View File

@ -11,18 +11,6 @@ envlist = pep8,py3
sitepackages = False
# NOTE: Avoid false positives by not skipping missing interpreters.
skip_missing_interpreters = False
# NOTES:
# * We avoid the new dependency resolver by pinning pip < 20.3, see
# https://github.com/pypa/pip/issues/9187
# * Pinning dependencies requires tox >= 3.2.0, see
# https://tox.readthedocs.io/en/latest/config.html#conf-requires
# * It is also necessary to pin virtualenv as a newer virtualenv would still
# lead to fetching the latest pip in the func* tox targets, see
# https://stackoverflow.com/a/38133283
requires =
pip < 20.3
virtualenv < 20.0
setuptools<50.0.0
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.18.0
@ -41,7 +29,6 @@ allowlist_externals =
charmcraft
bash
tox
rename.sh
deps =
-r{toxinidir}/requirements.txt
@ -50,13 +37,12 @@ basepython = python3
deps = -r{toxinidir}/build-requirements.txt
commands =
charmcraft clean
charmcraft -v build
{toxinidir}/rename.sh
charmcraft -v pack
[testenv:build-reactive]
basepython = python3
commands =
charm-build --log-level DEBUG --use-lock-file-branches -o {toxinidir}/build/builds src {posargs}
charm-build --log-level DEBUG --use-lock-file-branches --binary-wheels-from-source -o {toxinidir}/build/builds src {posargs}
[testenv:add-build-lock-file]
basepython = python3