Skip to main content

WorkerSource

Struct WorkerSource 

Source
pub struct WorkerSource {
    pub from: String,
    pub cwd: Option<String>,
    pub build: Option<String>,
    pub bin: Option<String>,
}
Expand description

join.source: — build the training binary on this box.

A tree always lands on LOCAL disk before it is built, whatever the transport: cargo fingerprints by stat’ing every source file on every invocation, so compiling over a network mount pays that latency thousands of times, and the attribute caching that would hide the latency makes cargo serve a stale binary. The fetch preserves mtimes, which is what keeps the loop incremental rather than a cold rebuild wearing an incremental costume.

Fields§

§from: String

Transport plus location. Three ship:

file:///abs/path                      a directory on this box (a mount, a disk)
rsync://[user@]host[:port]:/abs/path  a working tree over ssh
git+https://host/owner/repo#<ref>     a pinned checkout (also git+ssh://)

rsync is the one that carries UNCOMMITTED work, which is what a training crate living in no repo at all needs. git+ wants a ref (#<tag|branch|sha>) because a default branch floats, and a floating ref is not a pin.

§cwd: Option<String>

Project directory inside the fetched tree (default: its root). Governs the build and the run both, so it answers “where is the project in this tree” exactly once. A path dep pointing outside this directory still resolves, which is why the fetched tree has to be the dep root and not just the crate.

§build: Option<String>

Build recipe, run as a shell line in cwd. Default: cargo build --release, which is right whenever the crate carries its own Cargo.toml, lockfile and rust-toolchain.toml — the usual case for a crate that builds on the operator’s own box.

It can be a script committed beside the code (./ci/node-build.sh), so the recipe travels with the source while its invocation stays here. fdl exports what it resolved: LIBTORCH_PATH, FDL_GPU_FEATURE (say --features "$FDL_GPU_FEATURE" rather than naming a vendor) and LD_LIBRARY_PATH.

It re-runs on every dial, so it must be cheap when nothing changed. cargo is; a recipe that rebuilds unconditionally is not.

§bin: Option<String>

Built artifact, relative to cwd (e.g. target/release/train). Not guessed: cargo build in a workspace member writes to the WORKSPACE target/, not the member’s, so any rule fdl invented would be wrong for someone.

Optional because a published tree carries a run manifest that names it, and that manifest is the authority when present. Declare it here for a box the operator drives by hand.

Trait Implementations§

Source§

impl Clone for WorkerSource

Source§

fn clone(&self) -> WorkerSource

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkerSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WorkerSource

Source§

fn default() -> WorkerSource

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WorkerSource

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for WorkerSource

Source§

impl PartialEq for WorkerSource

Source§

fn eq(&self, other: &WorkerSource) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WorkerSource

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.