The factory.core/ObjHost.py script provides a command-line interface for managing a wide range of infrastructure components, including local Docker containers, AWS EC2 instances, and Proxmox LXC containers. It acts as an orchestrator for ensuring services are running and provides visibility into cloud and on-premise resources.
The script is built around the ObjHost class and uses typer to provide a clean command-line interface.
run_script(script_path, sudo=False): A generic method to execute any shell script. It handles making the script executable and capturing its output.ensure_container_running(container_name, script_path): Checks if a Docker container is running and starts it if not.display_running_containers(): Prints a formatted table of all currently running Docker containers.list_ec2_instances(tag: str = None): Lists all EC2 instances, optionally filtering by a Client tag.instance_details(instance_id: str): Displays the tags for a specific EC2 instance.update_servers_yaml(package_name: str = None): Updates a servers.yaml file with the latest data from EC2.list_ec2_packages(): Lists all unique Client tags found across all EC2 instances.list_lxc_containers(tag: str = None): Lists all LXC containers on a Proxmox server, optionally filtering by a tag.All commands are executed from the project root directory.
To start all required local Docker services (InfluxDB, RabbitMQ, etc.), run:
python factory.core/ObjHost.py services
List EC2 Instances:
python factory.core/ObjHost.py ec2-list
python factory.core/ObjHost.py ec2-list --tag <your-tag>
Get Instance Details:
python factory.core/ObjHost.py ec2-details --instance-id <your-instance-id>
Update servers.yaml:
python factory.core/ObjHost.py ec2-update-servers
python factory.core/ObjHost.py proxmox-lxc-list
python factory.core/ObjHost.py proxmox-lxc-list --tag <your-tag>
resource.bin/ are configured via the terraform: section of the main config.yaml.aws: section of config.yaml.proxmox: section of config.yaml.cythonize -3 -a -i ObjHost.py
Compiling /home/axion/projects/axion/factory.core/ObjHost.py because it changed..[1/1] Cythonizing /home/axion/projects/axion/factory.core/ObjHost.py
Updated : 2025-10-22