eopod._utils#

class eopod._utils.EOConfig[source]#

Bases: object

Configuration manager for eopod.

ensure_config_dir()[source]#

Create configuration directory if it doesn’t exist.

get_credentials()[source]#

Get stored GCP credentials.

get_queued_resource()[source]#

Get stored queued resource name (if available).

load_config()[source]#

Load configuration from file.

save_command_history(command: str, status: str, output: str)[source]#

Save command to history.

save_config()[source]#

Save configuration to file.

save_error_log(command: str, error: str)[source]#

Save error details to error log.

set_credentials(project_id: str, zone: str, tpu_name: str, queued_resource: str | None = None)[source]#

Persist GCP credentials and optional queued resource.

setup_logging()[source]#

Setup logging configuration.

class eopod._utils.TPUManager(project_id: str, zone: str, tpu_name: str)[source]#

Bases: object

display_ips(ips: dict, ip_type: str, output_format: str = 'table')[source]#

Display IP addresses in the specified format.

async execute_command(command: str, worker: str = 'all', stream: bool = False, background: bool = False) tuple[source]#

Execute a command on TPU VM workers.

format_ips_comma_separated(ips: dict) str[source]#

Format IP addresses as a comma-separated string.

async get_external_ips() str[source]#

Get external IP addresses of TPU workers.

async get_internal_ips() dict[source]#

Get internal IP addresses of TPU workers.

async get_status() dict[source]#

Get TPU status information.

async get_tpu_details() dict[source]#

Fetch detailed information about the TPU.

async get_tpu_info() dict[source]#

Backward-compatible alias used by older call sites.

eopod._utils.async_command(fn)[source]#

Decorator to run async functions in CLI commands.

eopod._utils.find_eopod_in_current_env() Path[source]#

Return the absolute path to ‘eopod’ inside the current venv (or system).

eopod._utils.list2cmdline(seq)[source]#

Convert a sequence to a command line string (Windows compatible).

async eopod._utils.run_command(command, capture_output=False)[source]#

Run a command locally and return the result.