Convert to binary reactive charm (source charm fails to install)

Due to new install dependencies for urllib3, this charm has been
converted to a binary charm so that the build dependencies are resolved
at charm build, rather than charm install.

Note: the 23.04 binary charm build fails due to missing support in
charmcraft [1], but this should be addressed soon.

[1] https://github.com/canonical/charmcraft/issues/1104

Closes-Bug: #2019540
Change-Id: I0834ddf7d63bf7f7d59a122bc07f007abffb5f3f
This commit is contained in:
Alex Kavanagh 2023-05-23 15:44:35 +01:00
parent bd6cb347c5
commit 3fc51fadd8
6 changed files with 91 additions and 21 deletions

View File

@ -4,6 +4,9 @@ parts:
charm:
source: src/
plugin: reactive
reactive-charm-build-arguments:
- --binary-wheels-from-source
- --verbose
build-packages:
- libpython3-dev
build-snaps:
@ -21,10 +24,91 @@ bases:
run-on:
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
architectures:
- amd64
- name: ubuntu
channel: "22.10"
architectures: [amd64, s390x, ppc64el, arm64]
architectures:
- amd64
- build-on:
- name: ubuntu
channel: "22.04"
architectures:
- s390x
run-on:
- name: ubuntu
channel: "22.04"
architectures:
- s390x
- name: ubuntu
channel: "22.10"
architectures:
- s390x
- build-on:
- name: ubuntu
channel: "22.04"
architectures:
- ppc64el
run-on:
- name: ubuntu
channel: "22.04"
architectures:
- ppc64el
- name: ubuntu
channel: "22.10"
architectures:
- ppc64el
- build-on:
- name: ubuntu
channel: "22.04"
architectures:
- arm64
run-on:
- name: ubuntu
channel: "22.04"
architectures:
- arm64
- name: ubuntu
channel: "22.10"
architectures:
- arm64
- build-on:
- name: ubuntu
channel: "23.04"
architectures: [amd64, s390x, ppc64el, arm64]
architectures:
- amd64
run-on:
- name: ubuntu
channel: "23.04"
architectures:
- amd64
- build-on:
- name: ubuntu
channel: "23.04"
architectures:
- s390x
run-on:
- name: ubuntu
channel: "23.04"
architectures:
- s390x
- build-on:
- name: ubuntu
channel: "23.04"
architectures:
- ppc64el
run-on:
- name: ubuntu
channel: "23.04"
architectures:
- ppc64el
- build-on:
- name: ubuntu
channel: "23.04"
architectures:
- arm64
run-on:
- name: ubuntu
channel: "23.04"
architectures:
- arm64

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

@ -44,7 +44,7 @@ applications:
source: *openstack-origin
channel: latest/edge
neutron-api-plugin-ovn:
charm: ../../../neutron-api-plugin-ovn.charm
charm: ../../../neutron-api-plugin-ovn_ubuntu-22.04-amd64_ubuntu-22.10-amd64.charm
hacluster-neutron-api:
charm: ch:hacluster
channel: latest/edge

View File

@ -44,7 +44,7 @@ applications:
source: *openstack-origin
channel: latest/edge
neutron-api-plugin-ovn:
charm: ../../../neutron-api-plugin-ovn.charm
charm: ../../../neutron-api-plugin-ovn_ubuntu-22.04-amd64_ubuntu-22.10-amd64.charm
hacluster-neutron-api:
charm: ch:hacluster
channel: latest/edge

View File

@ -44,7 +44,7 @@ applications:
source: *openstack-origin
channel: latest/edge
neutron-api-plugin-ovn:
charm: ../../../neutron-api-plugin-ovn.charm
charm: ../../../neutron-api-plugin-ovn_ubuntu-23.04-amd64.charm
hacluster-neutron-api:
charm: ch:hacluster
channel: latest/edge

View File

@ -33,12 +33,12 @@ allowlist_externals =
charmcraft
bash
tox
{toxinidir}/rename.sh
deps =
-r{toxinidir}/requirements.txt
[testenv:build]
basepython = python3
deps =
# charmcraft clean is done to ensure that
# `tox -e build` always performs a clean, repeatable build.
# For faster rebuilds during development,
@ -46,7 +46,6 @@ basepython = python3
commands =
charmcraft clean
charmcraft -v pack
{toxinidir}/rename.sh
charmcraft clean
[testenv:build-reactive]