Skip to main content

Module isolation

Module isolation 

Source
Expand description

Isolation Runners for start-command

Provides execution of commands in various isolated environments:

  • screen: GNU Screen terminal multiplexer
  • tmux: tmux terminal multiplexer
  • docker: Docker containers
  • ssh: Remote SSH execution

Re-exports§

pub use self::isolation_screen::get_screen_version;
pub use self::isolation_screen::supports_logfile_option;
pub use self::isolation_log::append_log_file;
pub use self::isolation_log::create_log_header;
pub use self::isolation_log::create_log_path;
pub use self::isolation_log::create_log_path_for_execution;
pub use self::isolation_log::generate_log_filename;
pub use self::isolation_log::get_default_docker_image;
pub use self::isolation_log::get_log_dir;
pub use self::isolation_log::get_temp_dir;
pub use self::isolation_log::get_temp_root;
pub use self::isolation_log::get_timestamp;
pub use self::isolation_log::write_log_file;
pub use self::isolation_log::LogHeaderParams;

Modules§

isolation_log
Logging and utility functions for isolation runners
isolation_screen
Screen-specific isolation helpers extracted from isolation.rs

Structs§

IsolationOptions
Options for isolation
IsolationResult
Result of an isolation run

Functions§

build_shell_with_args_cmd_args
Build argv for a shell-with-c command; everything after -c is joined as one argument. Reverses the join(’ ’) that collapsed the original quoted argument. Used to pass bash -i -c "nvm --version" directly as argv (issue #91 fix).
detect_shell_in_environment
Detect the best available shell in an isolation environment (docker/ssh) Tries shells in order: bash, zsh, sh Returns the shell path to use
docker_image_exists
Check if a Docker image exists locally
docker_pull_image
Pull a Docker image with output streaming
get_shell
Get the shell to use for command execution
has_tty
Check if the current process has a TTY attached
is_command_available
Check if a command is available on the system
is_interactive_shell_command
Returns true if command is a bare interactive shell invocation (no -c flag). Used to avoid double-wrapping shells in isolation environments (issue #84).
is_shell_invocation_with_args
Returns true if command is a shell invocation that includes -c (e.g. bash -i -c "cmd"). Used to pass such commands directly without double-wrapping (issue #91).
run_as_isolated_user
Run command as an isolated user (without isolation backend)
run_in_docker
Run command in Docker container
run_in_screen
Run command in GNU Screen
run_in_ssh
Run command over SSH
run_in_tmux
Run command in tmux
run_isolated
Run command in the specified isolation backend
wrap_command_with_user
Wrap command with sudo -u if user option is specified