Skip to content

Enable deployment on Python 3.7 systems #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 13, 2019

Conversation

fnordahl
Copy link
Member

The current wheelhouse pin set in layer-basic raises challenges when deploying to systems with Python 3.7 as the default Python interpreter.

The pinned version of pip does not have Python 3.7 support and newer versions of pip require newer versions of setuptools.

To be able to use newer versions of setuptools the charm needs to disable include_system_packages in layer.yaml.

To tackle all this I propose we flip the default of include_system_packages to false and unpin pip and setuptools.

@fnordahl
Copy link
Member Author

You can view the result of the Travis jobs run on a staged repository here: https://travis-ci.org/fnordahl/flux-capacitor/builds/520189327

Copy link
Contributor

@johnsca johnsca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm overall +1 on this proposal, and I really like the idea of having tests for this layer against all the different series.

We should probably add an exclude rule to this layer's layer.yaml to keep the new files from ending up in every charm.

@fnordahl fnordahl marked this pull request as ready for review May 2, 2019 17:25
@johnsca
Copy link
Contributor

johnsca commented May 2, 2019

I enabled this repo on Travis, but can't get it to trigger a build. Can you push a commit or perhaps close and re-open the PR to trigger the build?

@johnsca
Copy link
Contributor

johnsca commented Jun 24, 2019

The Kubernetes team has requested that this PR be held until the in-progress 1.15 release is completed, just to be safe.

fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Jun 26, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Jun 26, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Jun 26, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
@fnordahl
Copy link
Member Author

No worries, let's hurry this slowly @johnsca

One of the main obstacles people may face in a non-system python packages world is a dependency on python-apt. I have work in review for charm-helpers that deals with this (as referenced above).

I also have functional test results for a pre-existing charm on trusty through bionic with these bits [0][1], and another one on bionic through disco [2][3].

0: https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_func_full/openstack/charm-aodh/655370/2/3251/consoleText.test_charm_func_full_6433.txt
1: https://review.opendev.org/#/c/655370/
2: https://gist.github.com/fnordahl/45c0cc924632ca6084f5cd3560ea8228 (a run on disco, full results pending in [3])
3: https://review.opendev.org/#/c/655394/

fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Jun 30, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Jul 23, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
To support Python 3.7 we need to unpin ``pip``, recent versions of
``pip`` require recent versions of ``setuptools``.

To have the charm use the bundled version of ``setuptools``
``include_system_packages`` must be set to ``false``.
When deploying on a system with Python 3.7 the currently pinned
``pip`` version will be overridden as the pin set does not
include a version of ``pip`` with Python 3.7 support.

Set upper constraints for ``pip`` to retain Python 3.4 support.

Set upper constraints for ``setuptools`` just in case.
When building dependencies ``pip`` will want to source ``wheel``
from the wheelhouse.  Ref logs in LP: #1824112
Trusty went EOL April 2019 for standard support, it does however
live on in ESM.  Update ``distro-info`` package to ensure the
functional test can still deploy ``trusty``.

Increse loglevel to avoid Travis timing out the job prematurely
when under high load.
Also enables Python 3.4 lint and unit tests.
fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Aug 9, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
fnordahl added a commit to fnordahl/charm-helpers that referenced this pull request Aug 9, 2019
The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135
Copy link
Contributor

@johnsca johnsca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending the imminent merge up the aforementioned charmhelpers PR, I see no blockers on this. +1

johnsca pushed a commit to juju/charm-helpers that referenced this pull request Aug 13, 2019
* setup: Add missing ``psutil`` dependency

* Add module with subset of ``apt_pkg`` API

The ``python-apt`` package is a wrapper around the ``apt`` C++
library which is tightly connected to the version of the
distribution it is shipped on.

This in turn makes it incredibly hard to distribute as a wheel for
a charm that supports a large span of distro versions.

We do not want to rely on system installed Python packages but
distribute the direct charm dependencies as part of the charms
wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135

* Make c-h use provided apt_pkg compability shim

* Detect consumer use of upstream ``apt_pkg`` module

When our consumer use the upstream ``apt_pkg`` module in
conjunction with the apt_cache helper function, they may expect us
to call ``apt_pkg.init()`` for them.

Detect this situation, log a warning and make the call to
``apt_pkg.init()`` to avoid the consumer Python interpreter from
crashing with a segmentation fault.

* Improve string handling in ``upstream_version``

* Update ``apt_cache`` function signature

Make it more clear that any arguments will be ignored.

* Use AttributeDict trick for ``_container`` class

* Accept any kw args to apt_cache for compability
@johnsca
Copy link
Contributor

johnsca commented Aug 13, 2019

charmhelpers 0.20.0 is released, so moving forward with this merge.

@johnsca johnsca merged commit 7cb1b66 into canonical:master Aug 13, 2019
openstack-gerrit pushed a commit to openstack/charm-barbican that referenced this pull request Aug 15, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I0f136f7c1e0e5509f5f2aa5904f89dbd4a227682
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 15, 2019
* Update charm-barbican from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I0f136f7c1e0e5509f5f2aa5904f89dbd4a227682
openstack-gerrit pushed a commit to openstack/charm-octavia-diskimage-retrofit that referenced this pull request Aug 15, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: Ic89bbc395d970039e5da4fe131b0feab9ed0f0a2
openstack-gerrit pushed a commit to openstack/charm-nova-cell-controller that referenced this pull request Aug 15, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I99aa452221bea06331519c3a6cf3fde18c75c879
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 15, 2019
* Update charm-nova-cell-controller from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I99aa452221bea06331519c3a6cf3fde18c75c879
openstack-gerrit pushed a commit to openstack/charm-designate that referenced this pull request Aug 15, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I03b866648183124cca354c63a81628fcb61ffcd3
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 15, 2019
* Update charm-designate from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I03b866648183124cca354c63a81628fcb61ffcd3
openstack-gerrit pushed a commit to openstack/charm-pacemaker-remote that referenced this pull request Aug 15, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I23c08f50f1d193a91a02e3f654202a5269ba9590
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 15, 2019
* Update charm-pacemaker-remote from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I23c08f50f1d193a91a02e3f654202a5269ba9590
openstack-gerrit pushed a commit to openstack/charm-ceph-fs that referenced this pull request Aug 16, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: Ie868ed20563d3e37e19ba513ccffe575923bb9e4
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 16, 2019
* Update charm-ceph-fs from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: Ie868ed20563d3e37e19ba513ccffe575923bb9e4
openstack-gerrit pushed a commit to openstack/charm-barbican-vault that referenced this pull request Aug 16, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I29304997cdbe3987fb0e55d3ea67b20550653704
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 16, 2019
* Update charm-barbican-vault from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I29304997cdbe3987fb0e55d3ea67b20550653704
openstack-gerrit pushed a commit to openstack/charm-vault that referenced this pull request Aug 16, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: Id459b11c110ef0454c665c312824791bdb2f0f38
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 16, 2019
* Update charm-vault from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: Id459b11c110ef0454c665c312824791bdb2f0f38
openstack-gerrit pushed a commit to openstack/charm-manila-generic that referenced this pull request Aug 16, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I2d728072bfca20e612c2d4c9178095a22f83631c
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 16, 2019
* Update charm-manila-generic from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I2d728072bfca20e612c2d4c9178095a22f83631c
openstack-gerrit pushed a commit to openstack/charm-keystone-saml-mellon that referenced this pull request Aug 16, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I11fb4020dc358c40bf9c1870e94186ba7e97c2db
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 16, 2019
* Update charm-keystone-saml-mellon from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Change-Id: I11fb4020dc358c40bf9c1870e94186ba7e97c2db
openstack-gerrit pushed a commit to openstack/charm-masakari that referenced this pull request Aug 20, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Update domain name uesd in ``.gitreview``.

Change-Id: Ib8476c72020c0a1fbb2549c3ceeafac7f12f3efe
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 20, 2019
* Update charm-masakari from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Update domain name uesd in ``.gitreview``.
    
    Change-Id: Ib8476c72020c0a1fbb2549c3ceeafac7f12f3efe
openstack-gerrit pushed a commit to openstack/charm-masakari-monitors that referenced this pull request Aug 20, 2019
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Fix charm locations in functional test bundles.

Change-Id: I7ad4b548669989f778c604addb1aa873f958a5f9
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Aug 20, 2019
* Update charm-masakari-monitors from branch 'master'
  - Distribute direct charm dependencies
    
    Do not rely on system installed Python packages but distribute the
    direct charm dependencies as part of the charms wheelhouse.
    
    As the span of distributions we need to support with reactive
    charms widens we will run into compability problems with the
    current model.
    
    For further reference see juju/charm-helpers#341 and
    canonical/layer-basic#135
    
    Fix charm locations in functional test bundles.
    
    Change-Id: I7ad4b548669989f778c604addb1aa873f958a5f9
lolwww pushed a commit to lolwww/charm-designate-bind that referenced this pull request Mar 9, 2023
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: Ie36ead6090021bb751d04f19796761ed577781bd
lmlg pushed a commit to lmlg/charm-ceph-fs that referenced this pull request May 23, 2024
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: Ie868ed20563d3e37e19ba513ccffe575923bb9e4
lmlg pushed a commit to lmlg/charm-ceph-fs that referenced this pull request May 23, 2024
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see discussion in LP: #1824112 and
canonical/layer-basic#135

Change-Id: Ie868ed20563d3e37e19ba513ccffe575923bb9e4
lmlg pushed a commit to canonical/ceph-charms that referenced this pull request Jan 22, 2025
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: Ie868ed20563d3e37e19ba513ccffe575923bb9e4
lmlg pushed a commit to canonical/ceph-charms that referenced this pull request Jan 22, 2025
Do not rely on system installed Python packages but distribute the
direct charm dependencies as part of the charms wheelhouse.

As the span of distributions we need to support with reactive
charms widens we will run into compability problems with the
current model.

For further reference see juju/charm-helpers#341 and
canonical/layer-basic#135

Change-Id: I129ca4506e44abc1e062d5545ff52f992f86a3b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants