A CLI for running Github Actions workflows that launch and manage Autonomi networks.
- Python 3.6 or higher
- Github personal access token with permission to run workflows
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
- Install the package in development mode:
pip install -e .
- Set up your personal access token:
export WORKFLOW_RUNNER_PAT=your_github_token_here
There are several commands for managing network workflows. All commands support the following global options:
--debug
: Enable debug logging--branch
: Specify the branch for the workflow (default: main)--force
: Skip confirmation prompts
- Launch a new network:
runner launch-network --path <workflow-inputs-file>
- Destroy an existing network:
runner destroy-network --path <workflow-inputs-file>
- Upscale an existing network:
runner upscale-network --path <workflow-inputs-file>
- List workflow runs:
runner ls [--details]
- List deployments:
runner deployment ls [--details]
Deployments are created when the launch-network
command is used.
- Stop nodes:
runner stop-nodes --path <workflow-inputs-file>
- Kill specific droplets:
runner kill-droplets --path <workflow-inputs-file>
- Upgrade network nodes:
runner upgrade-network --path <workflow-inputs-file>
- Upgrade node manager:
runner upgrade-node-man --path <workflow-inputs-file>
- Start telegraf:
runner start-telegraf --path <workflow-inputs-file>
- Stop telegraf:
runner stop-telegraf --path <workflow-inputs-file>
- Update peer multiaddr:
runner update-peer --path <workflow-inputs-file>
- Upgrade uploaders:
runner upgrade-uploaders --path <workflow-inputs-file>
Workflows are launched using a set of inputs. For each command, there is an example input file. For whatever command you want to use, take the example file corresponding to the command and adapt it for your use case. Remove whatever optional inputs you don't want to use.
Examples can be found in the example-inputs
directory:
launch_network.yml
: Configuration for launching a new networkdestroy_network.yml
: Configuration for destroying a networkupgrade_network.yml
: Configuration for upgrading network nodesupgrade_node_man.yml
: Configuration for upgrading the node managerupgrade_uploaders.yml
: Configuration for upgrading uploadersupscale_network.yml
: Configuration for upscaling a networkstart_telegraf.yml
: Configuration for starting telegrafstop_telegraf.yml
: Configuration for stopping telegrafstop_nodes.yml
: Configuration for stopping nodes
Each file contains detailed comments explaining the available options and their usage.
The tool maintains a local SQLite database at ~/.local/share/safe/workflow_runs.db
to track workflow runs and deployments.