Documentation
¶
Overview ¶
Package local implements the in-process (local host) runner. It executes the resolved command as a child process via exec.CommandContext and streams its stdout/stderr straight into the writers the job service provides. See plan §6.3 (Stdout/Stderr local-only convention) and §9 (P4).
Index ¶
Constants ¶
const Name = "local"
Name is the runner identifier ("local").
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct{}
Runner runs commands as local child processes.
func (*Runner) Run ¶
Run executes req.Command with req.Args under ctx.
- The working directory is req.WorkDir (the job service passes a SafeJoin'd absolute host path).
- The environment is the process env (os.Environ) with req.Env layered on top, so agent-configured vars override inherited ones.
- Stdout/Stderr are wired directly to the provided writers (the job service's stdout.log / stderr.log files) for live streaming.
Exit handling: a zero exit yields ExitCode 0. A non-zero process exit is read from *exec.ExitError. A context cancel/timeout surfaces as a non-zero exit with Err set to ctx.Err(); the job service inspects the context reason to distinguish cancelled vs timeout. A failure to start the process returns a synthetic exit code (-1) with the start error.