This guide provides step-by-step instructions for setting up the development environment, generating code, building examples, and running tests for the open-vcluster-api project.
Before you begin, ensure you have the following installed:
- Go 1.21+ (Tested with Go 1.24.3)
- Protocol Buffers Compiler (
protoc)- Ubuntu/Debian:
sudo apt install -y protobuf-compiler && sudo apt-get install -y npm - macOS:
brew install protobuf - Manual: Download from GitHub Releases
- Ubuntu/Debian:
- Make
- Python 3.8+ (for Python SDK generation)
- Node.js & npm (for TypeScript SDK generation)
Install the necessary Go dependencies (protoc plugins, buf, linters).
make depsEnsure your GOPATH/bin is in your PATH:
export PATH=$(go env GOPATH)/bin:$PATHGenerate the Protocol Buffer code for Go, Python, and TypeScript.
make sdk-all-
Go SDK (
api/v1andsdk/go):make sdk-go
Note: This also generates the core gRPC code used by the server.
-
TypeScript SDK (
sdk/typescript):make sdk-ts
-
Python SDK (
sdk/python):make sdk-py
If you only need the server-side Go code:
make protoor
make generateCompile the example server and client applications.
make buildor
make examplesThis will create binaries in the ./bin/ directory:
./bin/simple-server./bin/simple-client
Run the unit tests to verify the API logic.
make testYou can run the built binaries to verify end-to-end functionality.
Terminal 1 (Server):
./bin/simple-serverTerminal 2 (Client):
./bin/simple-clientCheck code quality and protobuf definitions.
make lintRemove generated artifacts and binaries.
make cleanprotoc-gen-go: program not found: Ensure$(go env GOPATH)/binis in your systemPATH.- Python
externally-managed-environment: The build scripts use--break-system-packagesto handle this in CI/dev environments. If you prefer virtual environments, manually create one and install dependencies fromsdk/python/requirements.txt(if available) orsetup.py. - Buf Lint Errors: The project is configured to ignore third-party directories. Ensure you are running
make lintfrom the project root.