Fargate
Warning
This deployment is currently in alpha stage. Expect breaking changes.
AWS Resource Cleanup
The Fargate deployment creates several AWS resources that persist even after your deployment stops. These resources include:
- ECS Clusters
- Task Definitions
- Security Groups
- IAM Roles
All resources created by the Fargate deployment are tagged with origin=swe-rex-deployment-auto
for tracking purposes.
Cleaning Up Resources
To clean up all AWS resources created by the Fargate deployment, you can use the built-in teardown utility:
python -m swerex.utils.aws_teardown
This utility will:
- Preview all resources tagged with
origin=swe-rex-deployment-auto
- Request confirmation before deletion
- Delete resources in the correct order to handle dependencies
- Provide status updates during the cleanup process
Tip
It's recommended to run the teardown utility periodically to avoid accumulating unused AWS resources, which may incur costs. Running the fargate deployment again will recreate the necessary resources on the fly.
swerex.deployment.fargate.FargateDeployment
FargateDeployment(*, logger: Logger | None = None, **kwargs: Any)
Bases: AbstractDeployment
Source code in swerex/deployment/fargate.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
container_name
property
container_name: str | None
logger
instance-attribute
logger = logger or get_logger('rex-deploy')
runtime
property
runtime: RemoteRuntime
Returns the runtime if running.
Raises:
Type | Description |
---|---|
DeploymentNotStartedError
|
If the deployment was not started. |
add_hook
add_hook(hook: DeploymentHook)
Source code in swerex/deployment/fargate.py
52 53 |
|
from_config
classmethod
from_config(config: FargateDeploymentConfig) -> Self
Source code in swerex/deployment/fargate.py
55 56 57 |
|
is_alive
async
is_alive(*, timeout: float | None = None) -> IsAliveResponse
Checks if the runtime is alive. The return value can be tested with bool().
Raises:
Type | Description |
---|---|
DeploymentNotStartedError
|
If the deployment was not started. |
Source code in swerex/deployment/fargate.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
start
async
start()
Starts the runtime.
Source code in swerex/deployment/fargate.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
stop
async
stop()
Stops the runtime.
Source code in swerex/deployment/fargate.py
164 165 166 167 168 169 170 171 172 173 |
|