From e03af38f48764a203ad9f1b5b96a3f9a7d6c35ec Mon Sep 17 00:00:00 2001 From: jamesbeedy Date: Thu, 27 Jun 2024 16:31:52 +0000 Subject: [PATCH] push last of local changes for slurmdbd-operator These changes: * remove fluentbit integration and associated code * adds back creation of the the state dir * fix path to jwt_key --- .gitignore | 1 - charmcraft.yaml | 2 - lib/charms/fluentbit/v0/fluentbit.py | 203 --------------------------- src/charm.py | 17 +-- src/constants.py | 33 +---- src/slurmctld_ops.py | 7 + 6 files changed, 9 insertions(+), 254 deletions(-) delete mode 100644 lib/charms/fluentbit/v0/fluentbit.py diff --git a/.gitignore b/.gitignore index 2180401..da25869 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,4 @@ __pycache__/ .idea .vscode/ version -.mypy_cache .ruff_cache diff --git a/charmcraft.yaml b/charmcraft.yaml index db30591..72b0520 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -29,8 +29,6 @@ requires: interface: slurmdbd slurmrestd: interface: slurmrestd - fluentbit: - interface: fluentbit assumes: - juju diff --git a/lib/charms/fluentbit/v0/fluentbit.py b/lib/charms/fluentbit/v0/fluentbit.py deleted file mode 100644 index aa68450..0000000 --- a/lib/charms/fluentbit/v0/fluentbit.py +++ /dev/null @@ -1,203 +0,0 @@ -r"""Fluentbit charm libraries. - -This library contains two main classes: `FluentbitProvider` and -`FluentbitClient`. `FluentbitProvider` class is instantiated in the Fluentbit -Server charm, and receives configuration data through a relation to other -charms. `FluentbitClient` class should be instantiated in any charm that wants -to ship logs via Fluentbit. - -## Forwarding logs using Fluentbit - -To forward logs from your charm to a centralized place using Fluentbit, -instantiate the `FluentbitClient()` class and handle the `relation_created` -event in your main charm code. In this event, your charm must pass all the -configuration parameters necessary to configure Fluentbit: the inputs, the -parsers, and the filters. - -For example: - -```python -class MyCharm(CharmBase): - def __init__(self, *args): - super().__init__(*args) - - self._fluentbit = FluentbitClient(self, "fluentbit") - - self.framework.observe(self.on.fluentbit.relation_created, - self._fluentbit_relation_created) - - def _fluentbit_relation_created(self, event): - cfg = [{"input": [("name", "tail"), - ("path", "/var/log/foo/bar.log"), - ("path_key", "filename"), - ("tag", "foo"), - ("parser", "bar")]}, - {"parser": [("name", "bar"), - ("format", "regex"), - ("regex", "^\[(?