Skip to main content

probe

Function probe 

Source
pub fn probe(
    entry: &str,
    cmd_dir: &Path,
    docker_service: Option<&str>,
) -> Result<Schema, String>
Expand description

Probe a binary for its schema by running <entry> --fdl-schema via the shell and parsing stdout as JSON.

cmd_dir is the directory containing the fdl.yml that declared the entry — it serves as the cwd for the shell unless the entry is wrapped through docker (then the wrap walks up to the nearest docker-compose.yml for compose’s cwd).

docker_service carries the docker: field from the resolved command config. When set AND we’re not already inside a container, the invocation is wrapped as docker compose run --rm <service> bash -c '<entry> --fdl-schema' so cargo entries that need libtorch get probed inside the dev container instead of failing silently on the host. When unset, the entry runs directly on the host.

On failure returns a string error rather than panicking — callers almost always want to fall back to the inline schema (or none).