Skip to content

fraglet-entrypoint v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 12 Feb 06:53
· 95 commits to main since this release

Release v0.4.0

Key Highlights

  • Stdin passthrough: fraglet-entrypoint now forwards the container's stdin to the executed command, enabling echo "data" | docker run --rm -i ... <container> workflows.
  • Full data pipeline support: Fraglets can read from stdin using their language's native I/O primitives — pipes, multi-line streams, and binary data all work.
  • Verified across 14 languages: Python, Ruby, C, C++, Java, C#, Bash, Go, Rust, Haskell, Perl, Lua, Kotlin, and Scala.

✨ New Features

Stdin Forwarding to Executed Commands

Previously, cmd.Stdin was not wired up in the executor — any data piped into a container was silently dropped. The fix is one line, but the capability it unlocks is significant:

cmd := exec.Command(cmdPath, cmdArgs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Stdin = os.Stdin     // NEW — forwards container stdin to the command

This means fraglets can now behave like real command-line tools that accept piped input:

# Single-line pipe
echo "hello world" | docker run --rm -i -v ./my-script.py:/FRAGLET:ro 100hellos/python:latest

# Multi-line stream
cat data.csv | docker run --rm -i -v ./process.rb:/FRAGLET:ro 100hellos/ruby:latest

# Binary data
cat image.png | docker run --rm -i -v ./analyze.py:/FRAGLET:ro 100hellos/python:latest

# Stdin + positional args
echo "input" | docker run --rm -i -v ./tool.sh:/FRAGLET:ro 100hellos/bash:latest --verbose arg1

No configuration changes required — every existing container image benefits from a binary upgrade.

🧪 Testing

Three new integration test suites exercise the feature end-to-end:

stdin_passthrough

Builds an isolated test container and validates the core mechanics:

  • Basic single-line pipe
  • Multi-line stdin
  • Stdin combined with positional arguments
  • Graceful behavior when no stdin is provided
  • Binary byte-count verification

stdin_languages

Mounts the locally-built entrypoint binary into real 100hellos containers and pipes data through fraglets written in Python, Ruby, C, C++, Java, and C#. Also tests stdin + args together (Python).

stdin_languages_extended

Same approach, covering Bash, Go, Rust, Haskell, Perl, Lua, Kotlin, and Scala. All 14 languages read stdin with their native idioms and produce expected output.

Running the tests

make test-entrypoint

🚀 Upgrading

The change is fully backward-compatible. Containers that don't use stdin are unaffected — os.Stdin simply has no data to deliver.

For 100hellos containers: update the fraglet-entrypoint version and sha256 in the base Dockerfile (001-base) to point at the v0.4.0 release. No other changes needed — every language container that inherits from the base picks up stdin support automatically.

Usage note

Remember -i on docker run when piping data — without it, Docker closes stdin before the container can read it:

echo "hello" | docker run --rm -i -v ./my-fraglet.py:/FRAGLET:ro 100hellos/python:latest