Skip to content

Deploying

Two images, built from the repository’s Dockerfile and published with each release:

Image Runs Port
ghcr.io/pulzar-net/pulzr-codec:<version> serve, on distroless 5600
ghcr.io/pulzar-net/pulzr-codec-builder:<version> build-serve, with rustc and the SDK 5700
docker run --rm -p 127.0.0.1:5600:5600 -e PULZR_CODEC_AUTH=none -e BIND=0.0.0.0 \
ghcr.io/pulzar-net/pulzr-codec:0.1.0

(BIND=0.0.0.0 inside the container, and the published port bound to 127.0.0.1 on the host, keeps it to your machine.)

A service that other services call, with tokens from your identity provider:

containers:
- name: pulzr-codec
image: ghcr.io/pulzar-net/pulzr-codec:0.1.0
ports: [{containerPort: 5600}]
env:
- {name: OIDC_ISSUER, value: "https://auth.example.com/realms/services"}
- {name: OIDC_JWKS_URL, value: "https://auth.example.com/realms/services/protocol/openid-connect/certs"}
- {name: OIDC_CLIENT_ID, value: "services"}
- {name: OIDC_ROLE, value: "codec-caller"}
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: {drop: [ALL]}
resources:
requests: {cpu: 100m, memory: 256Mi}
limits: {cpu: "1", memory: 1Gi}

Memory is mostly warm instances (about 0.8 MB each for a small codec) and library codecs; DECODER_CACHE_ENTRIES and LIBRARY_CACHE_BYTES bound them.

The compile service needs more care, because a source it compiles can read files: give it nothing to read.

automountServiceAccountToken: false
containers:
- name: codec-builder
image: ghcr.io/pulzar-net/pulzr-codec-builder:0.1.0
env:
- {name: BUILD_WORKERS, value: "1"}
# OIDC_* as above; no other secrets
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: {drop: [ALL]}
volumeMounts: [{name: tmp, mountPath: /tmp}]
volumes:
- {name: tmp, emptyDir: {sizeLimit: 1Gi}}

The service runs where wasmtime runs: x86_64 and aarch64 Linux among them, so a Raspberry Pi 4 or 5 serves its own LAN’s codecs with PULZR_CODEC_AUTH=none, bound to 127.0.0.1.