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
47 changes: 47 additions & 0 deletions frameworks/araara-standard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# HttpArena standard-mode submission image for araara.
#
# This package builds the same benchmark server as the tuned araara entry, but
# sets HCS_ARENA_MODE=standard so arena/server/arena.ml keeps Hcs.Server defaults
# where the harness does not require protocol, port, TLS, or upload size fields.

FROM ocaml/opam:debian-12-ocaml-5.4 AS build

ARG HCS_VERSION=0.16.1

USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
git libpq-dev libgmp-dev zlib1g-dev libzstd-dev libssl-dev pkg-config m4 cmake \
&& rm -rf /var/lib/apt/lists/*
USER opam
WORKDIR /app

# Provides hcs, http-proto, repodb, and repodb-postgresql. Public-readable git.
RUN opam repo add araara git+https://tangled.org/gdiazlo.tngl.sh/repo && opam update

RUN opam source --dir hcs "hcs.${HCS_VERSION}"
COPY standard-mode.patch /app/standard-mode.patch
WORKDIR /app/hcs
RUN git apply /app/standard-mode.patch
RUN opam install -y . --deps-only \
&& opam install -y repodb repodb-postgresql climate yojson \
&& opam exec -- dune build arena/server/arena.exe

RUN mkdir -p /app/staging/lib \
&& cp -L _build/default/arena/server/arena.exe /app/staging/server \
&& ldd _build/default/arena/server/arena.exe \
| awk '/=> \//{print $3}' | sort -u \
| grep -vE '/(libc|libm|libpthread|libdl|librt|ld-linux)[.-]' \
| while read -r lib; do cp -Lv "$lib" /app/staging/lib/ 2>/dev/null || true; done \
&& ls -1 /app/staging/lib

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app/staging/lib/ /usr/local/lib/
COPY --from=build /app/staging/server /usr/local/bin/server
RUN ldconfig

ENV HCS_ARENA_MODE=standard

EXPOSE 8080 8443 8081 8082
CMD ["/usr/local/bin/server"]
19 changes: 19 additions & 0 deletions frameworks/araara-standard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# araara-standard

Experimental standard-mode HttpArena entry for araara, an OCaml 5 web stack
built on HCS and Eio.

This entry builds the same benchmark server as `frameworks/araara`, but runs it
with `HCS_ARENA_MODE=standard`. In that mode the server keeps
`Hcs.Server.default_config` values except for harness-required listener fields
such as protocol, port, TLS, and the upload profile's accepted body size.

It still uses all detected physical cores, matching the tuned entry and the
HttpArena benchmark machine.
`SO_REUSEPORT` remains enabled so each domain can bind the required ports.

The Dockerfile applies `standard-mode.patch` to the cloned HCS release before
building so this behavior is available while the tuned entry can stay pinned to
the same release.

Not implemented: HTTP/3 / QUIC, gRPC, gateway-64, and production-stack.
30 changes: 30 additions & 0 deletions frameworks/araara-standard/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"display_name": "araara-standard",
"language": "OCaml",
"engine": "hcs",
"type": "experimental",
"mode": "standard",
"description": "araara - an OCaml 5 web stack built on HCS, using HCS server defaults where possible for the HttpArena harness. Eio, radix-trie routing, Phoenix-style plugs, Postgres via repodb, gzip/zstd compression. HTTP/3 and gRPC are not implemented.",
"repo": "https://araara.ml",
"enabled": true,
"tests": [
"baseline",
"pipelined",
"limited-conn",
"json",
"json-comp",
"json-tls",
"upload",
"static",
"async-db",
"crud",
"api-4",
"api-16",
"baseline-h2",
"static-h2",
"baseline-h2c",
"json-h2c",
"echo-ws"
],
"maintainers": ["gdiazlo"]
}
21 changes: 21 additions & 0 deletions frameworks/araara-standard/standard-mode.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/arena/server/arena.ml b/arena/server/arena.ml
index 19f8884..8c6f61a 100644
--- a/arena/server/arena.ml
+++ b/arena/server/arena.ml
@@ -759,11 +759,14 @@ let gc_tuning () =
max_overhead = 1000;
}

+let is_standard_mode () = Sys.getenv_opt "HCS_ARENA_MODE" = Some "standard"
+
let base_config =
- Hcs.Server.
+ let open Hcs.Server in
+ if is_standard_mode () then { default_config with reuse_port = true }
+ else
{
default_config with
- backlog = 4096;
max_connections = 200000;
reuse_port = true;
(* Stream large request bodies instead of buffering them whole: /upload
46 changes: 46 additions & 0 deletions frameworks/araara/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# HttpArena submission image for araara.
#
# HttpArena builds a framework with frameworks/<name>/ as the context. This image
# adds araara's opam repository, fetches the HCS package source through opam, and
# builds the benchmark server from that released package source.

FROM ocaml/opam:debian-12-ocaml-5.4 AS build

ARG HCS_VERSION=0.16.1

USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
git libpq-dev libgmp-dev zlib1g-dev libzstd-dev libssl-dev pkg-config m4 cmake \
&& rm -rf /var/lib/apt/lists/*
USER opam
WORKDIR /app

# Provides hcs, http-proto, repodb, and repodb-postgresql. Public-readable git.
RUN opam repo add araara git+https://tangled.org/gdiazlo.tngl.sh/repo && opam update

RUN opam source --dir hcs "hcs.${HCS_VERSION}"
WORKDIR /app/hcs
RUN opam install -y . --deps-only \
&& opam install -y repodb repodb-postgresql climate yojson \
&& opam exec -- dune build arena/server/arena.exe

RUN mkdir -p /app/staging/lib \
&& cp -L _build/default/arena/server/arena.exe /app/staging/server \
&& ldd _build/default/arena/server/arena.exe \
| awk '/=> \//{print $3}' | sort -u \
| grep -vE '/(libc|libm|libpthread|libdl|librt|ld-linux)[.-]' \
| while read -r lib; do cp -Lv "$lib" /app/staging/lib/ 2>/dev/null || true; done \
&& ls -1 /app/staging/lib

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app/staging/lib/ /usr/local/lib/
COPY --from=build /app/staging/server /usr/local/bin/server
RUN ldconfig

ENV EIO_BACKEND=io-uring
ENV HCS_H2_MAX_STREAMS=64

EXPOSE 8080 8443 8081 8082
CMD ["/usr/local/bin/server"]
20 changes: 20 additions & 0 deletions frameworks/araara/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# araara

Experimental tuned HttpArena entry for araara, an OCaml 5 web stack built on
HCS and Eio.

The benchmark server source is `arena/server/arena.ml` in the HCS repository.
This Dockerfile clones the HCS release selected by `HCS_REF` and builds that
server, so the framework directory only contains submission metadata and build
instructions.

Listeners:

| Port | Protocol | Profiles |
|------|----------|----------|
| 8080 | HTTP/1.1 + h2c upgrade + WebSocket | baseline, pipelined, limited-conn, json, json-comp, upload, static, async-db, crud, api-*, echo-ws |
| 8443 | TLS, ALPN `h2,http/1.1` | baseline-h2, static-h2 |
| 8081 | TLS, ALPN `http/1.1` | json-tls |
| 8082 | cleartext HTTP/2 prior-knowledge | baseline-h2c, json-h2c |

Not implemented: HTTP/3 / QUIC, gRPC, gateway-64, and production-stack.
30 changes: 30 additions & 0 deletions frameworks/araara/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"display_name": "araara",
"language": "OCaml",
"engine": "hcs",
"type": "experimental",
"mode": "tuned",
"description": "araara - an OCaml 5 web stack built on HCS, Eio, a zero-copy sans-I/O HTTP codec, radix-trie routing, Phoenix-style plugs, Postgres via repodb, and gzip/zstd compression. HTTP/3 and gRPC are not implemented.",
"repo": "https://araara.ml",
"enabled": true,
"tests": [
"baseline",
"pipelined",
"limited-conn",
"json",
"json-comp",
"json-tls",
"upload",
"static",
"async-db",
"crud",
"api-4",
"api-16",
"baseline-h2",
"static-h2",
"baseline-h2c",
"json-h2c",
"echo-ws"
],
"maintainers": ["gdiazlo"]
}