Skip to content

function-oci-v0.4.0

Choose a tag to compare

@jonasz-lasut jonasz-lasut released this 23 Nov 12:30
b082a58

With --warm-modules or --cosign-trust-instance set, function-oci 0.4.0 refuses requests until the pod has warmed up, where 0.3.0 served them cold. It also logs a process that the memory limit killed after it had answered. The Input, the manifest and oci@0.1 are unchanged, and an image that ran on 0.3.0 runs without a rebuild.

Before you upgrade

If you set --warm-modules or --cosign-trust-instance, give the function's pod a readiness probe on /readyz. Without one, a step that calls a pod still warming up fails with rpc error: code = Unavailable desc = the function is not ready until Crossplane retries it after warm-up has ended. The probe keeps the pod out of the Service until then (Readiness and warm-up).

For operators

A pod refuses requests until warm-up ends

On 0.3.0 the runtime ran a RunFunction call that arrived during warm-up at once, loading its module cold or joining a load already in flight. 0.4.0 answers it with UNAVAILABLE and runs nothing, as function-sdk-rust's own server does for a function that's still loading. Warm-up is the first trusted-root fetch under --cosign-trust-instance, bounded to one minute, then each --warm-modules entry, with its VM snapshot under --enable-vm-snapshots. Until it ends the gRPC health service reports NOT_SERVING for the server as a whole as well as for the function. On 0.3.0 the server's status read SERVING from the start (#422).

A process killed after its answer is logged

A process that the memory limit kills after it has answered fails no step, since the caller already has its response. On 0.3.0 the VM's serial console, which the runtime logs at debug, was the one place that kill showed. Stopping the VM could also cut short the exit line that the init writes there. 0.4.0 logs the kill as a warning with the module and its digest, process was killed after it answered: the run's memory limit of … was exceeded, and the exit the init reports after an answer as the debug record the process's exit after its answer. The init now waits until the console has sent its exit line before it reports the exit, so the console in the --debug log ends with that line whole (Install function-oci, #413).

For module authors

The runtime re-encodes the request and the response

The runtime now decodes the request and the response as function-sdk-rust 0.6.0's messages and encodes them again on the way. It keeps the fields newer than its own proto in both directions. The bytes a module receives aren't the caller's own, so a module can't depend on their layout. A response that doesn't decode now fails the step with module … failed: run returned an error: … (gRPC status Internal), and 0.3.0 printed module … failed: cannot decode response: …. The decode and the encode take time in proportion to the messages' size. That cost isn't measured on function-oci. On function-wasm, wire to wire, a request with 1000 composed resources (5.4 MB) now takes a median of 105 to 106 ms, against 59 to 69 ms before (OCI runtime, #422, #423).

Merged pull requests

  • docs: say what a patch release may change by @jonasz-lasut in #390
  • docs: tested versions of function-oci-v0.3.0 by @jonasz-lasut in #394
  • chore(deps): update rust crate prost-types to v0.14.5 by @renovate[bot] in #395
  • chore(deps): update dependency bytecodealliance/wasm-pkg-tools to v0.16.2 by @renovate[bot] in #396
  • chore(deps): update rust crate prost-types to v0.14.6 by @renovate[bot] in #397
  • chore(deps): update cgr.dev/chainguard/glibc-dynamic:latest docker digest to a5e9991 by @renovate[bot] in #398
  • chore(deps): update rust crate jiff to v0.2.44 by @renovate[bot] in #399
  • chore(deps): lock file maintenance by @renovate[bot] in #353
  • chore(deps): update embarkstudios/cargo-deny-action action to v2.1.2 by @renovate[bot] in #401
  • chore(deps): update cgr.dev/chainguard/glibc-dynamic:latest docker digest to 48ce6d7 by @renovate[bot] in #400
  • chore(deps): ignore chrono advisory in cargo-deny by @jonasz-lasut in #408
  • docs: shorten the agent guide and add CONTRIBUTING by @jonasz-lasut in #407
  • chore(renovate): gate the WASI comment bump by age by @jonasz-lasut in #410
  • ci: skip CI for Vale and Renovate config changes by @jonasz-lasut in #411
  • chore(deps): update module sigs.k8s.io/controller-runtime to v0.25.3 by @renovate[bot] in #402
  • chore(deps): correct the chrono ignore comment by @jonasz-lasut in #414
  • chore(deps): update dependency wasmtime-wasi-http to v50.0.2 by @renovate[bot] in #404
  • feat(guestfn): write the current function release by @jonasz-lasut in #415
  • fix(oci): keep the init's exit report whole by @jonasz-lasut in #413
  • chore(deps): update cgr.dev/chainguard/glibc-dynamic:latest docker digest to a49f6f6 by @renovate[bot] in #406
  • chore(deps): update rust by @renovate[bot] in #405
  • ci: lint the shell scripts and the workflows by @jonasz-lasut in #416
  • chore(deps): update actions/setup-go action to v7.1.0 by @renovate[bot] in #419
  • chore(deps): update dependency renovate to v44.253.0 by @renovate[bot] in #420
  • chore(deps): update examples by @renovate[bot] in #417
  • refactor(runtime): forward the SDK's messages by @jonasz-lasut in #422
  • refactor(engine): take the SDK's messages by @jonasz-lasut in #423
  • chore(deps): update cgr.dev/chainguard/glibc-dynamic:latest docker digest to 3359c6b by @renovate[bot] in #425
  • chore(deps): update rust to v4.15.0 by @renovate[bot] in #418
  • chore(deps): update vale by @renovate[bot] in #426
  • chore(deps): update wasmtime to v51 by @renovate[bot] in #432
  • chore(deps): update dependency renovate to v44.256.1 by @renovate[bot] in #431
  • chore(deps): update rust by @renovate[bot] in #428
  • chore(deps): update github-actions by @renovate[bot] in #429
  • docs(oci): name function-oci v0.4.0 in the example by @jonasz-lasut in #433
  • docs(wasm): name function-wasm v1.1.0 in installs by @jonasz-lasut in #434
  • fix(engine-wasm): refuse GC and function references by @jonasz-lasut in #435

Full Changelog: function-oci-v0.3.0...function-oci-v0.4.0