Skip to content

Commit

Permalink
Refactor dashboard utils (#370)
Browse files Browse the repository at this point in the history
* Refactor dashboard utils
* Use LZMABase64 class from coslib
* Import main from ops
  • Loading branch information
sed-i authored Jan 10, 2025
1 parent 807317c commit 95c2e04
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 330 deletions.
2 changes: 1 addition & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ parts:
charm:
# This is currently necessary because it cuts on packing times.
# It can be removed when we have at least multithreading on charmcraft pack.
charm-binary-python-packages: [cryptography, jsonschema, pydantic, maturin]
charm-binary-python-packages: [cryptography, jsonschema, pydantic, pydantic-core, maturin]
build-packages:
- git
static-sqlite3:
Expand Down
646 changes: 320 additions & 326 deletions lib/charms/grafana_k8s/v0/grafana_dashboard.py

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ urllib3
jsonschema
cryptography

# lib/charms/grafana_k8s/v0/grafana_dashboard.py
# lib/charms/tempo_k8s/v1/charm_tracing.py
cosl

# lib/charms/tempo_k8s/v1/charm_tracing.py
opentelemetry-exporter-otlp-proto-http
pydantic
cosl
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
from charms.tempo_coordinator_k8s.v0.charm_tracing import trace_charm
from charms.tempo_coordinator_k8s.v0.tracing import TracingEndpointRequirer, charm_tracing_config
from ops.framework import StoredState
from ops.main import main
from ops import main
from ops.model import ActiveStatus, BlockedStatus, MaintenanceStatus, Port

from ops.pebble import (
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/grafana-tester/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ bases:
channel: "20.04"
parts:
charm:
charm-binary-python-packages: [cryptography, jsonschema]
charm-binary-python-packages: [cryptography, jsonschema, pydantic, pydantic-core, maturin]
1 change: 1 addition & 0 deletions tests/integration/grafana-tester/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ops
jsonschema
cosl
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ deps =
charm: -r{toxinidir}/requirements.txt
lib: ops
lib: jinja2
lib: cosl
unit: {[testenv:unit]deps}
integration: {[testenv:integration]deps}
commands =
Expand Down

0 comments on commit 95c2e04

Please # to comment.