flow-container-echo

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

flow-container-echo

Minimal container image for the Astrate Flow container block PoC (#43).

Implements the HTTP message contract used by internal/flow/blocks/container:

Method Path Behaviour
GET /healthz 204 — readiness
POST /v1/message Body = one FlowMessage JSON (astarte_flow/message/v0.1); response 200 + same JSON (echo), or 204 to drop

Env:

  • ASTRATE_FLOW_CONFIG — opaque JSON from the pipeline node’s nested config (logged at start).
  • PORT — listen port (default 8080).

Build

docker build -t astrate/flow-container-echo:poc .

Manual curl

docker run --rm -p 18080:8080 astrate/flow-container-echo:poc

curl -sS -X POST http://127.0.0.1:18080/v1/message \
  -H 'Content-Type: application/json' \
  -d '{
    "schema": "astarte_flow/message/v0.1",
    "key": "demo",
    "type": "string",
    "data": "hello",
    "timestamp_us": 0
  }'

Drop a message (filter semantics):

curl -sS -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:18080/v1/message \
  -H 'Content-Type: application/json' \
  -d '{
    "schema": "astarte_flow/message/v0.1",
    "key": "demo",
    "type": "string",
    "data": "x",
    "metadata": {"echo_drop": "1"},
    "timestamp_us": 0
  }'
# → 204

Pipeline snippet

{
  "name": "enrich",
  "block_type": "container",
  "config": {
    "image": "astrate/flow-container-echo:poc",
    "config": { "note": "opaque to the container" }
  }
}

Limitations (PoC): local Docker only, HTTP request/response, no resource limits, no registry auth beyond what your Docker daemon already has. See Design B.

Documentation

Overview

Minimal Astrate Flow container contract: POST /v1/message with a Message JSON body and echo it back (or drop on empty array / 204).

See README.md and docs/handoff/flow-design-b-container-block-2026-07-29.md.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL