diff --git a/.vscode/launch.json b/.vscode/launch.json index 3049ac8..0bb267d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -13,7 +13,7 @@ "METRIC__INTERVAL": "5", "METRIC__LOG__ENABLED": "True", "METRIC__DISK__PATHS": "[\"/var\", \"/\", \"/dev\"]", - "METRIC__EXTERNAL__EXECUTABLES": "[\"${workspaceFolder}/dummy-metric\"]", + "METRIC__EXTERNAL__EXECUTABLES": "[\"${workspaceFolder}/example/dummy-metric\"]", }, "justMyCode": true } diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..40d7e0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM python:3.11-alpine + +ENV \ + PYTHONUNBUFFERED=1 + +COPY . /usr/src/app + +RUN set -ex; \ + # buildtime deps + apk add --no-cache \ + --virtual .build-deps \ + build-base \ + gcc \ + linux-headers \ + ; + +RUN set -ex; \ + pip3 --no-cache-dir install /usr/src/app + +ENTRYPOINT ["kiwi-simple-metrics"] \ No newline at end of file diff --git a/dummy-metric b/dummy-metric deleted file mode 100755 index 284bcdb..0000000 --- a/dummy-metric +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -echo "Dummy" -echo "95" -echo "normal" -awk "BEGIN{srand(); r=rand(); print r * 100}" - -exit 0 \ No newline at end of file diff --git a/example/dummy-metric b/example/dummy-metric new file mode 100755 index 0000000..d869c76 --- /dev/null +++ b/example/dummy-metric @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "Dummy" # name +echo "95" # threshold +echo "normal" # inversion +awk "BEGIN{srand(); r=rand(); print r * 100}" # value + +exit 0 \ No newline at end of file diff --git a/min_fail_example.py b/min_fail_example.py deleted file mode 100644 index c812183..0000000 --- a/min_fail_example.py +++ /dev/null @@ -1,25 +0,0 @@ -from pydantic import BaseModel - - -class SubModel(BaseModel): - optional: int = 42 - required: str - - -class Settings(BaseModel): - sub: SubModel = SubModel(required="foo") - sub2: SubModel = SubModel(required="bar") - - -def main() -> None: - settings = Settings.model_validate({ - "sub": {"optional": "69"}, - }) - - # settings = Settings() - - print(settings.model_dump()) - - -if __name__ == "__main__": - main()