pub struct LegacyAdapter { /* private fields */ }Expand description
Adapter that invokes legacy shell scripts for component installation.
The adapter discovers the correct install_*.sh script from the component
registry and executes it via bash with correct argument forwarding.
§Script Discovery
For a component like pytorch, the adapter looks up the installer script
from the registry (e.g., install_pytorch_rocm.sh) and resolves it
relative to the configured scripts directory.
§Argument Forwarding
The adapter forwards the component version as an argument to the script:
bash <scripts_dir>/install_pytorch_rocm.sh <version>Some scripts may accept additional environment variables or flags; the adapter passes these through the process environment.
Implementations§
Source§impl LegacyAdapter
impl LegacyAdapter
Sourcepub fn new(scripts_dir: impl Into<PathBuf>) -> Self
pub fn new(scripts_dir: impl Into<PathBuf>) -> Self
Create a new legacy adapter with the given scripts directory.
Sourcepub fn resolve_script_path(&self, component_id: &str) -> Option<PathBuf>
pub fn resolve_script_path(&self, component_id: &str) -> Option<PathBuf>
Resolve the script path for a component ID.
Uses the component registry to find the installer script name, then resolves it relative to the scripts directory.
Sourcepub fn build_command(
&self,
component_id: &str,
version: &str,
) -> Result<Command, AdapterError>
pub fn build_command( &self, component_id: &str, version: &str, ) -> Result<Command, AdapterError>
Build the command for invoking the install script.
The command is: bash <script_path> <version>
Trait Implementations§
Source§impl Adapter for LegacyAdapter
impl Adapter for LegacyAdapter
Source§fn execute(
&self,
component_id: &str,
version: &str,
) -> Result<AdapterOutput, AdapterError>
fn execute( &self, component_id: &str, version: &str, ) -> Result<AdapterOutput, AdapterError>
Source§fn executor_kind(&self) -> ExecutorKind
fn executor_kind(&self) -> ExecutorKind
Auto Trait Implementations§
impl Freeze for LegacyAdapter
impl RefUnwindSafe for LegacyAdapter
impl Send for LegacyAdapter
impl Sync for LegacyAdapter
impl Unpin for LegacyAdapter
impl UnsafeUnpin for LegacyAdapter
impl UnwindSafe for LegacyAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more