Switch to binary builds

Change-Id: I56c6a5371c191f110f24c0dbdeec7c3f8730792c
This commit is contained in:
Liam Young 2022-10-24 20:38:27 +00:00
parent 2eb9b5f0ab
commit a27764024b
13 changed files with 92 additions and 102 deletions

View File

@ -3,34 +3,91 @@ type: charm
parts: parts:
charm: charm:
build-packages: build-packages:
- tox
- git - git
- python3-dev - python3-dev
- python3-pip
override-build: | override-build: |
apt-get install ca-certificates -y apt-get install ca-certificates -y
tox -e build-reactive pip3 install --user "tox==3.18"
~/.local/bin/tox -e build-reactive
override-stage: | override-stage: |
echo "Copying charm to staging area: $CHARMCRAFT_STAGE" echo "Copying charm to staging area: $CRAFT_STAGE"
NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds) NAME=$(ls $CRAFT_PART_BUILD/build/builds)
cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/ cp -r $CRAFT_PART_BUILD/build/builds/$NAME/* $CRAFT_STAGE/
override-prime: | override-prime: |
# For some reason, the normal priming chokes on the fact that there's a # For some reason, the normal priming chokes on the fact that there's a
# hooks directory. # 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: bases:
- build-on: - build-on:
- name: ubuntu - name: ubuntu
channel: "20.04" channel: "18.04"
architectures: architectures: [amd64]
- amd64
run-on: run-on:
- name: ubuntu - name: ubuntu
channel: "18.04" channel: "18.04"
architectures: [amd64, s390x, ppc64el, arm64] architectures: [amd64]
- build-on:
- name: ubuntu - name: ubuntu
channel: "20.04" channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64] architectures: [amd64]
run-on:
- name: ubuntu - name: ubuntu
channel: "22.04" channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64] 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 needs_charm_build: true
charm_build_name: trilio-data-mover charm_build_name: trilio-data-mover
build_type: charmcraft build_type: charmcraft
charmcraft_channel: 2.0/stable
- job: - job:
name: focal-ussuri-42_trilio-data-mover name: focal-ussuri-42_trilio-data-mover
parent: func-target parent: func-target

View File

@ -3,21 +3,7 @@
# choices of *requirements.txt files for OpenStack Charms: # choices of *requirements.txt files for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools # 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 git+https://github.com/juju/charm-tools.git
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
charm-tools==2.8.3
simplejson 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: keystone:
charm: ch:keystone charm: ch:keystone
channel: *openstack-charm-channel channel: *openstack-charm-channel
series: bionic
num_units: 1 num_units: 1
options: options:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
@ -192,8 +191,8 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-18.04-amd64.charm
series: bionic series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source
trilio-dm-api: trilio-dm-api:

View File

@ -132,7 +132,6 @@ applications:
keystone: keystone:
charm: ch:keystone charm: ch:keystone
channel: *openstack-charm-channel channel: *openstack-charm-channel
series: bionic
num_units: 1 num_units: 1
options: options:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
@ -192,8 +191,8 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-18.04-amd64.charm
series: bionic series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source
trilio-dm-api: trilio-dm-api:

View File

@ -140,7 +140,6 @@ applications:
keystone: keystone:
charm: ch:keystone charm: ch:keystone
channel: *openstack-charm-channel channel: *openstack-charm-channel
series: bionic
num_units: 1 num_units: 1
options: options:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
@ -201,8 +200,8 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-18.04-amd64.charm
series: bionic series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source
trilio-dm-api: trilio-dm-api:

View File

@ -254,8 +254,8 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm
series: bionic series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source
trilio-dm-api: trilio-dm-api:

View File

@ -267,7 +267,7 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm
series: *series series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source

View File

@ -254,8 +254,8 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm
series: bionic series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source
trilio-dm-api: trilio-dm-api:

View File

@ -254,8 +254,8 @@ applications:
channel: *rabbit-charm-channel channel: *rabbit-charm-channel
num_units: 1 num_units: 1
trilio-data-mover: trilio-data-mover:
charm: ../../../trilio-data-mover.charm charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm
series: bionic series: *series
options: options:
triliovault-pkg-source: *triliovault-pkg-source triliovault-pkg-source: *triliovault-pkg-source
trilio-dm-api: trilio-dm-api:

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==1.4.1
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://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 # 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. 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 setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
stestr>=2.2.0 stestr>=2.2.0
@ -13,25 +12,10 @@ stestr>=2.2.0
# https://github.com/mtreinish/stestr/issues/145 # https://github.com/mtreinish/stestr/issues/145
cliff<3.0.0 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 requests>=2.18.4
charms.reactive charms.reactive
# Newer mock seems to have some syntax which is newer than python3.5 (e.g. mock>=1.2
# f'{something}'
mock>=1.2,<4.0.0; python_version < '3.6'
mock>=1.2; python_version >= '3.6'
nose>=1.3.7 nose>=1.3.7
coverage>=3.6 coverage>=3.6
@ -52,3 +36,4 @@ cryptography<3.4 # vault, keystone-saml-mellon
lxml # keystone-saml-mellon lxml # keystone-saml-mellon
hvac # vault, barbican-vault hvac # vault, barbican-vault
psutil # cinder-lvm psutil # cinder-lvm
pyopenssl<=22.0.0

22
tox.ini
View File

@ -11,18 +11,6 @@ envlist = pep8,py3
sitepackages = False sitepackages = False
# NOTE: Avoid false positives by not skipping missing interpreters. # NOTE: Avoid false positives by not skipping missing interpreters.
skip_missing_interpreters = False 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 # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.18.0 minversion = 3.18.0
@ -31,17 +19,14 @@ minversion = 3.18.0
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0 PYTHONHASHSEED=0
TERM=linux TERM=linux
LAYER_PATH={toxinidir}/layers
INTERFACE_PATH={toxinidir}/interfaces
JUJU_REPOSITORY={toxinidir}/build 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 = install_command =
{toxinidir}/pip.sh install {opts} {packages} {toxinidir}/pip.sh install {opts} {packages}
allowlist_externals = allowlist_externals =
charmcraft charmcraft
bash bash
tox tox
rename.sh
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
@ -50,13 +35,12 @@ basepython = python3
deps = -r{toxinidir}/build-requirements.txt deps = -r{toxinidir}/build-requirements.txt
commands = commands =
charmcraft clean charmcraft clean
charmcraft -v build charmcraft -v pack
{toxinidir}/rename.sh
[testenv:build-reactive] [testenv:build-reactive]
basepython = python3 basepython = python3
commands = 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] [testenv:add-build-lock-file]
basepython = python3 basepython = python3