-
Notifications
You must be signed in to change notification settings - Fork 209
blog: implement contributor guide for local PipeCD setup #6375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shivansh-gohem
wants to merge
2
commits into
pipe-cd:master
Choose a base branch
from
shivansh-gohem:blog-local-setup-guide
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| --- | ||
| date: 2026-01-05 | ||
| title: "How to set up a local development environment" | ||
| linkTitle: "How to set up a local development environment" | ||
| weight: 990 | ||
| author: Shivansh Sahu ([@shivansh-gohem](https://github.com/shivansh-gohem)) | ||
| categories: ["Tutorial", "Contributing"] | ||
| tags: ["Local Development", "Go", "Kubernetes", "Dev Setup"] | ||
| --- | ||
|
|
||
|
|
||
| ## Why a Local Development Environment is Essential | ||
shivansh-gohem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| If you plan to contribute code, fix bugs, or add new plugins to PipeCD, you should run the control plane and Piped agent directly from the source code. This local development setup lets you test your Go changes live before submitting a pull request. | ||
|
|
||
| This guide walks through building and running the components from source so you can iterate quickly and confidently. | ||
|
|
||
shivansh-gohem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| **Estimated setup time: 20–30 minutes** | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Make sure you have the following installed and configured: | ||
|
|
||
| - **Go** (v1.21 or higher) | ||
| - **Docker** | ||
| - **kubectl** | ||
| - **Node.js and Yarn** (required to build the web UI) | ||
| - **A fork of the PipeCD repository** | ||
|
|
||
| To contribute to PipeCD, we recommend setting up a fork: | ||
|
|
||
| 1. Fork `pipe-cd/pipecd` on GitHub. | ||
| 2. Clone your fork locally: | ||
| ```bash | ||
| git clone https://github.com/<YOUR_USERNAME>/pipecd.git | ||
| cd pipecd | ||
| ``` | ||
| ## 1. Prepare and Start the Local Cluster | ||
|
|
||
| This step prepares a local Kubernetes cluster and container registry required for running the PipeCD control plane locally. | ||
|
|
||
| ### Update dependencies | ||
|
|
||
| Run these commands to ensure your local Go modules and web dependencies are up to date. Starting the environment may fail if these are outdated. | ||
| ```bash | ||
| make update/go-deps | ||
| make update/web-deps | ||
| ``` | ||
|
|
||
| ### Start local registry and cluster | ||
|
|
||
| A helper command starts a local kind cluster and a container registry. This command also automatically creates the `pipecd` namespace where the components will run. | ||
| ```bash | ||
| make up/local-cluster | ||
| ``` | ||
| ## 2. Run the PipeCD Control Plane (from source) | ||
|
|
||
| The control plane provides the web UI, API, and metadata storage. Running it from source ensures you are testing your latest changes. | ||
|
|
||
| ### Start the control plane | ||
|
|
||
| This command compiles the Go code, builds the web assets, and starts the control plane server locally. | ||
| ```bash | ||
| make run/pipecd | ||
| ``` | ||
| ### Access the UI | ||
|
|
||
| Once the control plane is running, forward the port to access the UI from your browser. Open a new terminal and run: | ||
| ```bash | ||
| kubectl port-forward -n pipecd svc/pipecd 8080 | ||
| ``` | ||
| Then open your browser: | ||
|
|
||
| - URL: <http://localhost:8080?project=quickstart> | ||
| - Username: `hello-pipecd` | ||
| - Password: `hello-pipecd` | ||
|
|
||
| ## 3. Configure and Run the Piped Agent (from source) | ||
|
|
||
| The Piped agent connects the control plane to your local Kubernetes cluster. You will run this agent from source as well. | ||
|
|
||
| ### Register Piped in the UI | ||
|
|
||
| 1. Go to **Settings → Piped** (or open <http://localhost:8080/settings/piped?project=quickstart>). | ||
| 2. Click **+ ADD**, give it a name (for example, `dev`), and save. | ||
| 3. **Crucial step:** Copy the generated **Piped ID** and **Base64 encoded key** immediately. | ||
|
|
||
| ### Create the Piped configuration | ||
shivansh-gohem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Create a file named `piped-config.yaml` in your repo root: | ||
| ```yaml | ||
| apiVersion: pipecd.dev/v1beta1 | ||
| kind: Piped | ||
| spec: | ||
| projectID: quickstart | ||
| # Replace here with your piped ID. | ||
| pipedID: <COPIED_PIPED_ID> | ||
| # Base64 encoded string of the piped private key. | ||
| # Replace here with your piped base64 key. | ||
| pipedKeyData: <COPIED_ENCODED_PIPED_KEY> | ||
| apiAddress: localhost:8080 | ||
| repositories: | ||
| - repoId: example | ||
| remote: [email protected]:pipe-cd/examples.git | ||
| branch: master | ||
| syncInterval: 1m | ||
| platformProviders: | ||
| - name: example-kubernetes | ||
| type: KUBERNETES | ||
| config: | ||
| # Replace here with your kubeconfig absolute file path. | ||
| kubeConfigPath: /path/to/.kube/config | ||
| ``` | ||
|
|
||
| ### Run Piped from source | ||
|
|
||
| Use your local code and the config file you just created: | ||
| ```bash | ||
| make run/piped CONFIG_FILE=piped-config.yaml INSECURE=true | ||
| ``` | ||
| ## Next Steps | ||
|
|
||
| Once Piped starts and shows as connected in the UI, your local development environment is ready. You can now build, test, and iterate on your PipeCD changes. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.