pub struct PodProvisioner { /* private fields */ }Expand description
Pod provisioner for managing RunPod pods.
Implementations§
Source§impl PodProvisioner
impl PodProvisioner
Sourcepub fn new(client: RunPodClient) -> Self
pub fn new(client: RunPodClient) -> Self
Creates a new pod provisioner.
Sourcepub async fn init_gpu_types(&mut self) -> Result<()>
pub async fn init_gpu_types(&mut self) -> Result<()>
Initializes the GPU type mapping by fetching available types.
§Errors
Returns an error if the GPU types cannot be fetched.
Sourcepub async fn create_pod(
&self,
pod_config: &PodConfig,
project: &ProjectConfig,
spec_hash: &str,
) -> Result<Pod>
pub async fn create_pod( &self, pod_config: &PodConfig, project: &ProjectConfig, spec_hash: &str, ) -> Result<Pod>
Sourcepub async fn create_pod_with_setup(
&self,
pod_config: &PodConfig,
project: &ProjectConfig,
spec_hash: &str,
) -> Result<(Pod, Option<PostProvisionResult>)>
pub async fn create_pod_with_setup( &self, pod_config: &PodConfig, project: &ProjectConfig, spec_hash: &str, ) -> Result<(Pod, Option<PostProvisionResult>)>
Creates a pod and performs post-provisioning setup (model download, engine start).
§Errors
Returns an error if the pod cannot be created or setup fails.
Sourcepub async fn terminate_pod(&self, pod_id: &str) -> Result<()>
pub async fn terminate_pod(&self, pod_id: &str) -> Result<()>
Sourcepub async fn resume_pod(&self, pod_id: &str) -> Result<Pod>
pub async fn resume_pod(&self, pod_id: &str) -> Result<Pod>
Sourcepub async fn wait_for_status(
&self,
pod_id: &str,
expected_status: PodStatus,
timeout_secs: u64,
) -> Result<Pod>
pub async fn wait_for_status( &self, pod_id: &str, expected_status: PodStatus, timeout_secs: u64, ) -> Result<Pod>
Waits for a pod to reach a specific status.
§Errors
Returns an error if the timeout is reached or the API call fails.
Sourcepub const fn client(&self) -> &RunPodClient
pub const fn client(&self) -> &RunPodClient
Gets the underlying client reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PodProvisioner
impl !RefUnwindSafe for PodProvisioner
impl Send for PodProvisioner
impl Sync for PodProvisioner
impl Unpin for PodProvisioner
impl !UnwindSafe for PodProvisioner
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.