Compare commits
2 Commits
d744c2cd16
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
0c4d36248a | ||
|
24fb72e932 |
@@ -15,10 +15,6 @@ path = "src/bin/runner_sal/main.rs"
|
|||||||
name = "runner_osis"
|
name = "runner_osis"
|
||||||
path = "src/bin/runner_osis/main.rs"
|
path = "src/bin/runner_osis/main.rs"
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "test_sync_runner"
|
|
||||||
path = "test_sync_runner.rs"
|
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "engine"
|
name = "engine"
|
||||||
path = "examples/engine.rs"
|
path = "examples/engine.rs"
|
||||||
|
@@ -4,7 +4,6 @@ use std::panic;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use rhai::{Engine, Dynamic};
|
use rhai::{Engine, Dynamic};
|
||||||
|
|
||||||
use runner_rust::AsyncRunner;
|
|
||||||
|
|
||||||
/// Recursively collect all .rhai files from a directory and its subdirectories
|
/// Recursively collect all .rhai files from a directory and its subdirectories
|
||||||
fn collect_rhai_files(dir: &Path, files: &mut Vec<std::path::PathBuf>) -> Result<(), Box<dyn std::error::Error>> {
|
fn collect_rhai_files(dir: &Path, files: &mut Vec<std::path::PathBuf>) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
@@ -1,75 +1,16 @@
|
|||||||
use std::sync::{Arc, OnceLock};
|
use std::sync::{Arc, OnceLock};
|
||||||
// Re-export common Rhai types for convenience
|
// Re-export common Rhai types for convenience
|
||||||
pub use rhai::{Array, Dynamic, Engine, EvalAltResult, Map};
|
pub use rhai::Engine;
|
||||||
|
|
||||||
// Re-export specific functions from sal-os package
|
// Re-export specific functions from sal-os package
|
||||||
pub use sal_os::rhai::{
|
|
||||||
delete,
|
|
||||||
// Download functions
|
|
||||||
download,
|
|
||||||
download_install,
|
|
||||||
// File system functions
|
|
||||||
exist,
|
|
||||||
file_size,
|
|
||||||
find_dir,
|
|
||||||
find_dirs,
|
|
||||||
find_file,
|
|
||||||
find_files,
|
|
||||||
mkdir,
|
|
||||||
register_os_module,
|
|
||||||
rsync,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Re-export Redis client module registration function
|
// Re-export Redis client module registration function
|
||||||
pub use sal_redisclient::rhai::register_redisclient_module;
|
|
||||||
|
|
||||||
// Re-export PostgreSQL client module registration function
|
// Re-export PostgreSQL client module registration function
|
||||||
pub use sal_postgresclient::rhai::register_postgresclient_module;
|
|
||||||
|
|
||||||
pub use sal_process::rhai::{
|
|
||||||
kill,
|
|
||||||
process_get,
|
|
||||||
process_list,
|
|
||||||
register_process_module,
|
|
||||||
// Run functions
|
|
||||||
// Process management functions
|
|
||||||
which,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Re-export virt functions from sal-virt package
|
// Re-export virt functions from sal-virt package
|
||||||
pub use sal_virt::rhai::nerdctl::{
|
|
||||||
nerdctl_copy,
|
|
||||||
nerdctl_exec,
|
|
||||||
nerdctl_image_build,
|
|
||||||
nerdctl_image_commit,
|
|
||||||
nerdctl_image_pull,
|
|
||||||
nerdctl_image_push,
|
|
||||||
nerdctl_image_remove,
|
|
||||||
nerdctl_image_tag,
|
|
||||||
// Image functions
|
|
||||||
nerdctl_images,
|
|
||||||
nerdctl_list,
|
|
||||||
nerdctl_remove,
|
|
||||||
// Container functions
|
|
||||||
nerdctl_run,
|
|
||||||
nerdctl_run_with_name,
|
|
||||||
nerdctl_run_with_port,
|
|
||||||
nerdctl_stop,
|
|
||||||
};
|
|
||||||
pub use sal_virt::rhai::{
|
|
||||||
bah_new, register_bah_module, register_nerdctl_module, register_rfs_module,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub use sal_git::rhai::register_git_module;
|
|
||||||
pub use sal_git::{GitRepo, GitTree};
|
|
||||||
pub use sal_zinit_client::rhai::register_zinit_module;
|
|
||||||
pub use sal_mycelium::rhai::register_mycelium_module;
|
|
||||||
pub use sal_text::rhai::register_text_module;
|
|
||||||
pub use sal_net::rhai::register_net_module;
|
|
||||||
pub use sal_kubernetes::rhai::register_kubernetes_module;
|
|
||||||
pub use sal_kubernetes::KubernetesManager;
|
|
||||||
pub use sal_os::rhai::copy as os_copy;
|
|
||||||
pub use sal_hetzner::rhai::register_hetzner_module;
|
|
||||||
|
|
||||||
/// Engine factory for creating and sharing Rhai engines with SAL modules.
|
/// Engine factory for creating and sharing Rhai engines with SAL modules.
|
||||||
pub struct EngineFactory {
|
pub struct EngineFactory {
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
use chrono::{Utc};
|
use chrono::{Utc};
|
||||||
use redis::AsyncCommands;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
@@ -17,7 +17,7 @@ pub use engine::osis::{register_dsl_modules, create_osis_engine, create_shared_o
|
|||||||
// Re-export job types from local job module
|
// Re-export job types from local job module
|
||||||
pub use job::{Job, JobStatus, JobError, JobBuilder, Client};
|
pub use job::{Job, JobStatus, JobError, JobBuilder, Client};
|
||||||
pub use redis::AsyncCommands;
|
pub use redis::AsyncCommands;
|
||||||
use log::{debug, error, info};
|
use log::{error, info};
|
||||||
|
|
||||||
const BLPOP_TIMEOUT_SECONDS: usize = 5;
|
const BLPOP_TIMEOUT_SECONDS: usize = 5;
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::time::{timeout, sleep};
|
use tokio::time::timeout;
|
||||||
use crate::job::{JobBuilder, Client, JobStatus};
|
use crate::job::{JobBuilder, Client, JobStatus};
|
||||||
use log::{info, error};
|
use log::{info, error};
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
Reference in New Issue
Block a user