pub struct CommandSpec {
pub description: Option<String>,
pub run: Option<String>,
pub path: Option<String>,
pub docker: Option<String>,
pub ddp: Option<DdpConfig>,
pub training: Option<TrainingConfig>,
pub output: Option<OutputConfig>,
pub options: BTreeMap<String, Value>,
}Expand description
A command at any nesting level. Three mutually-exclusive kinds are recognised at resolve time:
- Path (
pathset, or by default when the map is empty/null): the command is a pointer to a childfdl.yml. By convention the path is./<command-name>/when omitted. - Run (
runset): the command is a self-contained shell script that is executed as-is. Optionaldocker:service routes it throughdocker compose. - Preset: neither
pathnorrunis set. The command merges itsddp/training/output/optionsfields over the enclosingCommandConfigdefaults and invokes that config’sentry:.
Fields§
§description: Option<String>§run: Option<String>Inline shell command. Mutex with path.
path: Option<String>Pointer to a child directory containing its own fdl.yml. Absolute
or relative to the declaring config’s directory. Mutex with run.
None + no other fields = “use the convention path
./<command-name>/”.
docker: Option<String>Docker compose service for run-kind commands.
ddp: Option<DdpConfig>Preset overrides. Only consulted when neither run nor path is set.
training: Option<TrainingConfig>§output: Option<OutputConfig>§options: BTreeMap<String, Value>Implementations§
Source§impl CommandSpec
impl CommandSpec
Sourcepub fn kind(&self) -> Result<CommandKind, String>
pub fn kind(&self) -> Result<CommandKind, String>
Classify this command. Returns an error when both run and path
are declared — always a mistake, caught loudly rather than silently
picking one. Also rejects docker: without run:: the docker
service wraps the inline run-script, so pairing it with a path:
pointer or a preset entry is always silent-noop territory.
Sourcepub fn resolve_path(&self, name: &str, parent_dir: &Path) -> PathBuf
pub fn resolve_path(&self, name: &str, parent_dir: &Path) -> PathBuf
Resolve the effective directory for a Path-kind command declared
in parent_dir. Applies the ./<name>/ convention when path is
unset.
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more