# aci-pilot





> Pilot implementation for Azure Container Instances deployment automation
## table of contents
- [install](#install)
- [usage](#usage)
- [api](#api)
- [contributing](#contributing)
- [license](#license)
## install
```bash
pip install aci-pilotOr from source:
git clone https://github.com/yourusername/aci-pilot.git
cd aci-pilot
pip install -e .Basic deployment:
from aci_pilot import ACIDeployer
deployer = ACIDeployer(
subscription_id="your-subscription-id",
resource_group="my-rg",
location="eastus"
)
# Deploy a container
container = deployer.deploy(
name="my-app",
image="nginx:latest",
cpu=1.0,
memory=1.5,
ports=[80, 443]
)
print(f"Container deployed at {container.ip_address}")Using configuration file:
from aci_pilot import ACIDeployer
deployer = ACIDeployer.from_config("config.yaml")
deployer.deploy_all()Example config.yaml:
subscription_id: "your-subscription-id"
resource_group: "my-rg"
location: "eastus"
containers:
- name: "web-app"
image: "myregistry.azurecr.io/webapp:latest"
cpu: 2.0
memory: 4.0
ports: [80, 443]
env:
DATABASE_URL: "postgres://..."Main class for managing ACI deployments.
Parameters:
subscription_id(str): Azure subscription IDresource_group(str): Resource group namelocation(str): Azure regioncredentials(optional): Azure credentials object
Methods:
Deploy a single container instance.
Returns: Container instance object with ip_address, fqdn, and state attributes.
Delete a container instance by name.
List all container instances in the resource group.
Returns: List of container instance objects.
Retrieve container logs.
Returns: String containing log output.
Restart a container instance.
Class method to create deployer from YAML config file.
Parameters:
path(str): Path to configuration file
Returns: Configured ACIDeployer instance.
prs welcome. open an issue first for big changes.
Run tests:
pytest tests/Format code:
black .
isort .MIT