Expand description
Akash Deploy Library
Standalone, trait-based deployment workflow engine for Akash Network.
§Design
This library provides the deployment workflow logic without coupling to
any specific storage, signing, or transport implementation. You implement
the AkashBackend trait with your infrastructure, and the workflow
engine handles the state machine.
§Usage
ⓘ
use akash_deploy_rs::{
AkashBackend, DeploymentState, DeploymentWorkflow, WorkflowConfig, StepResult,
};
// Implement AkashBackend for your infrastructure
struct MyBackend { /* ... */ }
impl AkashBackend for MyBackend { /* ... */ }
// Create workflow
let backend = MyBackend::new();
let signer = MySigner::new();
let config = WorkflowConfig::default();
let workflow = DeploymentWorkflow::new(&backend, &signer, config);
// Create state
let mut state = DeploymentState::new("session-1", "akash1...")
.with_sdl(sdl_content)
.with_label("my-deploy");
// Run to completion
match workflow.run_to_completion(&mut state).await? {
StepResult::Complete => println!("Deployed!"),
StepResult::NeedsInput(input) => { /* handle user input */ },
StepResult::Failed(reason) => println!("Failed: {}", reason),
_ => {}
}Re-exports§
pub use auth::certificate::decrypt_key;pub use auth::certificate::encrypt_key;pub use auth::certificate::generate_certificate;pub use auth::certificate::GeneratedCertificate;pub use auth::jwt::CachedJwt;pub use auth::jwt::JwtBuilder;pub use auth::jwt::JwtClaims;pub use auth::jwt::JwtLeases;pub use error::DeployError;pub use manifest::canonical::to_canonical_json;pub use manifest::manifest::ManifestBuilder;pub use manifest::manifest::ManifestCpu;pub use manifest::manifest::ManifestCredentials;pub use manifest::manifest::ManifestGpu;pub use manifest::manifest::ManifestGroup;pub use manifest::manifest::ManifestHttpOptions;pub use manifest::manifest::ManifestMemory;pub use manifest::manifest::ManifestResourceValue;pub use manifest::manifest::ManifestResources;pub use manifest::manifest::ManifestService;pub use manifest::manifest::ManifestServiceExpose;pub use manifest::manifest::ManifestServiceParams;pub use manifest::manifest::ManifestStorage;pub use manifest::manifest::ManifestStorageParams;pub use sdl::template::apply_template;pub use sdl::template::extract_variables;pub use sdl::template::validate_template;pub use sdl::template::SdlTemplate;pub use sdl::template::TemplateDefaults;pub use sdl::template::TemplateVariables;pub use state::DeploymentState;pub use state::Step;pub use store::SessionStorage;pub use store::DeploymentRecord;pub use store::DeploymentStore;pub use traits::AkashBackend;pub use workflow::DeploymentWorkflow;pub use workflow::InputRequired;pub use workflow::StepResult;pub use workflow::WorkflowConfig;pub use types::*;
Modules§
- auth
- error
- Error types for Akash deployment workflow.
- gen
- Generated Akash Network protobuf types
- manifest
- sdl
- state
- Deployment state machine definition.
- store
- Persistence layer for deployments and sessions.
- traits
- The One Trait: AkashBackend
- types
- Minimal domain types for Akash deployment workflow.
- workflow
- Deployment Workflow Engine