Skip to content

Commit

Permalink
fix: Pin Prometheus and Grafana revisions (#292)
Browse files Browse the repository at this point in the history
This is a temporary patch until we migrate to Juju 3.1:
* Pin Prometheus revision when deploying from `latest` to avoid fetching
  recent patches of the charm which assume `juju >= 3.0.3`. Revision 137
  was the last one seen working properly in our CI integration tests.
* Pin Grafana revision when deploying from `latest` to avoid fetching
  recent patches of the charm which fail to install on Juju 2.9.
  Revision 89 was the last one working properly in our CI integration
  tests.

Signed-off-by: Phoevos Kalemkeris <[email protected]>
  • Loading branch information
phoevos authored Sep 2, 2023
1 parent 1649903 commit 9bc50cf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
12 changes: 11 additions & 1 deletion charms/jupyter-controller/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ async def test_prometheus_integration(ops_test: OpsTest):
scrape_config = {"scrape_interval": "30s"}

# Deploy and relate prometheus
await ops_test.model.deploy(prometheus, channel="latest/stable", trust=True)
# FIXME: Unpin revision once https://github.com/canonical/bundle-kubeflow/issues/688 is closed
await ops_test.juju(
"deploy",
prometheus,
"--channel",
"latest/edge",
"--revision",
"137",
"--trust",
check=True,
)
await ops_test.model.deploy(prometheus_scrape, channel="latest/stable", config=scrape_config)

await ops_test.model.add_relation(APP_NAME, prometheus_scrape)
Expand Down
24 changes: 22 additions & 2 deletions tests/test_charms.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,28 @@ async def test_prometheus_grafana_integration(ops_test):
scrape_config = {"scrape_interval": "30s"}

# Deploy and relate prometheus
await ops_test.model.deploy(prometheus, channel="latest/edge", trust=True)
await ops_test.model.deploy(grafana, channel="latest/edge", trust=True)
# FIXME: Unpin revision once https://github.com/canonical/bundle-kubeflow/issues/688 is closed
await ops_test.juju(
"deploy",
prometheus,
"--channel",
"latest/edge",
"--revision",
"137",
"--trust",
check=True,
)
# FIXME: Unpin revision once https://github.com/canonical/bundle-kubeflow/issues/690 is closed
await ops_test.juju(
"deploy",
grafana,
"--channel",
"latest/edge",
"--revision",
"89",
"--trust",
check=True,
)
await ops_test.model.deploy(prometheus_scrape, channel="latest/beta", config=scrape_config)

await ops_test.model.add_relation(CONTROLLER_APP_NAME, prometheus_scrape)
Expand Down

0 comments on commit 9bc50cf

Please sign in to comment.