Agents are configured using a YAML file. If you’re totally new to YAML files, you can
learn more about them here.
In Alto, you can augment your YAML configuration files and Python tasks using Jinja, a
powerful templating language. For example, using Jinja enables you to:
Create relative variables (e.g., relative paths)
Use environment variables for production deployments
{{ __platform__ }} returns the operating system on which your project is running. It’s
identical to sys.platform. You probably won’t use this much in your projects.
Example:
alto.yml
"my-agent-{{ platform }}": infra:type: ec2...
{{ __version__ }} returns the Python version on which your project is running, in
the format "{major}.{minor}.{micro}". As with __platform__, you probably won’t use
this much in your projects.
Example:
alto.yml
"my-agent-{{ version }}": infra:type: ec2...
{{ __file__ }} allows you to access the the path to the YAML file.
{{ Path(...) }} allows you convert any string to a pathlib
Path object. When using this Jinja
function, users also get access to Path’s methods and operators.
{{ __file__ }} and {{ Path(...) }} can be used together to define relative paths.