Sailboxes vs. EC2 On-Demand: autosleep and billing
A sleeping Sailbox keeps its memory and files. A standard Sailbox can sleep after at least 30 seconds of idle time by default. The next command or file operation wakes it. Sail stops charging for CPU, RAM, and local disk during sleep. Separate Sail volumes still have storage charges. AWS charges the EC2 On-Demand instance rate while the instance runs, even when it is idle. Sail autosleep · Sail pricing · EC2 On-Demand pricingCreate the Sailbox
Install the Sail Python SDK on the machine that runs your controller. Runpython -m pip install sail. Sign in with sail auth login. Create one Sailbox per session. This example saves its ID in a local file. In your application, store the ID with the agent session.
Transfer files
Replace SCP with the Sail filesystem API. Run this code from the directory that containsworker.py and job.json. The example worker reads /tmp/job.json and writes /tmp/result.json inside the Sailbox. Use the paths your worker needs.