diff --git a/.github/dependabot.yml b/.github/dependabot.yml index be16f05ab..fd677353e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -69,7 +69,7 @@ updates: include: "scope" - package-ecosystem: "pip" - directory: "/components/runtimes/python39/kubeless" + directory: "/components/runtimes/python/python39" labels: - "area/dependency" - "kind/chore" @@ -82,6 +82,20 @@ updates: opentelemetry: patterns: - "opentelemetry-*" + - package-ecosystem: "pip" + directory: "/components/runtimes/python/python312" + labels: + - "area/dependency" + - "kind/chore" + schedule: + interval: "weekly" + commit-message: + prefix: "pip-python312" + include: "scope" + groups: + opentelemetry: + patterns: + - "opentelemetry-*" - package-ecosystem: "npm" directory: "/components/runtimes/nodejs/nodejs16" diff --git a/components/runtimes/python39/kubeless/.gitignore b/components/runtimes/python/kubeless/.gitignore similarity index 100% rename from components/runtimes/python39/kubeless/.gitignore rename to components/runtimes/python/kubeless/.gitignore diff --git a/components/runtimes/python39/kubeless/README.md b/components/runtimes/python/kubeless/README.md similarity index 100% rename from components/runtimes/python39/kubeless/README.md rename to components/runtimes/python/kubeless/README.md diff --git a/components/runtimes/python39/kubeless/ce.py b/components/runtimes/python/kubeless/ce.py similarity index 100% rename from components/runtimes/python39/kubeless/ce.py rename to components/runtimes/python/kubeless/ce.py diff --git a/components/runtimes/python39/kubeless/kubeless.py b/components/runtimes/python/kubeless/kubeless.py similarity index 100% rename from components/runtimes/python39/kubeless/kubeless.py rename to components/runtimes/python/kubeless/kubeless.py diff --git a/components/runtimes/python39/kubeless/tracing.py b/components/runtimes/python/kubeless/tracing.py similarity index 100% rename from components/runtimes/python39/kubeless/tracing.py rename to components/runtimes/python/kubeless/tracing.py diff --git a/components/runtimes/python39/.dockerignore b/components/runtimes/python/python312/.dockerignore similarity index 100% rename from components/runtimes/python39/.dockerignore rename to components/runtimes/python/python312/.dockerignore diff --git a/components/runtimes/python/python312/Dockerfile b/components/runtimes/python/python312/Dockerfile new file mode 100644 index 000000000..6fa301db0 --- /dev/null +++ b/components/runtimes/python/python312/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.12.2-alpine3.19 + +# Serverless +LABEL source = git@github.com:kyma-project/kyma.git + +# build-base and linux-headers are needed to install all requirements +RUN apk add --no-cache --virtual .build-deps build-base linux-headers + +COPY ./python312/requirements.txt /kubeless/requirements.txt + +RUN pip install --no-cache-dir -r /kubeless/requirements.txt + +COPY ./kubeless/ / + +WORKDIR / + +USER 1000 +# Tracing propagators are configured based on OTEL_PROPAGATORS env variable https://opentelemetry.io/docs/instrumentation/python/manual/#using-environment-variables +ENV OTEL_PROPAGATORS=tracecontext,baggage,b3multi +ENV OTEL_PYTHON_REQUESTS_EXCLUDED_URLS="healthz,favicon.ico,metrics" + +CMD ["python", "/kubeless.py"] diff --git a/components/runtimes/python39/kubeless/requirements.txt b/components/runtimes/python/python312/requirements.txt similarity index 100% rename from components/runtimes/python39/kubeless/requirements.txt rename to components/runtimes/python/python312/requirements.txt diff --git a/components/runtimes/python/python39/.dockerignore b/components/runtimes/python/python39/.dockerignore new file mode 100644 index 000000000..6c84f66b4 --- /dev/null +++ b/components/runtimes/python/python39/.dockerignore @@ -0,0 +1 @@ +kubeless/handler.py diff --git a/components/runtimes/python39/Dockerfile b/components/runtimes/python/python39/Dockerfile similarity index 88% rename from components/runtimes/python39/Dockerfile rename to components/runtimes/python/python39/Dockerfile index ce571f851..3a2f30494 100644 --- a/components/runtimes/python39/Dockerfile +++ b/components/runtimes/python/python39/Dockerfile @@ -6,11 +6,11 @@ LABEL source = git@github.com:kyma-project/kyma.git # build-base and linux-headers are needed to install all requirements RUN apk add --no-cache --virtual .build-deps build-base linux-headers -COPY kubeless/requirements.txt /kubeless/requirements.txt +COPY ./python39/requirements.txt /kubeless/requirements.txt RUN pip install --no-cache-dir -r /kubeless/requirements.txt -COPY kubeless/ / +COPY ./kubeless/ / WORKDIR / diff --git a/components/runtimes/python/python39/requirements.txt b/components/runtimes/python/python39/requirements.txt new file mode 100644 index 000000000..0df1f829c --- /dev/null +++ b/components/runtimes/python/python39/requirements.txt @@ -0,0 +1,12 @@ +setuptools==69.1.1 +requests>=2.31.0 +bottle==0.12.25 +cheroot==10.0.0 +wsgi-request-logger==0.4.6 +prometheus_client==0.20.0 +opentelemetry-api==1.23.0 +opentelemetry-sdk==1.23.0 +opentelemetry-exporter-otlp-proto-http==1.23.0 +opentelemetry-propagator-b3==1.23.0 +opentelemetry-instrumentation-requests==0.44b0 +cloudevents diff --git a/sec-scanners-config.yaml b/sec-scanners-config.yaml index 2a99a6e20..11228cac1 100644 --- a/sec-scanners-config.yaml +++ b/sec-scanners-config.yaml @@ -8,6 +8,7 @@ protecode: - europe-docker.pkg.dev/kyma-project/prod/function-runtime-nodejs16:main - europe-docker.pkg.dev/kyma-project/prod/function-runtime-nodejs18:main - europe-docker.pkg.dev/kyma-project/prod/function-runtime-python39:main + - europe-docker.pkg.dev/kyma-project/prod/function-runtime-python312:main - europe-docker.pkg.dev/kyma-project/prod/tpi/kaniko-executor:1.9.2-ea54c1c7 - europe-docker.pkg.dev/kyma-project/prod/tpi/registry:2.8.1-1ae4c190 whitesource: