From a27764024b27c61607a7b998c583d2be67896130 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 24 Oct 2022 20:38:27 +0000 Subject: [PATCH] Switch to binary builds Change-Id: I56c6a5371c191f110f24c0dbdeec7c3f8730792c --- charmcraft.yaml | 83 +++++++++++++++++++---- osci.yaml | 1 + requirements.txt | 16 +---- src/tests/bundles/bionic-queens-41.yaml | 5 +- src/tests/bundles/bionic-queens-42.yaml | 5 +- src/tests/bundles/bionic-ussuri-42.yaml | 5 +- src/tests/bundles/focal-ussuri-41.yaml | 4 +- src/tests/bundles/focal-ussuri-42-s3.yaml | 2 +- src/tests/bundles/focal-ussuri-42.yaml | 4 +- src/tests/bundles/focal-wallaby-42.yaml | 4 +- src/wheelhouse.txt | 24 +------ test-requirements.txt | 19 +----- tox.ini | 22 +----- 13 files changed, 92 insertions(+), 102 deletions(-) diff --git a/charmcraft.yaml b/charmcraft.yaml index ac932d0..c091354 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -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] diff --git a/osci.yaml b/osci.yaml index e6127e6..a9684ca 100644 --- a/osci.yaml +++ b/osci.yaml @@ -16,6 +16,7 @@ needs_charm_build: true charm_build_name: trilio-data-mover build_type: charmcraft + charmcraft_channel: 2.0/stable - job: name: focal-ussuri-42_trilio-data-mover parent: func-target diff --git a/requirements.txt b/requirements.txt index a68620f..218e4a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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' diff --git a/src/tests/bundles/bionic-queens-41.yaml b/src/tests/bundles/bionic-queens-41.yaml index 37daad5..2e88534 100644 --- a/src/tests/bundles/bionic-queens-41.yaml +++ b/src/tests/bundles/bionic-queens-41.yaml @@ -132,7 +132,6 @@ applications: keystone: charm: ch:keystone channel: *openstack-charm-channel - series: bionic num_units: 1 options: openstack-origin: *openstack-origin @@ -192,8 +191,8 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm - series: bionic + charm: ../../../trilio-data-mover_ubuntu-18.04-amd64.charm + series: *series options: triliovault-pkg-source: *triliovault-pkg-source trilio-dm-api: diff --git a/src/tests/bundles/bionic-queens-42.yaml b/src/tests/bundles/bionic-queens-42.yaml index c0f8e89..15bbd36 100644 --- a/src/tests/bundles/bionic-queens-42.yaml +++ b/src/tests/bundles/bionic-queens-42.yaml @@ -132,7 +132,6 @@ applications: keystone: charm: ch:keystone channel: *openstack-charm-channel - series: bionic num_units: 1 options: openstack-origin: *openstack-origin @@ -192,8 +191,8 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm - series: bionic + charm: ../../../trilio-data-mover_ubuntu-18.04-amd64.charm + series: *series options: triliovault-pkg-source: *triliovault-pkg-source trilio-dm-api: diff --git a/src/tests/bundles/bionic-ussuri-42.yaml b/src/tests/bundles/bionic-ussuri-42.yaml index 624b079..931566d 100644 --- a/src/tests/bundles/bionic-ussuri-42.yaml +++ b/src/tests/bundles/bionic-ussuri-42.yaml @@ -140,7 +140,6 @@ applications: keystone: charm: ch:keystone channel: *openstack-charm-channel - series: bionic num_units: 1 options: openstack-origin: *openstack-origin @@ -201,8 +200,8 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm - series: bionic + charm: ../../../trilio-data-mover_ubuntu-18.04-amd64.charm + series: *series options: triliovault-pkg-source: *triliovault-pkg-source trilio-dm-api: diff --git a/src/tests/bundles/focal-ussuri-41.yaml b/src/tests/bundles/focal-ussuri-41.yaml index e9236ff..c4dcb0b 100644 --- a/src/tests/bundles/focal-ussuri-41.yaml +++ b/src/tests/bundles/focal-ussuri-41.yaml @@ -254,8 +254,8 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm - series: bionic + charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm + series: *series options: triliovault-pkg-source: *triliovault-pkg-source trilio-dm-api: diff --git a/src/tests/bundles/focal-ussuri-42-s3.yaml b/src/tests/bundles/focal-ussuri-42-s3.yaml index 1131246..d8366ee 100644 --- a/src/tests/bundles/focal-ussuri-42-s3.yaml +++ b/src/tests/bundles/focal-ussuri-42-s3.yaml @@ -267,7 +267,7 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm + charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm series: *series options: triliovault-pkg-source: *triliovault-pkg-source diff --git a/src/tests/bundles/focal-ussuri-42.yaml b/src/tests/bundles/focal-ussuri-42.yaml index 223d24e..7ad2863 100644 --- a/src/tests/bundles/focal-ussuri-42.yaml +++ b/src/tests/bundles/focal-ussuri-42.yaml @@ -254,8 +254,8 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm - series: bionic + charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm + series: *series options: triliovault-pkg-source: *triliovault-pkg-source trilio-dm-api: diff --git a/src/tests/bundles/focal-wallaby-42.yaml b/src/tests/bundles/focal-wallaby-42.yaml index b02152d..eaaebe7 100644 --- a/src/tests/bundles/focal-wallaby-42.yaml +++ b/src/tests/bundles/focal-wallaby-42.yaml @@ -254,8 +254,8 @@ applications: channel: *rabbit-charm-channel num_units: 1 trilio-data-mover: - charm: ../../../trilio-data-mover.charm - series: bionic + charm: ../../../trilio-data-mover_ubuntu-20.04-amd64.charm + series: *series options: triliovault-pkg-source: *triliovault-pkg-source trilio-dm-api: diff --git a/src/wheelhouse.txt b/src/wheelhouse.txt index baa85d8..82c6c9e 100644 --- a/src/wheelhouse.txt +++ b/src/wheelhouse.txt @@ -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://github.com/juju/charm-helpers.git#egg=charmhelpers + diff --git a/test-requirements.txt b/test-requirements.txt index a11a7d0..3f84ab4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 7fe1689..aaedb90 100644 --- a/tox.ini +++ b/tox.ini @@ -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