Runner for Workflows Defined in AskUI Studio.
- Python 3.10 or higher
- Node.js 16 or higher
We recommend using a virtual environment for Python. Make sure python --version returns 3.10 or higher:
python -m venv venv
source venv/bin/activateWe have not yet published the AskUI Runner to PyPI. For now, you can install it directly from GitHub:
pip install git+https://github.com/askui/askui-runner.gitCurrently, the standard logging output of the AskUI runner is minimal - we are soon going to change that. But you should see the runner starting the running of workflows as soon as you schedule some runs through the AskUI Studio.
Create a configuration file (.y{a}ml or .json) in a directory of your choosing. The configuration file should contain at least some credentials and the command with which you start the runner without the config file flag:
runner:
exec: python -m askui_runner # update if your command is different
tags: [<tag 1>, <tag 2>, ..] # replace with your own runner tags
queue:
api_url: https://workspaces.askui.com/api/v1/runner-jobs
credentials:
workspace_id: <workspace id> # replace with your workspace id
access_token: <access token> # replace with your access tokenSee Generating up-to-date Configuration Schema
Start the runner using
python -m askui_runner start -c <path to your config file, e.g., askui-runner.config.yaml>If you want to run your workflows on the same system as the runner you need to start an UiController that listens on port 6769. Please download the one for your operating system and start it:
- For Windows please use our AskUI Installer: Windows Getting Started
- Linux
βΉοΈ macOS After installation to
Applicationsremove the quarantine flag with the following command run from a terminal:xattr -d com.apple.quarantine /Applications/askui-ui-controller.app
You can change the UiController-URL so the runner can talk to a UiController that runs on a remote machine or on a different port:
...
runner:
...
controller:
host: "127.0.0.1"
port: 7000Requirements:
- PDM 2.8 or higher for contributing and creating the JSON schema of the config
Find out about all configuration options by taking a look at the JSON schema of the configuration. You can generate an up-to-date JSON schema by cloning this repository and running the following commands.
## Install and initialize pdm
pip install pdm
pdm install
pdm run python -m scripts.generate_config_schema_jsonThe Agent sync command helps sync agent files between local and remote storage. You can specify the direction (up or down) for syncing and control other sync options.
python -m askui_runner agent sync <parameters>- Parameters:
--config: Path to your config file in .json, .yaml, or .yml format or a raw JSON config.- direction: The direction of the sync:
down: Sync files from remote storage to local.up: Sync files from local storage to remote.
--dry: Display the operations that would be performed without executing them.--delete: Delete files not found in the source of truth during sync.--help: Display the help message.
example:
# Sync agent files from remote storage to local in dry-run mode.
python -m askui_runner agent sync down --config askui-runner.config.yaml --dryThe sync command requires a configuration file to be passed in. The configuration file should contain the following fields:
{
"credentials": {
"workspace_id": "<workspace_id>",
"access_token": "<access_token>"
}
}To display the configuration schema, run the following command:
python -m askui_runner agent print-config-schemaYou can configure the logging behavior of the AskUI Runner through environment variables:
# Set logging level
export ASKUI_RUNNER__LOG__LEVEL=INFO # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
# Set custom log format
export ASKUI_RUNNER__LOG__FORMAT="%(asctime)s - %(levelname)s - %(message)s"The default logging level is INFO and the default format is %(asctime)s - %(levelname)s - %(message)s. The log format is a Python logging format string. Check the link for more information on how to customize the log format and which attributes, e.g., asctime and levelname, are available.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository.
- Create a new branch:
git checkout -b your-feature-name - Commit your changes:
git commit -am 'Add some feature' - Push the branch:
git push origin your-feature-name - Submit a pull request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
