Skip to content

feat: add container and python examples, and fix repo validation - #1

Merged
jahvon merged 1 commit into
mainfrom
feat/container-and-python-examples
Aug 27, 2026
Merged

feat: add container and python examples, and fix repo validation#1
jahvon merged 1 commit into
mainfrom
feat/container-and-python-examples

Conversation

@jahvon

@jahvon jahvon commented Aug 27, 2026

Copy link
Copy Markdown
Member

Important

The Python examples need a flow build carrying the interpreter field. CI installs flow from main, so they go green the moment flowexec/flow#439 lands. The container examples and the validation fix are independent and work today.

Summary

Two features shipped without examples, and the repo's own validation was checking one file.

container/ — running executables inside an image

Nothing here used exec's container block. The docker/ examples drive the docker CLI as the task, which is a different thing from running a task inside an image — so the feature was undiscoverable from examples.

container/toolchains.flow covers pinned toolchains, env/secret passing, extra volumes, workspace-mount and workdir overrides, and entrypoint selection.

Every executable in it was run against a real Docker daemon, not just schema-validated:

run container:with-env          → hello from the host, container / in container: true
run container:with-volumes      → read a read-only //assets mount
run container:custom-workdir    → mounted at /src, ran in /src/basics
run container:custom-entrypoint → bash 5.2.15, bash-only builtin ran
build container:pinned-toolchain → go1.26.7 linux/arm64
run container:pinned-node       → v22.23.2

That caught a bug in my first draft: I wrote cmd: "-c '...'" with entrypoint: sh, not realising flow already wraps cmd as sh -c. It failed with sh: illegal option. Schema validation would never have found it.

python/ — Python executables

python/basics.flow covers inline interpreter: python, params via os.environ, running a .py by extension, tracebacks reporting real line numbers, mixing shell and Python steps in one serial, and Python in a container. python/scripts.flow imports a .py through imports, using the same f: comment metadata shell scripts use.

All verified by running them. The traceback example asserts its own claim — the error really is reported at line 4:

File "/var/folders/.../flow-452924708.py", line 4, in <module>

Validation was checking one file

validate.flow ran flow schema validate *.flow --strict from the workspace root. That glob matches only validate.flow itself — every example lives in a subdirectory, so none had ever been checked, despite the README claiming "All .flow files in this repo are schema-validated in CI".

It now walks the tree (find, since flow schema validate takes explicit paths) and also validates the workspace config and the template. Coverage went from 1 file to 24.

That immediately surfaced four invalid files that had been passing CI:

File Problem
basics/launch.flow wait declared on a launch, which has no such field
docker/containers.flow params on the executable instead of its type
go-project/release.flow same
setup/database.flow same

All four are fixed here — the params blocks moved under the serial they feed.

Testing

22 flow file(s) valid
1 workspace config valid
1 template valid

Plus the live runs above. Note the README's structure table now distinguishes docker/ (driving the CLI) from container/ (running inside an image), which is the point most likely to confuse someone browsing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi

Two features had no examples: exec's `container` block, and Python execution.
The docker/ examples drive the docker CLI as the task, which is a different
thing from running a task inside an image, so nothing here showed the latter.

container/toolchains.flow covers pinned toolchains, env and secret passing,
extra volumes, workspace mount and workdir overrides, and entrypoint selection.
Every executable in it was run against a real docker daemon rather than only
schema-validated.

python/ covers inline `interpreter: python`, params through os.environ, running
a .py by extension, tracebacks reporting real line numbers, mixing shell and
Python steps in one serial executable, and Python in a container.
python/scripts.flow imports a .py through `imports`, with the same f: comment
metadata syntax shell scripts use.

The validation executable was checking one file. It globbed *.flow from the
workspace root, which matches only validate.flow itself - every example lives in
a subdirectory and none of them were ever checked, despite the README saying
otherwise. It now walks the tree and also validates the workspace config and the
template.

That immediately surfaced four invalid files, all of which had been passing CI:
  - basics/launch.flow declared `wait` on a launch, which is not a field
  - docker/containers.flow, go-project/release.flow, and setup/database.flow
    each put `params` on the executable rather than on its type

Python examples need a flow build carrying the interpreter field. CI already
installs flow from main, so they validate as soon as flowexec/flow#439 lands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi
@jahvon
jahvon merged commit ba3d7a2 into main Aug 27, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant