interface-prometheus: Dependency to operator framework

Bug #1898040 reported by Tilman Baumann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Prometheus2 charm
Fix Released
Medium
Unassigned

Bug Description

We have seen reactive charms fail because of missing dependency to the ops module.

The code with that dependency is in hooks/relations/prometheus/operator.py

Adding ops to the wheelhouse.txt of the main charm 'solves' the issue. But the dependency should be specified in the submodule that introduces the dependency.

I think the solution is that this layer adds the necessary dependency.

Please add depencies.txt or wheelhouse.txt to the interface-prometheus layer. My understanding is that `charm build` will collect all those dependencies together and will bundle up the dependencies with the charm.

Thank you

Tags: 4010
Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

I tried adding wheelhouse.txt to the interface-prometheus layer. But apparently charm build ignores it.

Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

It works if I add the ops dependency to the wheelhouse.txt of the main prometheus2 charm layer.
But it doesn't feel right to fix it like that.

tags: added: 4010
Jose Guedez (jfguedez)
Changed in charm-prometheus2:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Cory Johns (johnsca) wrote :

Where are you pulling that interface layer from? The repo that the layer-index entry [1] refers to doesn't have that file [2].

It sounds like you're using a version that someone tried to convert to work with both frameworks; if that's the case, you either need to add the Operator Framework files to the exclude list in the interface.yaml [3] or convert it to use the ops-reactive-interface library [4] which allows you to focus on the Operator Framework implementation only and then make it usable in Reactive Framework charms. The main downside of the latter approach is that it does require changing how the interface is included into the charm (it's a library, so it's pulled in via wheelhouse.txt rather than layer.yaml) but it ends up with a much cleaner implementation and encourages moving fully to the new framework. But, the former does allow you to fix this bug with a simple two-line addition to a YAML file, so there's that.

[1]: https://github.com/juju/layer-index/blob/master/interfaces/prometheus.json#L4
[2]: https://git.launchpad.net/interface-prometheus/tree/
[3]: https://charm-tools.readthedocs.io/en/latest/tactics.html#charmtools.build.tactics.ExcludeTactic
[4]: https://github.com/juju-solutions/ops-reactive-interface

Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

Ah I see it was recently removed from the layer. https://git.launchpad.net/interface-prometheus/commit/?id=b3c2c38a2ea87b0ccd37f08d2d9b4b638160616d

That 'solves' this issue. Thanks.

Changed in charm-prometheus2:
status: Triaged → Fix Released
Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

The problem is that we are building reactive charms via CI-CD. That is why we see problems with layers quickly that might never pop up in 'released' versions.
Unfortunately layer versions can't be pinned. Whenever something funny happens upstream we see it :D

Cheers Cory

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.