Files
wfe/wfe-buildkit
Sienna Meridian Satterwhite 8473b9ca8d test: comprehensive coverage expansion for 1.9
Expand tests across three main areas:

1. **Host name/resolve tests** (10 new): auto-sequence naming,
   explicit override, whitespace rejection, UUID/name interchangeable
   lookup, suspend/resume/terminate via name, nonexistent error,
   resume-non-suspended no-op.

2. **Shared persistence suite** (14 new, shared by sqlite/postgres/
   in-memory): next_definition_sequence, get_workflow_instance_by_name,
   root_workflow_id round-trip, subscription token lifecycle, first
   open subscription, persist_workflow_with_subscriptions,
   mark_event_unprocessed, get_events filtering, batch
   get_workflow_instances, WorkflowNotFound, ensure_store_exists
   idempotency, execution pointer full round-trip, scheduled commands.
   Queue suite: 4 new. Lock suite: 3 new.

3. **Multi-step K8s integration test**: 4-step pipeline across 3
   different container images proving cross-image /workspace sharing
   through a SharedVolume PVC, bash shell override with pipefail +
   arrays, workflow.data env mapping, and output capture.
2026-04-09 15:48:24 +01:00
..
2026-04-07 18:44:21 +01:00

wfe-buildkit

BuildKit image builder executor for WFE.

What it does

wfe-buildkit provides a BuildkitStep that implements the StepBody trait from wfe-core. It shells out to the buildctl CLI to build container images using BuildKit, capturing stdout/stderr and parsing image digests from the output.

Quick start

Use it standalone:

use wfe_buildkit::{BuildkitConfig, BuildkitStep};

let config = BuildkitConfig {
    dockerfile: "Dockerfile".to_string(),
    context: ".".to_string(),
    tags: vec!["myapp:latest".to_string()],
    push: true,
    ..Default::default()
};

let step = BuildkitStep::new(config);

// Inspect the command that would be executed.
let args = step.build_command();
println!("{}", args.join(" "));

Or use it through wfe-yaml with the buildkit feature:

workflow:
  id: build-image
  version: 1
  steps:
    - name: build
      type: buildkit
      config:
        dockerfile: Dockerfile
        context: .
        tags:
          - myapp:latest
          - myapp:v1.0
        push: true
        build_args:
          RUST_VERSION: "1.78"
        cache_from:
          - type=registry,ref=myapp:cache
        cache_to:
          - type=registry,ref=myapp:cache,mode=max
        timeout: 10m

Configuration

Field Type Required Default Description
dockerfile String Yes - Path to the Dockerfile
context String Yes - Build context directory
target String No - Multi-stage build target
tags Vec<String> No [] Image tags
build_args Map<String, String> No {} Build arguments
cache_from Vec<String> No [] Cache import sources
cache_to Vec<String> No [] Cache export destinations
push bool No false Push image after build
output_type String No "image" Output type: image, local, tar
buildkit_addr String No unix:///run/buildkit/buildkitd.sock BuildKit daemon address
tls TlsConfig No - TLS certificate paths
registry_auth Map<String, RegistryAuth> No {} Registry credentials
timeout_ms u64 No - Execution timeout in milliseconds

Output data

After execution, the step writes the following keys into output_data:

Key Description
{step_name}.digest Image digest (sha256:...), if found in output
{step_name}.tags Array of tags applied to the image
{step_name}.stdout Full stdout from buildctl
{step_name}.stderr Full stderr from buildctl

Testing

cargo test -p wfe-buildkit

The build_command() method returns the full argument list without executing, making it possible to test command construction without a running BuildKit daemon.

License

MIT