Mod Dependencies
Powerpipe mods may depend on other mods, allowing you to quickly and easily extend them with additional features and functionality.
To add a dependency, run powerpipe mod install from the root directory of your mod, specifying the path to the mod's Github repo:
This will install the mod into the .powerpipe sub-directory, and will add the dependency to the require block of your mod.pp file:
You can then create new .pp files in your mod that reference the resources in the dependency mods. You can create your own controls that use query resources from the dependency mod:
Or create your own dashboards or benchmarks that reference resources from your own mod or any dependencies:
You can add, remove, and update your dependencies with the powerpipe mod command.
You can run the benchmarks in your mod:
When in a mod folder, you can run the dependent controls and benchmarks by qualifying them with the mod name:
When running powerpipe server from a mod, all dashboards in your mod and its direct dependencies will be available to run.
Installing Mods
Git URLs & Private Repos
Powerpipe uses git to install and update mods. When you run powerpipe mod install or powerpipe mod update, Powerpipe will first try using HTTPS and if that does not work it will try SSH. If your SSH keys are configured properly for git, you should be able to pull from private repos that you have access to, as well as public ones. Alternatively, you can authenticate with a GitHub personal access token or application token. Set the POWERPIPE_GIT_TOKEN environment variable to your token and Powerpipe will use the token when installing and updating mods.
Mod Version Constraints
When installing a mod, you may specify a semver constraint. The latest version that meets the constraint will be installed, and the constraint will be added to the mod.pp and honored by subsequent steampipe mod update operations.
When installing the mod, append the mod repo with @ and any valid semver constraint:
Installing from Branches and Tags
To install from a tagged commit, append the mod repo with @ and the tag:
Note that the syntax is the same as for semver constraints, and if the tag value is a valid semver string, Powerpipe will interpret it as a semver constraint and not a literal tag name.
To install from a branch, append the mod repo with # and the branch name:
Installing from the local filesystem
When developing mods, it can be useful to work from a local copy. To install a mod from a local filesystem path, just pass the path to the install command:
Update Strategy
It is also possible to have more granular control of the update behavior - e.g. when to check for new commits. The --pull argument can be used to specify the update strategy when running powerpipe update or powerpipe install:
Strategy | Description |
---|---|
full | Check branches and tags for both latest and accuracy |
latest | Update everything to latest, but only branches (not tags) are commit checked |
development | Update branches and broken constraints to latest, leave satisfied constraints unchanged |
minimal | Only update broken constraints. Do not check branches for new commits |
Publishing & Distributing mods
When publishing public mods, you should only depend on public mods (hosted in public repos) so that users of your mod don't encounter permissions issues - Avoid dependencies on local or private mods!
When users install your mod using powerpipe mod install, your dependencies will get installed automatically. As a result, it is recommended that you add the .powerpipe directory to your .gitignore file and do not check these files into git.