Welcome to the Opni contributing guide. The following instructions should help you get started with Opni development.
Linux is the only supported OS. Mac users should use a Linux VM, EC2 instance, codespace, or similar for development.
VSCode, Goland, and Neovim are all good choices for an editor. Our team uses all three; it is mostly personal preference.
We use mage
as a build tool. for more information and download instructions visit https://magefile.org.
For CI, we use a tool called Dagger, which is a programmable CI system that lets you develop your pipelines as code. Dagger is used for all CI tasks, including building/deploying container images, helm charts, and more. For more information and download instructions visit https://docs.dagger.io.
It is highly recommended, though not required, to install protols and the associated vscode extension. Protols is a language server and toolchain for protobuf files. It is used in Opni to build and generate code, and makes working with protobuf APIs significantly easier.
To install it, follow the instructions in the protols README. You should then be able to open any protobuf file in the Opni codebase and interact with the code as you would with any other lsp-enabled language.
See also: https://github.com/rancher/opni/wiki/Protols-Tips
To list available targets and their descriptions, run mage -l
. You can run mage
with no arguments to run the default target (generate + build) or you can run mage <target>
to run a specific target.
Once Dagger is installed, run mage dagger:help
(or go run ./dagger --help
) for more info about how to configure and run dagger pipelines.
All of the main Opni components can be run locally for development and testing. The test fixture we use in our integration tests is available as a standalone binary which runs the Opni components (gateway, agents, cortex, prometheus, otel collector, etc.) locally and/or in-process. The test environment can be started by running mage test:env
. Once it starts, it will display a list of available commands that can be triggered using keyboard shortcuts.
If you encounter any problems or have any questions about contributing to Opni, don't hesitate to create a new issue or reach out to us on the Rancher Users Slack.