Add GraalPy 25 image replacing CPython
Multi-stage Dockerfile.graalpy on ghcr.io/graalvm/graalpy-community:25 that builds the granian and rloop PyO3 extensions from source against GraalPy (no GraalPy wheels exist), installs the pure-Python deps, and serves the unchanged RSGI app on the rloop event loop. Adds docker-compose.graalpy.yml and a CI job publishing the image as the *-graalpy tags on release/*.
This commit is contained in:
@@ -16,6 +16,13 @@ over the RSGI protocol.
|
||||
|
||||
No database, sessions, or authentication — the app is stateless.
|
||||
|
||||
A second image runs the exact same app on [GraalPy](https://www.graalvm.org/python/)
|
||||
(GraalVM Community Edition 25) instead of CPython — see
|
||||
[Dockerfile.graalpy](Dockerfile.graalpy) and the
|
||||
[GraalPy image](#graalpy-image) section. Because GraalPy is not ABI-compatible
|
||||
with CPython wheels, the compiled `granian` and `rloop` extensions are built
|
||||
from source against GraalPy during the image build.
|
||||
|
||||
## Endpoints
|
||||
|
||||
| Method | Path | Response |
|
||||
@@ -62,6 +69,19 @@ docker compose up -d --build
|
||||
# App published at http://localhost:8080
|
||||
```
|
||||
|
||||
### GraalPy image
|
||||
|
||||
An equivalent image based on `ghcr.io/graalvm/graalpy-community:25`
|
||||
(GraalPy 25.0.2 / Python 3.12.8) is available via a separate compose file:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.graalpy.yml up -d --build
|
||||
# App published at http://localhost:8080
|
||||
```
|
||||
|
||||
This image is published to the registry as the `*-graalpy` tags
|
||||
(e.g. `latest-graalpy`, `0.1.0-graalpy`).
|
||||
|
||||
### On the host
|
||||
|
||||
```bash
|
||||
@@ -121,7 +141,15 @@ register handlers with `@app.GET(...)` decorators at import time —
|
||||
|
||||
## Deployment
|
||||
|
||||
The `Dockerfile` is a multi-stage alpine build producing a minimal,
|
||||
non-root runtime image; pushing a `release/*` tag triggers the Gitea
|
||||
Actions workflow in `.gitea/workflows/build.yaml`, which builds and
|
||||
publishes the image to `gitea.woggioni.net/woggioni-opencode-agent/pyfconfig`.
|
||||
Two images are built from this repository:
|
||||
|
||||
- `Dockerfile` — multi-stage alpine build on CPython, producing a minimal,
|
||||
non-root runtime image.
|
||||
- `Dockerfile.graalpy` — multi-stage Oracle Linux build on GraalPy 25, where
|
||||
the compiled `granian` and `rloop` extensions are compiled from source
|
||||
against GraalPy (the Rust toolchain stays in the builder stage).
|
||||
|
||||
Pushing a `release/*` tag triggers the Gitea Actions workflow in
|
||||
`.gitea/workflows/build.yaml`, which builds and publishes both images to
|
||||
`gitea.woggioni.net/woggioni/pyfconfig`: the CPython image as `latest` /
|
||||
`<version>`, and the GraalPy image as `latest-graalpy` / `<version>-graalpy`.
|
||||
|
||||
Reference in New Issue
Block a user