Setup Guide
Step-by-step instructions for setting up your development environment
Setup Guide (Beginner Friendly)
This guide will help you set up a development environment for working with Prow.
Prerequisites
Required Software
-
Go (version 1.24.0 or later)
# Check your Go version go version # If not installed, download from https://golang.org/dl/ -
Git
git --version # Install via your package manager if needed -
Make
make --version # Usually pre-installed on Linux/macOS -
Docker (optional, for building container images)
docker --version -
kubectl (for interacting with Kubernetes)
kubectl version --client
Optional but Recommended
- kind or minikube - For local Kubernetes cluster
- ko - For building container images
- jq - For JSON processing
- yq - For YAML processing
Installation Steps
1. Clone the Repository
# Clone the repository
git clone https://github.com/kubernetes-sigs/prow.git
cd prow
# If you plan to contribute, fork first and clone your fork
2. Set Up Go Environment
# Set Go environment variables (if not already set)
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Verify Go is working
go env
3. Install Dependencies
# Download dependencies
go mod download
# Verify dependencies
go mod verify
4. Build the Components
# Build all components
make build
# Or install to $GOPATH/bin
go install ./cmd/...
# Build specific component
go build ./cmd/hook
5. Verify Installation
# Check that components are installed
which hook
hook --help
# List all available components
ls $GOPATH/bin/ | grep -E "(hook|deck|tide|plank)"
Development Environment Setup
IDE Setup
VS Code:
- Install Go extension
- Install Kubernetes extension
- Configure Go settings
GoLand:
- Import project
- Configure Go SDK
- Set up Kubernetes integration
Local Kubernetes Cluster
Using kind:
# Install kind
go install sigs.k8s.io/kind@latest
# Create cluster
kind create cluster --name prow
# Verify cluster
kubectl cluster-info --context kind-prow
Using minikube:
# Install minikube
# See https://minikube.sigs.k8s.io/docs/start/
# Start cluster
minikube start
# Verify cluster
kubectl get nodes
Testing Your Setup
Run Unit Tests
# Run all unit tests
make test
# Run specific package tests
go test ./pkg/hook/...
# Run with verbose output
go test -v ./pkg/hook/...
Run Integration Tests
# Run integration tests
go test ./test/integration/...
# Run specific integration test
go test ./test/integration/... -run TestName
Build Container Images
# Build images using ko
ko build ./cmd/hook
# Or using Docker
docker build -t prow/hook:latest ./cmd/hook
Common Issues and Troubleshooting
Go Version Issues
Problem: Go version too old Solution: Update Go to 1.24.0 or later
# Check version
go version
# Update Go (example for Linux)
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
Dependency Issues
Problem: go mod download fails
Solution: Clear module cache and retry
go clean -modcache
go mod download
Build Issues
Problem: Build fails with import errors Solution: Ensure you’re in the correct directory and dependencies are installed
# Verify you're in the prow directory
pwd
# Re-download dependencies
go mod download
go mod tidy
Kubernetes Connection Issues
Problem: Cannot connect to Kubernetes cluster Solution: Verify kubeconfig
# Check kubeconfig
kubectl config view
# Test connection
kubectl get nodes
Next Steps
After setting up your environment:
- Read the Usage Guide to learn how to use Prow
- Explore the Codebase Walkthrough to understand the structure
- Check out the Contributing Guide to start contributing
- Review the Onboarding Guide for new contributors
Additional Resources
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.