-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report service logs to the Redis queue
- Loading branch information
1 parent
243dd09
commit 0852efc
Showing
3 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:3.12.3-alpine | ||
|
||
RUN apt-get update && apt-get -y -q --no-install-recommends install libgomp1 | ||
RUN apt-get -y install git | ||
RUN mkdir -p /app/src /app/docker_volume | ||
|
||
RUN addgroup --system python && adduser --system --group python | ||
RUN chown -R python:python /app | ||
USER python | ||
|
||
ENV VIRTUAL_ENV=/app/venv | ||
RUN python -m venv $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN pip install --upgrade pip | ||
RUN pip --default-timeout=1000 install -r requirements.txt | ||
|
||
WORKDIR /app | ||
COPY ./src ./src | ||
|
||
ENV PYTHONPATH "${PYTHONPATH}:/app/src" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import json | ||
from enum import Enum | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class Severity(str, Enum): | ||
error = "error" | ||
info = "info" | ||
|
||
|
||
class LogsMessage(BaseModel): | ||
tenant: str | ||
extraction_name: str | ||
severity: Severity | ||
message: str | ||
|
||
def dump(self): | ||
return json.loads(self.model_dump_json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters