Skip to content

Commit

Permalink
Hardcoding the root_dir to match the worker charm (#26)
Browse files Browse the repository at this point in the history
* hardcoding the root_dir to match the worker charm

* fixing path in unit tests
  • Loading branch information
IbraAoad authored Jan 8, 2024
1 parent a0a2f08 commit 4536868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/mimir_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
tls_requirer: Any = None,
# TODO: use and import s3 requirer obj
s3_requirer: Any = None,
root_data_dir: Path = Path("/etc/mimir"),
root_data_dir: Path = Path("/data"),
):
self._cluster_provider = cluster_provider
self._s3_requirer = s3_requirer # type: ignore
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ def setUp(self):

def test_build_alertmanager_config(self):
alertmanager_config = self.coordinator._build_alertmanager_config()
expected_config = {"data_dir": "/etc/mimir/data-alertmanager"}
expected_config = {"data_dir": "/data/data-alertmanager"}
self.assertEqual(alertmanager_config, expected_config)

def test_build_alertmanager_storage_config(self):
alertmanager_storage_config = self.coordinator._build_alertmanager_storage_config()
expected_config = {"filesystem": {"dir": "/etc/mimir/data-alertmanager-recovery"}}
expected_config = {"filesystem": {"dir": "/data/data-alertmanager-recovery"}}
self.assertEqual(alertmanager_storage_config, expected_config)

def test_build_compactor_config(self):
compactor_config = self.coordinator._build_compactor_config()
expected_config = {"data_dir": "/etc/mimir/data-compactor"}
expected_config = {"data_dir": "/data/data-compactor"}
self.assertEqual(compactor_config, expected_config)

def test_build_ruler_config(self):
ruler_config = self.coordinator._build_ruler_config()
expected_config = {"rule_path": "/etc/mimir/data-ruler"}
expected_config = {"rule_path": "/data/data-ruler"}
self.assertEqual(ruler_config, expected_config)

def test_build_ruler_storage_config(self):
ruler_storage_config = self.coordinator._build_ruler_storage_config()
expected_config = {"filesystem": {"dir": "/etc/mimir/rules"}}
expected_config = {"filesystem": {"dir": "/data/rules"}}
self.assertEqual(ruler_storage_config, expected_config)

def test_build_blocks_storage_config(self):
blocks_storage_config = self.coordinator._build_blocks_storage_config()
expected_config = {
"bucket_store": {"sync_dir": "/etc/mimir/tsdb-sync"},
"filesystem": {"dir": "/etc/mimir/blocks"},
"tsdb": {"dir": "/etc/mimir/tsdb"},
"bucket_store": {"sync_dir": "/data/tsdb-sync"},
"filesystem": {"dir": "/data/blocks"},
"tsdb": {"dir": "/data/tsdb"},
}
self.assertEqual(blocks_storage_config, expected_config)

Expand Down Expand Up @@ -91,7 +91,7 @@ def test_build_s3_storage_config(self):
self.assertEqual(s3_storage_config, expected_config)

def test_update_s3_storage_config(self):
storage_config = {"filesystem": {"dir": "/etc/mimir/blocks"}}
storage_config = {"filesystem": {"dir": "/data/blocks"}}
self.coordinator._update_s3_storage_config(storage_config, "blocks")
expected_config = {"storage_prefix": "blocks"}
self.assertEqual(storage_config, expected_config)
Expand Down

0 comments on commit 4536868

Please sign in to comment.