From a5b0cbe3969b8a6cf339a8ac277db6aecd80a023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sat, 2 Sep 2023 15:02:17 +0000 Subject: [PATCH] preparation for release 0.1.0 --- .vscode/launch.json | 2 +- Dockerfile | 20 ++++++++++++++++++++ dummy-metric | 8 -------- example/dummy-metric | 8 ++++++++ min_fail_example.py | 25 ------------------------- 5 files changed, 29 insertions(+), 34 deletions(-) create mode 100644 Dockerfile delete mode 100755 dummy-metric create mode 100755 example/dummy-metric delete mode 100644 min_fail_example.py 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()