mod cleanup;
mod display;
mod download;
mod logs;
mod ops;
mod run;
mod status;
use crate::config::Config;
pub use cleanup::{CancelJobsOptions, CleanJobsOptions, cancel_jobs, clean_jobs};
pub use download::download_outputs;
pub use logs::{ShowLogsOptions, show_logs};
pub use ops::{ping_cluster, show_stats, wait_for_job};
pub use run::{
RunJobOptions, cancel_remote_direct_job, exec_command, get_remote_direct_job_status, rerun_job,
run_job,
};
pub use status::{StatusOptions, list_tags, note_job, show_status};
pub fn workspace_path(config: &Config) -> String {
format!(
"{}/{}/.fleche/workspace",
config.remote.base_path, config.project_name
)
}
pub fn jobs_base_path(config: &Config) -> String {
format!(
"{}/{}/.fleche/jobs",
config.remote.base_path, config.project_name
)
}
pub fn job_path(config: &Config, job_id: &str) -> String {
format!("{}/{}", jobs_base_path(config), job_id)
}
pub fn jobs_base_from_workspace(workspace: &str) -> String {
format!("{}/jobs", workspace.trim_end_matches("/workspace"))
}
pub fn job_path_from_workspace(workspace: &str, job_id: &str) -> String {
format!("{}/{}", jobs_base_from_workspace(workspace), job_id)
}