Deployment
The easiest way to run an AEA is using your development environment.
If you would like to run an AEA from a browser you can use Google Colab. This gist can be opened in Colab and implements the quick start.
For deployment, we recommend you use Docker.
Deployment using a Docker Image
First, we fetch a directory containing a Dockerfile and some dependencies:
svn export https://github.com/valory-xyz/open-aea/branches/main/deploy-image
cd deploy-image
Then follow the README.md
contained in the folder.
Deployment using Kubernetes
For an example of how to use Kubernetes navigate to our TAC deployment example.
Deployment using a binary
For making an executable binary of your aea
agent:
-
Create a python file which imports the necessary
aea
modules, and executes the CLIaea
entrypoint. For exampleaea_entrypoint.py
:"""Script for building the AEA responsible for running an agent.""" import os import sys from pathlib import Path import aea.configurations.validation as validation_module # patch for the _CUR_DIR value # we need this because pyinstaller generated binaries handle paths differently validation_module._CUR_DIR = Path(sys._MEIPASS) / validation_module._CUR_DIR validation_module._SCHEMAS_DIR = os.path.join(validation_module._CUR_DIR, "schemas") from aea.cli.core import cli from google.protobuf.descriptor_pb2 import FileDescriptorProto from aea.mail.base_pb2 import DESCRIPTOR from multiaddr.codecs.idna import to_bytes as _ from multiaddr.codecs.uint16be import to_bytes as _ from aea_ledger_ethereum.ethereum import * from aea_ledger_cosmos.cosmos import * from aea.crypto.registries.base import * if __name__ == "__main__": cli(prog_name="aea") # pragma: no cover
-
Ensure you have all the dependencies installed in your virtual environment, including
pyinstaller
. -
Use
pyinstaller
to generate the binary. For example:pyinstaller --collect-all gql --collect-all hypothesis --collect-all pycoingecko --collect-all scipy --hidden-import numpy --collect-all pandas --collect-all pyfolio --collect-all twitter_text --collect-all google.generativeai --collect-all peewee --collect-data eth_account --collect-all autonomy --collect-all operate --collect-all aea_ledger_ethereum --collect-all aea_ledger_cosmos --collect-all aea_ledger_ethereum_flashbots --hidden-import aea_ledger_ethereum --hidden-import aea_ledger_cosmos --hidden-import aea_ledger_ethereum_flashbots --hidden-import grpc --hidden-import openapi_core --collect-all google.protobuf --collect-all openapi_core --collect-all openapi_spec_validator --collect-all asn1crypto --hidden-import py_ecc --hidden-import pytz --collect-all twikit --collect-all twitter_text_parser --collect-all textblob --collect-all backports.tarfile --collect-all js2py --onefile aea_entrypoint.py --name aea_bin --collect-all aea
Refer to pyinstaller docs for more details, or check the Pearl's example.