From 20b7e9b8bb19f4094d3c0925e20479f8827a9c7e Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 10 Nov 2016 10:04:43 -0800 Subject: [PATCH] Add CONTRIBUTING section on build --- CONTRIBUTING.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd45df1fbf38d..7685e2d786d1c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,6 +82,46 @@ some bugs or smaller features. We have a [feature development process](https://github.com/kubernetes/features/blob/master/README.md), but navigating the Kubernetes system as a newcomer can be very challenging. +### Downloading the project + +There are a few ways you can download this code. You must download it into a +GOPATH - see [golang.org](https://golang.org/doc/code.html) for more info on +how Go works with code. This project expects to be found at the Go package +`k8s.io/kubernetes`. + +1. You can `git clone` the repo. If you do this, you MUST make sure it is in + the GOPATH as `k8s.io/kubernetes` or it may not build. E.g.: `git clone + https://github.com/kubernetes/kubernetes $GOPATH/src/k8s.io/kubernetes` +1. You can use `go get` to fetch the repo. This will automatically put it into + your GOPATH in the right place. E.g.: `go get -d k8s.io/kubernetes` +1. You can download an archive of the source. If you do this, you MUST make + sure it is unpacked into the GOPATH as `k8s.io/kubernetes` or it may not + build. See [rel.k8s.io](http://rel.k8s.io) for a list of available releases. + +### Building the project + +There are a few things you need to build and test this project: + +1. `make` - the human interface to the Kubernetes build is `make`, so you must + have this tool installed on your machine. We try not to use too many crazy + features of `Makefile`s and other tools, so most commonly available versions + should work. +1. `docker` - some parts of the build/test system depend on `docker`. You + need a relatively recent version of Docker installed, and available to you. +1. `go` - Kubernetes is written in Go (aka golang), so you need a relatively + recent version of the [Go toolchain](https://golang.org/dl/) installed. + While Linux is the primary platform for Kubernetes, it should compile on a + Mac, too. Windows is in progress. + +To build Kubernetes, simply type `make`. This should figure out what it needs +to do and not need any input from you. If you want to just build a subset of +code, you can pass the `WHAT` variable to `make`: e.g. `make +WHAT="cmd/kubelet"`. + +To run basic tests, simply type `make test`. This will run all of the unit +tests in the project. If you want to just test a subset of the project, you +can pass the `WHAT` variable to `make`: e.g. `make test WHAT=pkg/kubelet`. + ### Protocols for Collaborative Development Please read [this doc](docs/devel/collab.md) for information on how we're