
Execute a command in one of the warm-pool containers
landis_pool_exec.RdRuns docker exec --workdir <workdir> <container> <command> <args> in the
container at index idx of pool. Captures stdout/stderr to disk if requested.
Each invocation is a fresh dotnet process in the container – no in-process
state from prior calls carries over – and the per-trial working directory
isolates output files.
Usage
landis_pool_exec(
pool,
idx,
workdir,
command,
args = character(),
timeout_sec = NULL,
stdout_log = NULL,
stderr_log = NULL,
extra_env = NULL,
retries = 0L
)Arguments
- pool
A
landis_poolobject fromlandis_pool_start().- idx
Integer. 1-based container index within the pool.
- workdir
Character. Working directory INSIDE the container (i.e., under
/scratch/). Must correspond to a host path underpool$scratch_root.- command
Character. Executable to run in the container (e.g., "dotnet").
- args
Character vector. Arguments passed to
command.- timeout_sec
Numeric or NULL. Maximum wait time. NULL = no timeout.
- stdout_log, stderr_log
Character or NULL. Paths to write captured output.
- extra_env
Named character. Extra environment variables to set via
--env. Default setsHOME=/tmpandDOTNET_BUNDLE_EXTRACT_BASE_DIRto a unique-per-call tempdir, isolating dotnet's per-user caches between trials.- retries
Integer >= 0. If the exec command fails with a non-zero exit status, restart the container via
landis_pool_restart_one()and try again, up toretriesextra attempts. Default 0 = fail-fast (matches prior behaviour). Useful when long calibrations occasionally see container crashes (OOM, daemon hiccup) without wanting to abort.
Value
A list with status (integer exit code), elapsed_sec (numeric),
container (the container name), and attempts (1 + number of retries
actually consumed).
Details
For LANDIS-II calibration trials specifically, see sim_landis() which
wraps this with the trial-directory copy + dynamic-fire.txt patch logic.
See also
landis_pool_start(), landis_pool_stop(), landis_pool_restart_one()
Other LANDIS-II execution helpers:
host_cpu_info(),
landis_find(),
landis_find_docker(),
landis_pool_restart_one(),
landis_pool_start(),
landis_pool_stop(),
landis_replicate(),
landis_run_docker(),
landis_run_local(),
read_landis_resource_logs(),
tar_landis(),
write_landis_scenario_file()