Switch to binary builds

Change-Id: I7cce4e9c1f7764dd877d9118f3061fa0116a2f23
This commit is contained in:
Liam Young 2022-10-24 20:36:36 +00:00
parent 7904793f1b
commit afaf44089b
13 changed files with 89 additions and 99 deletions

View File

@ -3,34 +3,91 @@ type: charm
parts:
charm:
build-packages:
- tox
- git
- python3-dev
- python3-pip
override-build: |
apt-get install ca-certificates -y
tox -e build-reactive
pip3 install --user "tox==3.18"
~/.local/bin/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
channel: "18.04"
architectures: [amd64]
run-on:
- name: ubuntu
channel: "18.04"
architectures: [amd64, s390x, ppc64el, arm64]
architectures: [amd64]
- build-on:
- name: ubuntu
channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64]
architectures: [amd64]
run-on:
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
channel: "20.04"
architectures: [amd64]
- build-on:
- name: ubuntu
channel: "18.04"
architectures: [arm64]
run-on:
- name: ubuntu
channel: "18.04"
architectures: [arm64]
- build-on:
- name: ubuntu
channel: "20.04"
architectures: [arm64]
run-on:
- name: ubuntu
channel: "20.04"
architectures: [arm64]
- build-on:
- name: ubuntu
channel: "18.04"
architectures: [ppc64el]
run-on:
- name: ubuntu
channel: "18.04"
architectures: [ppc64el]
- build-on:
- name: ubuntu
channel: "20.04"
architectures: [ppc64el]
run-on:
- name: ubuntu
channel: "20.04"
architectures: [ppc64el]
- build-on:
- name: ubuntu
channel: "18.04"
architectures: [s390x]
run-on:
- name: ubuntu
channel: "18.04"
architectures: [s390x]
- build-on:
- name: ubuntu
channel: "20.04"
architectures: [s390x]
run-on:
- name: ubuntu
channel: "20.04"
architectures: [s390x]

View File

@ -16,6 +16,7 @@
needs_charm_build: true
charm_build_name: trilio-wlm
build_type: charmcraft
charmcraft_channel: 2.0/stable
- job:
name: focal-ussuri-42_trilio-wlm
parent: func-target

View File

@ -3,21 +3,7 @@
# 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
# Build requirements
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
charm-tools==2.8.3
git+https://github.com/juju/charm-tools.git
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

@ -132,7 +132,6 @@ applications:
keystone:
charm: ch:keystone
channel: *openstack-charm-channel
series: bionic
num_units: 1
options:
openstack-origin: *openstack-origin
@ -209,8 +208,8 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
series: bionic
charm: ../../../trilio-wlm_ubuntu-18.04-amd64.charm
series: *series
num_units: 1
options:
openstack-origin: *trilio-openstack-origin

View File

@ -132,7 +132,6 @@ applications:
keystone:
charm: ch:keystone
channel: *openstack-charm-channel
series: bionic
num_units: 1
options:
openstack-origin: *openstack-origin
@ -209,8 +208,8 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
series: bionic
charm: ../../../trilio-wlm_ubuntu-18.04-amd64.charm
series: *series
num_units: 1
options:
openstack-origin: *trilio-openstack-origin

View File

@ -140,7 +140,6 @@ applications:
keystone:
charm: ch:keystone
channel: *openstack-charm-channel
series: bionic
num_units: 1
options:
openstack-origin: *openstack-origin
@ -218,8 +217,8 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
series: bionic
charm: ../../../trilio-wlm_ubuntu-18.04-amd64.charm
series: *series
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -271,7 +271,7 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
charm: ../../../trilio-wlm_ubuntu-20.04-amd64.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -285,7 +285,7 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
charm: ../../../trilio-wlm_ubuntu-20.04-amd64.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -271,7 +271,7 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
charm: ../../../trilio-wlm_ubuntu-20.04-amd64.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -271,7 +271,7 @@ applications:
options:
triliovault-pkg-source: *triliovault-pkg-source
trilio-wlm:
charm: ../../../trilio-wlm.charm
charm: ../../../trilio-wlm_ubuntu-20.04-amd64.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -1,24 +1,4 @@
# Temporary pins to reflects existing charm builds. Need updating when
# channels and tracks are setup.
# flit_core tactival workaround to ensure the wheel is not present irrespective of
# the build env as the flit_core wheel causes a pip failure.
flit_core;python_version >= '4.0'
pyaml==20.4.0
PyYAML==5.2
setuptools==41.6.0
netifaces==0.11.0
six==1.16.0
pbr==5.6.0
psutil==5.8.0
dnspython==1.16.0
pip==18.1
wheel==0.33.6
Tempita==0.4
Jinja2==2.10.1
charms.reactive
netaddr==0.7.19
setuptools_scm==1.17.0
MarkupSafe==1.1.1
git+https://github.com/juju/charm-helpers.git@d404354d1d350e66dcb43bdb5a72c504583497f9#egg=charmhelpers
git+https://opendev.org/openstack/charms.openstack.git#egg=charms.openstack
git+https://github.com/juju/charm-helpers.git#egg=charmhelpers

View File

@ -4,7 +4,6 @@
# https://github.com/openstack-charmers/release-tools
#
pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here.
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
stestr>=2.2.0
@ -13,25 +12,10 @@ stestr>=2.2.0
# https://github.com/mtreinish/stestr/issues/145
cliff<3.0.0
# Dependencies of stestr. Newer versions use keywords that didn't exist in
# python 3.5 yet (e.g. "ModuleNotFoundError")
importlib-metadata<3.0.0; python_version < '3.6'
importlib-resources<3.0.0; python_version < '3.6'
# Some Zuul nodes sometimes pull newer versions of these dependencies which
# dropped support for python 3.5:
osprofiler<2.7.0;python_version<'3.6'
stevedore<1.31.0;python_version<'3.6'
debtcollector<1.22.0;python_version<'3.6'
oslo.utils<=3.41.0;python_version<'3.6'
requests>=2.18.4
charms.reactive
# Newer mock seems to have some syntax which is newer than python3.5 (e.g.
# f'{something}'
mock>=1.2,<4.0.0; python_version < '3.6'
mock>=1.2; python_version >= '3.6'
mock>=1.2
nose>=1.3.7
coverage>=3.6
@ -52,3 +36,4 @@ cryptography<3.4 # vault, keystone-saml-mellon
lxml # keystone-saml-mellon
hvac # vault, barbican-vault
psutil # cinder-lvm
pyopenssl<=22.0.0

22
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
@ -31,17 +19,14 @@ minversion = 3.18.0
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
TERM=linux
LAYER_PATH={toxinidir}/layers
INTERFACE_PATH={toxinidir}/interfaces
JUJU_REPOSITORY={toxinidir}/build
passenv = no_proxy http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY
passenv = no_proxy http_proxy https_proxy JUJU_REPOSITORY
install_command =
{toxinidir}/pip.sh install {opts} {packages}
allowlist_externals =
charmcraft
bash
tox
rename.sh
deps =
-r{toxinidir}/requirements.txt
@ -50,13 +35,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