Validating Sandbox
-
Create
.env
(if you only intend to test sandbox, put dummy values on the RHS is enough):
Required fieldsOptional fields (shown here are the default values)1 2 3
API_BASE_URL=... BROKER_URI=amqp://... ACCESS_TOKEN=...
1 2 3 4
TASK_QUEUE=gpu/private/default CELERY_CONCURRENCY=1 WORKER_NAME=celery ZMQ_PORT=15921
-
Under
__main__.py
, rewrite paths instart_sandbox()
function, run that function.
NOTE:
- There are three
/
in the URL (i.e.file:///home/...
) - You need to use absolute path
Details
Referring to settings.py
, by default the sandbox will load security profile from profiles/aivle-base.profile
and the shell script to create new virtual environment will be scripts/create-venv.sh
, and the temporary folder will
be /tmp/aivle-worker
. You don't need to change the settings if you're happy with the defaults.
The basic steps aivle Worker takes to evaluate an agent in your task bundle are:
- Download and unzip task and agent archives
- Create a new virtual environment (and activate it)
pip install -r requirements.txt
(therefore in the root of your task bundle there must be arequirements.txt
)- Inside the sandbox, run
bash bootstrap.sh
(similarly,bootstrap.sh
comes from your task bundle)