Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions docker/Dockerfile.api
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM python:3.11.10-slim-bullseye as base
FROM python:3.13.5-alpine as base

# Install bash and runtime dependencies for grpc
RUN apk add --no-cache bash libstdc++

ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
Expand All @@ -12,11 +15,25 @@ ENV PYTHONFAULTHANDLER=1 \
# procps && \
# rm -rf /var/lib/apt/lists/*

RUN useradd --user-group --system --create-home --no-log-init keep
RUN addgroup -g 1000 keep && \
adduser -u 1000 -G keep -s /bin/sh -D keep
WORKDIR /app

FROM base as builder

# Install build dependencies for Alpine
RUN apk add --no-cache \
gcc \
g++ \
musl-dev \
libffi-dev \
openssl-dev \
postgresql-dev \
mysql-client \
build-base \
linux-headers \
git

ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
Expand All @@ -34,8 +51,8 @@ COPY examples examples
COPY keep-ui/public/icons/unknown-icon.png unknown-icon.png
RUN /venv/bin/pip install --use-deprecated=legacy-resolver . && \
rm -rf /root/.cache/pip && \
find /venv -type d -name "__pycache__" -exec rm -r {} + && \
find /venv -type f -name "*.pyc" -delete
find /venv -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \
find /venv -type f -name "*.pyc" -delete 2>/dev/null || true

FROM base as final
ENV PATH="/venv/bin:${PATH}"
Expand All @@ -50,6 +67,6 @@ RUN chgrp -R 0 /app && chmod -R g=u /app && \
chown -R keep:keep /venv
USER keep

ENTRYPOINT ["/venv/lib/python3.11/site-packages/keep/entrypoint.sh"]
ENTRYPOINT ["/venv/lib/python3.13/site-packages/keep/entrypoint.sh"]

CMD ["gunicorn", "keep.api.api:get_app", "--bind" , "0.0.0.0:8080" , "--workers", "4" , "-k" , "uvicorn.workers.UvicornWorker", "-c", "/venv/lib/python3.11/site-packages/keep/api/config.py", "--preload"]
CMD ["gunicorn", "keep.api.api:get_app", "--bind" , "0.0.0.0:8080" , "--workers", "4" , "-k" , "uvicorn.workers.UvicornWorker", "-c", "/venv/lib/python3.13/site-packages/keep/api/config.py", "--preload"]
19 changes: 12 additions & 7 deletions keep-ui/app/(keep)/providers/provider-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,18 @@ const ProviderForm = ({
if (!validate()) return;
setIsLoading(true);
submit(`/providers/${provider.id}`, "PUT")
.then(() => {
setIsLoading(false);
toast.success("Updated provider successfully", {
position: "top-left",
});
mutate();
})
.then(
(responseJson: {
validatedScopes: { [key: string]: boolean | string };
}) => {
setIsLoading(false);
toast.success("Updated provider successfully", {
position: "top-left",
});
setProviderValidatedScopes(responseJson.validatedScopes);
mutate();
}
)
.catch((error) => {
showErrorToast("Failed to update provider");
handleSubmitError(error);
Expand Down
1 change: 1 addition & 0 deletions keep/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,4 @@ def run(app: FastAPI):
workers=config("KEEP_WORKERS", default=None, cast=int),
limit_concurrency=config("KEEP_LIMIT_CONCURRENCY", default=None, cast=int),
)

2 changes: 1 addition & 1 deletion keep/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ else
--access-logfile - \
--error-logfile - \
--name "arq_worker" \
-c "/venv/lib/python3.11/site-packages/keep/api/config.py" \
-c "/venv/lib/python3.13/site-packages/keep/api/config.py" \
"--preload" \
"keep.api.arq_worker_gunicorn:create_app()" &

Expand Down
58 changes: 42 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "keep"
version = "0.45.13"
version = "0.46.0"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
packages = [{include = "keep"}]

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
python = ">=3.11,<3.14"
click = "^8.1.3"
pyyaml = "^6.0"
requests = "^2.32.4"
Expand Down Expand Up @@ -71,7 +71,7 @@ google-cloud-trace = "1.15.0"
hvac = "^2.1.0"
python-keycloak = "4.2.3"
sqlalchemy-utils = "^0.41.1"
splunk-sdk = "^1.7.4"
splunk-sdk = "^2.1.0"
openshift-client = "^2.0.4"
uptime-kuma-api = "^1.2.1"
packaging = "^24.0"
Expand Down Expand Up @@ -188,4 +188,4 @@ upload_to_vcs_release = true
[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning"
]
]
Loading