Skip to content

Go SDK: airflow-go-pack tool for self-contained bundle binaries#67156

Draft
jason810496 wants to merge 5 commits into
apache:mainfrom
jason810496:refactor/go-sdk/airflow-go-pack
Draft

Go SDK: airflow-go-pack tool for self-contained bundle binaries#67156
jason810496 wants to merge 5 commits into
apache:mainfrom
jason810496:refactor/go-sdk/airflow-go-pack

Conversation

@jason810496
Copy link
Copy Markdown
Member

@jason810496 jason810496 commented May 19, 2026

Why

ADR 0004 settled on a self-contained executable as the Go bundle
artefact: one binary that carries its own source and manifest in a
footer, runs under both the go-plugin and the coordinator protocol,
and exposes its bundle spec for introspection. This PR ships the
tool that produces that artefact (airflow-go-pack) and the bundle
server hooks it needs.

What

  • cmd/airflow-go-pack/pack.go drives the build: it invokes the
    user's Go toolchain to compile their bundle main, then appends the
    source tree and manifest to the resulting binary via the new
    internal/bundlefooter package.
  • cmd/airflow-go-pack/inspect.go reads the footer back out — print
    the embedded manifest, optionally dump the source — so operators can
    verify what a binary contains without running it.
  • cmd/airflow-go-pack/main.go wires the subcommands and
    --dump-bundle-spec (the introspection contract from ADR 0001
    Option D); arg parsing treats everything after -- as build flags
    to pass through to go build.
  • bundle/bundlev1/bundlev1server/server.go learns to detect a
    self-contained binary and serve its embedded source/manifest to the
    scanner instead of expecting a ZIP container.
  • example/bundle/Justfile is updated to build via airflow-go-pack,
    and example/bundle/main.go now reads its DAG id from an -ldflags
    variable so the test fixture can produce multiple bundles from one
    source tree.

Was generative AI tooling used to co-author this PR?

- Add `messages_test.go` to test message decoding and encoding functionalities.
- Introduce `serde.go` for serialization of various data types to Airflow's format.
- Create `serde_test.go` to validate serialization logic and ensure correctness.
- Implement `server.go` to handle communication with the supervisor and manage task execution.
- Add `task_runner.go` to execute tasks based on received startup details and handle success/failure.
- Added new command `airflow-go-pack` to build a self-contained Airflow bundle from a Go package.
- Introduced `inspect` command to print the embedded manifest and optionally the source from a bundle.
- Implemented `dump-bundle-spec` functionality to output the bundle specification in JSON format.
- Created `bundlefooter` package to manage appending source and metadata to the binary with a defined trailer.
- Added tests for bundle footer operations and manifest rendering to ensure correctness.
- Updated Justfile for building and packing example DAG bundles.
…fter "--" and update example bundle to support dynamic DAG naming
@jason810496 jason810496 added the go-sdk Label to track work items for golang task sdk label May 19, 2026
@jason810496 jason810496 self-assigned this May 19, 2026
@jason810496 jason810496 moved this to In progress in AIP-72 (addendum): Go-SDK May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:go-sdk go-sdk Label to track work items for golang task sdk

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant