From 4a7c44b3c3aea5acdb4bbb1aec73d5f1931ef7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 5 Jul 2024 13:42:38 -0300 Subject: [PATCH 1/3] bootstrap: bootstrap: Limit maximum blueos log size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- bootstrap/bootstrap/bootstrap.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap/bootstrap/bootstrap.py b/bootstrap/bootstrap/bootstrap.py index 9652c2499b..8945c1e603 100755 --- a/bootstrap/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap/bootstrap.py @@ -208,6 +208,13 @@ def start(self, component_name: str) -> bool: privileged=privileged, network=network, detach=True, + log_config={ + "Type": "json-file", + "Config": { + "max-size": "30m", + "max-file": "3", + }, + }, ) except docker.errors.APIError as error: warn(f"Error trying to start image: {error}, reverting to default...") From 3a92682164d415691eb863aa3a71fb09c54bc457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 5 Jul 2024 13:42:52 -0300 Subject: [PATCH 2/3] core: services: kraken: extension: Limit maximum log size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- core/services/kraken/extension/extension.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/services/kraken/extension/extension.py b/core/services/kraken/extension/extension.py index 7f64d0329f..35540f1d06 100644 --- a/core/services/kraken/extension/extension.py +++ b/core/services/kraken/extension/extension.py @@ -197,6 +197,13 @@ async def start(self) -> None: img_name = ext.fullname() config["Image"] = img_name + + if "HostConfig" not in config: + config["HostConfig"] = {} + if "LogConfig" not in config["HostConfig"]: + config["HostConfig"]["LogConfig"] = {} + config["HostConfig"]["LogConfig"] = {"Type": "json-file", "Config": {"max-size": "20m", "max-file": "3"}} + try: async with DockerCtx() as client: # Checks if image exists locally, if not tries to pull it From 3dd513a01ba010e628a5c180ae5eddd804b06401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 5 Jul 2024 13:43:05 -0300 Subject: [PATCH 3/3] core: services: versionchooser: chooser: Limit maximum extension log size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- core/services/versionchooser/utils/chooser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/services/versionchooser/utils/chooser.py b/core/services/versionchooser/utils/chooser.py index a048c0b2b4..f1899312c8 100644 --- a/core/services/versionchooser/utils/chooser.py +++ b/core/services/versionchooser/utils/chooser.py @@ -230,6 +230,10 @@ async def set_bootstrap_version(self, tag: str) -> web.StreamResponse: "/var/run/docker.sock:/var/run/docker.sock", "/var/logs/blueos:/var/logs/blueos", ], + "LogConfig": { + "Type": "json-file", + "Config": {"max-size": "30m", "max-file": "3"}, + }, }, "Env": [f"BLUEOS_CONFIG_PATH={HOME}/.config/blueos"], }