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 9ca792a..918fc27 100644 --- a/osci.yaml +++ b/osci.yaml @@ -15,6 +15,7 @@ needs_charm_build: true charm_build_name: trilio-horizon-plugin build_type: charmcraft + charmcraft_channel: 2.0/stable - job: name: focal-ussuri-42_trilio-horizon 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 283d3ba..76cadbd 100644 --- a/src/tests/bundles/bionic-queens-41.yaml +++ b/src/tests/bundles/bionic-queens-41.yaml @@ -203,7 +203,7 @@ applications: openstack-origin: *trilio-openstack-origin triliovault-pkg-source: *triliovault-pkg-source trilio-horizon-plugin: - charm: ../../../trilio-horizon-plugin.charm + charm: ../../../trilio-horizon-plugin_ubuntu-18.04-amd64.charm options: triliovault-pkg-source: *triliovault-pkg-source trilio-wlm: diff --git a/src/tests/bundles/bionic-queens-42.yaml b/src/tests/bundles/bionic-queens-42.yaml index f3d0035..21e427c 100644 --- a/src/tests/bundles/bionic-queens-42.yaml +++ b/src/tests/bundles/bionic-queens-42.yaml @@ -203,7 +203,7 @@ applications: openstack-origin: *trilio-openstack-origin triliovault-pkg-source: *triliovault-pkg-source trilio-horizon-plugin: - charm: ../../../trilio-horizon-plugin.charm + charm: ../../../trilio-horizon-plugin_ubuntu-18.04-amd64.charm options: triliovault-pkg-source: *triliovault-pkg-source trilio-wlm: diff --git a/src/tests/bundles/bionic-ussuri-42.yaml b/src/tests/bundles/bionic-ussuri-42.yaml index 0fbd427..a009fc4 100644 --- a/src/tests/bundles/bionic-ussuri-42.yaml +++ b/src/tests/bundles/bionic-ussuri-42.yaml @@ -212,7 +212,7 @@ applications: openstack-origin: *openstack-origin triliovault-pkg-source: *triliovault-pkg-source trilio-horizon-plugin: - charm: ../../../trilio-horizon-plugin.charm + charm: ../../../trilio-horizon-plugin_ubuntu-18.04-amd64.charm options: triliovault-pkg-source: *triliovault-pkg-source trilio-wlm: diff --git a/src/tests/bundles/focal-ussuri-41.yaml b/src/tests/bundles/focal-ussuri-41.yaml index ab62094..8aa1551 100644 --- a/src/tests/bundles/focal-ussuri-41.yaml +++ b/src/tests/bundles/focal-ussuri-41.yaml @@ -266,7 +266,7 @@ applications: openstack-origin: *openstack-origin triliovault-pkg-source: *triliovault-pkg-source trilio-horizon-plugin: - charm: ../../../trilio-horizon-plugin.charm + charm: ../../../trilio-horizon-plugin_ubuntu-20.04-amd64.charm options: triliovault-pkg-source: *triliovault-pkg-source trilio-wlm: diff --git a/src/tests/bundles/focal-ussuri-42.yaml b/src/tests/bundles/focal-ussuri-42.yaml index d731153..ea61e99 100644 --- a/src/tests/bundles/focal-ussuri-42.yaml +++ b/src/tests/bundles/focal-ussuri-42.yaml @@ -266,7 +266,7 @@ applications: openstack-origin: *openstack-origin triliovault-pkg-source: *triliovault-pkg-source trilio-horizon-plugin: - charm: ../../../trilio-horizon-plugin.charm + charm: ../../../trilio-horizon-plugin_ubuntu-20.04-amd64.charm options: triliovault-pkg-source: *triliovault-pkg-source trilio-wlm: diff --git a/src/tests/bundles/focal-wallaby-42.yaml b/src/tests/bundles/focal-wallaby-42.yaml index 720db34..2a018e3 100644 --- a/src/tests/bundles/focal-wallaby-42.yaml +++ b/src/tests/bundles/focal-wallaby-42.yaml @@ -266,7 +266,7 @@ applications: openstack-origin: *openstack-origin triliovault-pkg-source: *triliovault-pkg-source trilio-horizon-plugin: - charm: ../../../trilio-horizon-plugin.charm + charm: ../../../trilio-horizon-plugin_ubuntu-20.04-amd64.charm options: triliovault-pkg-source: *triliovault-pkg-source trilio-wlm: diff --git a/src/wheelhouse.txt b/src/wheelhouse.txt index 3b44ace..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@6c8eb01162edef5e3f8e3af6cb90905e8b2a3065#egg=charms.openstack +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