Skip to content

Commit aa84268

Browse files
JacksonMeiclaude
andauthored
update cli doc (#54)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1ee5af0 commit aa84268

4 files changed

Lines changed: 505 additions & 31 deletions

File tree

aenv/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "aenvironment"
7-
version = "0.1.2.post1"
7+
version = "0.1.3"
88
description = "AEnvironment Python SDK - Production-grade environment for AI agent tools"
99
readme = "README.md"
1010
requires-python = ">=3.10"

docs/getting_started/concepts.md

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,110 @@ This design achieves effective separation between **declarative definition** and
6262
└──────────────────────────┴───────────────────────────────┘
6363
```
6464

65+
## Environment Instance vs Environment Service
66+
67+
AEnvironment supports two deployment modes for different use cases:
68+
69+
### Environment Instance
70+
71+
**Purpose**: Temporary, on-demand compute resources for short-lived tasks.
72+
73+
**Key Characteristics:**
74+
75+
- **Time-to-Live (TTL)**: Automatic cleanup after specified duration (default: 30 minutes)
76+
- **Ephemeral**: Designed for temporary workloads
77+
- **Single Pod**: Runs as a single Kubernetes Pod
78+
- **No Persistence**: No built-in persistent storage support
79+
- **Auto-cleanup**: Automatically released when TTL expires or task completes
80+
- **Use Cases**:
81+
- Development and testing
82+
- CI/CD pipeline jobs
83+
- One-time data processing tasks
84+
- Temporary agent interactions
85+
86+
**Management Commands:**
87+
88+
```bash
89+
# Create temporary instance (auto-releases after TTL or command exit)
90+
aenv instance create myenv@1.0.0 --ttl 1h
91+
92+
# List running instances
93+
aenv instance list
94+
95+
# Delete instance
96+
aenv instance delete instance-id
97+
```
98+
99+
### Environment Service
100+
101+
**Purpose**: Long-running, production-grade deployments for persistent services.
102+
103+
**Key Characteristics:**
104+
105+
- **No TTL**: Runs indefinitely until explicitly deleted
106+
- **Multiple Replicas**: Support for horizontal scaling (1-N replicas)
107+
- **Persistent Storage**: Built-in PVC (PersistentVolumeClaim) support
108+
- **Kubernetes Service**: Cluster DNS service URL for load balancing
109+
- **High Availability**: Replica management for fault tolerance
110+
- **Production-Ready**: Designed for production workloads
111+
- **Use Cases**:
112+
- Production agent services
113+
- Long-running API servers
114+
- Stateful applications requiring persistent data
115+
- Multi-tenant service deployments
116+
117+
**Management Commands:**
118+
119+
```bash
120+
# Create persistent service with 3 replicas
121+
aenv service create myapp@1.0.0 --replicas 3
122+
123+
# Create service with persistent storage
124+
aenv service create myapp@1.0.0 --enable-storage
125+
126+
# List running services
127+
aenv service list
128+
129+
# Update service (scale, image, env vars)
130+
aenv service update service-id --replicas 5
131+
132+
# Delete service (keeps storage by default)
133+
aenv service delete service-id
134+
```
135+
136+
### Comparison Matrix
137+
138+
| Feature | Environment Instance | Environment Service |
139+
|---------|---------------------|---------------------|
140+
| **Lifetime** | Temporary (TTL-based) | Persistent (no TTL) |
141+
| **Replicas** | Single Pod | Multiple Replicas (1-N) |
142+
| **Storage** | No persistent storage | PVC support (optional) |
143+
| **Service URL** | Direct Pod IP | Cluster DNS service URL |
144+
| **Scaling** | Not supported | Horizontal scaling supported |
145+
| **Use Case** | Development, testing, short tasks | Production, long-running services |
146+
| **Auto-cleanup** | Yes (TTL or manual) | No (manual deletion only) |
147+
| **Resource Isolation** | Pod-level | Deployment + Service |
148+
| **Cost Model** | Pay per use (TTL-based) | Continuous running |
149+
150+
### When to Use Which?
151+
152+
**Choose Environment Instance when:**
153+
154+
- Running temporary development or test workloads
155+
- Executing one-time data processing jobs
156+
- Testing environment configurations
157+
- Running CI/CD pipeline steps
158+
- Need automatic resource cleanup
159+
160+
**Choose Environment Service when:**
161+
162+
- Deploying production applications
163+
- Need high availability and load balancing
164+
- Require persistent data storage
165+
- Running long-term agent services
166+
- Need to scale horizontally
167+
- Require predictable service endpoints
168+
65169
### Environment
66170

67171
An environment is a **static definition** that contains all metadata, configuration items, and component declarations required for agent operation. It describes what capabilities the environment "possesses" and what resources it "needs", but contains no runtime state.
@@ -74,7 +178,7 @@ An environment is a **static definition** that contains all metadata, configurat
74178
- **Immutability**: Once published, the environment definition content is typically immutable, with evolution managed through versioning.
75179
- **Reusability**: The same environment definition can be shared and referenced by multiple environment instances.
76180

77-
### Environment Instance
181+
### Environment Instance (Detailed)
78182

79183
An environment instance is the **concrete runtime entity** of an environment template. When an environment is actually used, the system dynamically creates corresponding instances based on its definition.
80184

0 commit comments

Comments
 (0)