Before getting started with the development of the CloudZero Agent Validator, make sure you have the following prerequisites installed on your system:
-
Protocol buffer compiler,
protoc, version 3. -
Go plugins for the protocol compiler:
-
Install the protocol compiler plugins for Go using the following commands:
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
-
Update your
PATHso that theprotoccompiler can find the plugins:$ export PATH="$PATH:$(go env GOPATH)/bin"
-
To quickly get started with the development of the CloudZero Agent Validator, follow these steps:
-
Clone the repository:
$ git clone https://github.com/Cloudzero/cloudzero-agent-validator.git
-
Change to the project directory:
$ cd cloudzero-agent-validator
-
Install the project dependencies:
$ go mod download
-
Generate the status protobuf definition package:
$ make generate
-
Build the binary:
$ make build
To run the go formatter, go linter, unit tests to verify code changes, use the following command:
make fmt lint testSeveral workflows are defined in the .github/workflows directory to ensure code quality. Before opening a pull request, it is recommended to run these workflows.
To see the available workflows, run:
act --container-architecture linux/arm64 -lExample:
$ act --container-architecture linux/arm64 -l
Stage Job ID Job name Workflow name Workflow file Events
0 docker docker DockerBuild docker-build.yml push,pull_request,release
0 build build GoTest golang-build.yml push
0 format format GoFmt golang-fmt.yml push
0 lint lint GoLint golang-lint.yml push
0 release-to-main release-to-main Manual Prepare Release release-to-main.yml workflow_dispatch If you are working on the CI/CD Action Workflows, it is useful to perform a --dry-run on the workflow to ensure the syntax is valid. To do this, run:
$ act --container-architecture linux/arm64 --dryrun -j lintTo run a workflow, use the Job ID value and pass it into the following command:
$ act --container-architecture linux/arm64 -j lint
...
[GoLint/lint] Cleaning up container for job lint
[GoLint/lint] 🏁 Job succeededFor more examples, see the README in the workflow directory.
Remember to refer to the available targets in the Makefile for other development tasks.
Publishing a new release can be accomplished by running the Manual Prepare Release workflow.
Once run the following occurs:
- All changes on the
developbranch are merged into themainbranch. - A new semver
tagis created. - A new
pre-releaseis created, with thechange logfor changes since the last release.
Next we can visit the release page, and locate the pre-release and click the edit icon:

Finally - we will publish the draft-release. Make sure you:
- Remove the
draftcheckbox - Update
Set as pre-releasetoSet as the latest release
When this is done, it will cause an automated release of teh docker image for the release value, and latest to be created in GHCR.
That's it, Happy coding!

