Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 5 additions & 4 deletions frameworks/mq-bridge-py/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# HttpArena image for the mq-bridge-py (Python) entry.
#
# Installs the prebuilt mq_bridge_py wheel from PyPI and runs server.py on port
# "mq-bridge-py" is only this entry's name: the PyPI package is `mq-bridge`
# (imported as `mq_bridge`). Installs its prebuilt wheel and runs server.py on port
# 8080. The wheel is abi3 (cp38+) manylinux2014, so it works on this base image
# without compiling from source. Pin MQB_VERSION to a released version.
FROM python:3.12-slim

ARG MQB_VERSION=0.4.8
ARG MQB_VERSION=0.4.17

RUN groupadd --system appuser \
&& useradd --system --gid appuser --create-home --home-dir /home/appuser --shell /usr/sbin/nologin appuser \
&& mkdir -p /app \
&& chown -R appuser:appuser /app
# psycopg[binary] powers the DB-backed profiles (/async-db, /fortunes, /crud); absent
# psycopg[binary] powers the DB-backed profiles (/async-db, /fortunes); absent
# DATABASE_URL they are unused. Jinja2 renders /fortunes — the fortunes profile
# requires a real template engine, not string concatenation in the handler.
RUN pip install --no-cache-dir "mq-bridge-py==${MQB_VERSION}" "psycopg[binary]>=3.1" "psycopg_pool>=3.2" "redis>=5.2" "jinja2>=3.1"
RUN pip install --no-cache-dir "mq-bridge==${MQB_VERSION}" "psycopg[binary]>=3.1" "psycopg_pool>=3.2" "jinja2>=3.1"
WORKDIR /app
COPY --chown=appuser:appuser server.py /app/server.py
# The fortunes template is a separate artifact, as the profile requires.
Expand Down
3 changes: 2 additions & 1 deletion frameworks/mq-bridge-py/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"response": true
},
"engine": "mq-bridge",
"description": "mq-bridge Python bindings (mq_bridge_py). A single http->response route dispatches on request metadata while HTTP framing stays in Rust; cleartext HTTP/1.1 + h2c run on 8080/8082, optional TLS listeners serve HTTP/2 on 8443 and HTTP/1.1 on 8081, and the inline-response fast path keeps responses off the GIL so the Python handler runs only the per-request dispatch. Postgres via psycopg for async-db, crud (Redis cache-aside) and fortunes, which renders per request with the Jinja2 template engine; static assets are read from /data/static per request, serving the on-disk .gz variant when the client accepts it; /delay waits with a blocking sleep, so async concurrency is the worker-process count.",
"description": "mq-bridge Python bindings (PyPI package mq-bridge, imported as mq_bridge). A single http->response route dispatches on request metadata while HTTP framing stays in Rust; cleartext HTTP/1.1 + h2c run on 8080/8082, optional TLS listeners serve HTTP/2 on 8443 and HTTP/1.1 on 8081, and the inline-response fast path keeps responses off the GIL so the Python handler runs only the per-request dispatch. Postgres via psycopg for async-db and fortunes, which renders per request with the Jinja2 template engine; static assets are read from /data/static per request, serving the on-disk .gz variant when the client accepts it; /delay waits with a blocking sleep, so async concurrency is the worker-process count.",
"repo": "https://github.com/marcomq/mq-bridge",
"enabled": true,
"tests": [
Expand All @@ -25,6 +25,7 @@
"fortunes",
"json-tls",
"baseline-h2",
"static-tls",
"static-h2",
"baseline-h2c",
"json-h2c",
Expand Down
Loading
Loading