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.

Update charm to consume the 1.0/stable track for the snap.

Bundles:
- Drop the renaming of the charm artifact and reference the
  series specific charm artifact in the bundles instead.
- Fix gss mirror list, jammy retrofit-series and use 8.0/stable
  for MySQL.

Closes-Bug: #1981334
Closes-Bug: #1970653
Closes-Bug: #1975491
Change-Id: I8c924038ee1c5ff258c41a44ad14ebc86a107b1b
This commit is contained in:
Frode Nordahl
2022-08-10 16:44:55 +02:00
parent 7e80dce5d3
commit 2fb0cf1250
12 changed files with 33 additions and 220 deletions

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
.tox
.stestr
interfaces
layers
*__pycache__*
*.pyc
build

View File

@ -11,24 +11,29 @@ parts:
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 src
ln -sf ../hooks/start src/charm.py
bases:
- build-on:
- name: ubuntu
channel: "20.04"
architectures:
- amd64
architectures: [amd64, s390x, ppc64el, arm64]
run-on:
- name: ubuntu
channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64]
- build-on:
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
run-on:
- name: ubuntu
channel: "22.04"

View File

@ -8,3 +8,4 @@
needs_charm_build: true
charm_build_name: octavia-diskimage-retrofit
build_type: charmcraft
charmcraft_channel: 2.0/stable

View File

@ -1,13 +0,0 @@
#!/bin/bash
charm=$(grep "charm_build_name" osci.yaml | awk '{print $2}')
echo "renaming ${charm}_*.charm to ${charm}.charm"
echo -n "pwd: "
pwd
ls -al
echo "Removing bad downloaded charm maybe?"
if [[ -e "${charm}.charm" ]];
then
rm "${charm}.charm"
fi
echo "Renaming charm here."
mv ${charm}_*.charm ${charm}.charm

View File

@ -3,28 +3,6 @@
# choices of *requirements.txt files for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools
#
# NOTE(lourot): This might look like a duplication of test-requirements.txt but
# some tox targets use only test-requirements.txt whereas charm-build uses only
# requirements.txt
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
# NOTE: newer versions of cryptography require a Rust compiler to build,
# see
# * https://github.com/openstack-charmers/zaza/issues/421
# * https://mail.python.org/pipermail/cryptography-dev/2021-January/001003.html
#
cryptography<3.4
# Build requirements
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
git+https://github.com/juju/charm-tools#egg=charm-tools
simplejson
# Newer versions use keywords that didn't exist in python 3.5 yet (e.g.
# "ModuleNotFoundError")
# NOTE(lourot): This might look like a duplication of test-requirements.txt but
# some tox targets use only test-requirements.txt whereas charm-build uses only
# requirements.txt
importlib-metadata<3.0.0; python_version < '3.6'
importlib-resources<3.0.0; python_version < '3.6'

View File

@ -9,11 +9,10 @@ options:
basic:
use_venv: True
include_system_packages: False
packages: [ 'libffi-dev', 'libssl-dev' ]
snap:
octavia-diskimage-retrofit:
channel: beta
devmode: True
channel: 1.0/stable
classic: true
comment: |
Using devmode pending resolution of snapd fuse-support issue
https://github.com/openstack-charmers/octavia-diskimage-retrofit/issues/6

View File

@ -30,14 +30,14 @@ applications:
- '0'
- '1'
- '2'
channel: 8.0.19/edge
channel: 8.0/edge
keystone-mysql-router:
charm: ch:mysql-router
channel: 8.0.19/edge
channel: 8.0/edge
glance-mysql-router:
charm: ch:mysql-router
channel: 8.0.19/edge
channel: 8.0/edge
keystone:
charm: ch:keystone
@ -68,7 +68,7 @@ applications:
path: 'streams/v1/index.sjson',
max: 1,
item_filters: [
'release~(xenial|bionic|focal)',
'release~(focal)',
'arch~(x86_64|amd64)',
'ftype~(disk1.img|disk.img)'
]
@ -101,7 +101,7 @@ applications:
channel: yoga/edge
octavia-diskimage-retrofit:
charm: ../../../octavia-diskimage-retrofit.charm
charm: ../../../octavia-diskimage-retrofit_ubuntu-20.04-amd64.charm
options:
retrofit-series: focal

View File

@ -30,14 +30,14 @@ applications:
- '0'
- '1'
- '2'
channel: 8.0.19/edge
channel: 8.0/edge
keystone-mysql-router:
charm: ch:mysql-router
channel: 8.0.19/edge
channel: 8.0/edge
glance-mysql-router:
charm: ch:mysql-router
channel: 8.0.19/edge
channel: 8.0/edge
keystone:
charm: ch:keystone
@ -68,7 +68,7 @@ applications:
path: 'streams/v1/index.sjson',
max: 1,
item_filters: [
'release~(xenial|bionic|focal)',
'release~(focal)',
'arch~(x86_64|amd64)',
'ftype~(disk1.img|disk.img)'
]
@ -101,7 +101,7 @@ applications:
channel: yoga/edge
octavia-diskimage-retrofit:
charm: ../../../octavia-diskimage-retrofit.charm
charm: ../../../octavia-diskimage-retrofit_ubuntu-20.04-amd64.charm
options:
retrofit-series: focal

View File

@ -1,130 +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':
applications:
mysql-innodb-cluster:
constraints: mem=3072M
charm: ch:mysql-innodb-cluster
num_units: 3
options:
source: *openstack-origin
to:
- '0'
- '1'
- '2'
channel: 8.0.19/edge
keystone-mysql-router:
charm: ch:mysql-router
channel: 8.0.19/edge
glance-mysql-router:
charm: ch:mysql-router
channel: 8.0.19/edge
keystone:
charm: ch:keystone
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '3'
channel: yoga/edge
glance:
charm: ch:glance
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '4'
channel: yoga/edge
glance-simplestreams-sync:
charm: ch:glance-simplestreams-sync
num_units: 1
options:
source: ppa:simplestreams-dev/trunk
use_swift: False
mirror_list: "[{url: 'http://cloud-images.ubuntu.com/daily/',
name_prefix: 'ubuntu:released',
path: 'streams/v1/index.sjson',
max: 1,
item_filters: [
'release~(xenial|bionic|focal)',
'arch~(x86_64|amd64)',
'ftype~(disk1.img|disk.img)'
]
}]"
# NOTE(coreycb): Drop minimal mirror until https://pad.lv/1933966
# is fixed.
#
# mirror_list: "[{url: 'http://cloud-images.ubuntu.com/daily/',
# name_prefix: 'ubuntu:released',
# path: 'streams/v1/index.sjson',
# max: 1,
# item_filters: [
# 'release~(xenial|bionic|focal)',
# 'arch~(x86_64|amd64)',
# 'ftype~(disk1.img|disk.img)'
# ]
# },
# {url: 'http://cloud-images.ubuntu.com/minimal/daily/',
# name_prefix: 'ubuntu:released',
# path: 'streams/v1/index.sjson',
# max: 1,
# item_filters: [
# 'release~(xenial|bionic|focal)',
# 'arch~(x86_64|amd64)',
# 'ftype~(disk1.img|disk.img)'
# ]
# }]"
to:
- '5'
channel: yoga/edge
octavia-diskimage-retrofit:
charm: ../../../octavia-diskimage-retrofit.charm
options:
retrofit-series: focal
relations:
- - 'glance-simplestreams-sync:juju-info'
- 'octavia-diskimage-retrofit:juju-info'
- - 'keystone-mysql-router:shared-db'
- 'keystone:shared-db'
- - 'keystone-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'glance-mysql-router:shared-db'
- 'glance:shared-db'
- - 'glance-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'keystone:identity-service'
- 'glance:identity-service'
- - 'keystone:identity-service'
- 'glance-simplestreams-sync:identity-service'
- - 'keystone:identity-credentials'
- 'octavia-diskimage-retrofit:identity-credentials'

View File

@ -68,7 +68,7 @@ applications:
path: 'streams/v1/index.sjson',
max: 1,
item_filters: [
'release~(xenial|bionic|focal)',
'release~(focal|jammy)',
'arch~(x86_64|amd64)',
'ftype~(disk1.img|disk.img)'
]
@ -101,9 +101,9 @@ applications:
channel: yoga/edge
octavia-diskimage-retrofit:
charm: ../../../octavia-diskimage-retrofit.charm
charm: ../../../octavia-diskimage-retrofit_ubuntu-22.04-amd64.charm
options:
retrofit-series: focal
retrofit-series: jammy
relations:

View File

@ -1,21 +1,6 @@
# Charm dependencies
keystoneauth1
python-glanceclient
poetry-core
# Pin pyrsistent<0.18.0 as later versions require setuptools >= 42.0.0
pyrsistent<0.18.0
# python-zipp 2.x introduces a requirement for setuptools 42.x which is not available.
# resolve conflict:
# layer-basic requires setuptools<42, zipp>=2.0.0 requires setuptools>42
# LP: #1862186
zipp < 2.0.0
# cryptography 3.4 introduces a requirement for rust code in the module. As it has to be compiled
# on the machine during install, this breaks installs. Instead pin to <3.4 until a solution can be
# found that doesn't require compiling on the target machine.
# LP: #1915171
cryptography<3.4
setuptools < 50.0
git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack

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 -o {toxinidir}/build/builds src {posargs}
[testenv:add-build-lock-file]
basepython = python3