CONTRIBUTING.adoc
e8a6c7a3
 = Contributing to OpenShift 3
8fc6ff7b
 OpenShift Developers <dev@lists.openshift.redhat.com>
9de7320d
 :data-uri:
 :icons:
 :toc2:
 :sectanchors:
 
e8a6c7a3
 The OpenShift 3 architecture builds upon the flexibility and scalability of https://docker.com/[Docker] and https://github.com/GoogleCloudPlatform/kubernetes[Kubernetes] to deliver a powerful new Platform as a Service system. This article explains how to set up a development environment and get involved with this latest version of OpenShift.
9de7320d
 
7bda5af7
 There are multiple ways to start coding OpenShift.
 
6634ae0c
 * <<download-from-github>>
7bda5af7
 * <<develop-locally-on-your-host>>
 * <<develop-on-virtual-machine-using-vagrant>>
 
6634ae0c
 == Download from GitHub
 
b4b63285
 The OpenShift team periodically publishes binaries to Github on https://github.com/openshift/origin/releases[the Releases page].  These are Linux, Windows, or Mac OS X 64bit binaries (note that Mac and Windows are client only). You'll need Docker installed on your local system (see https://docs.docker.com/installation/#installation[the installation page] if you've never installed Docker before).
6634ae0c
 
b4b63285
 The tar file for each platform contains a single binary `openshift` which is the all-in-one OpenShift installation.
c36cc7db
 
b41286d3
 * Use `sudo openshift start` to launch the server.  Root access is required to create services due to the need to modify IPTables.  See issue: https://github.com/GoogleCloudPlatform/kubernetes/issues/1859.
f89cda25
 * Use `osc -h <server> ...` to connect to an OpenShift server
c36cc7db
 * Use `openshift help` to see more about the commands in the binary
6634ae0c
 
7bda5af7
 == Develop locally on your host
 
e8a6c7a3
 You can develop OpenShift 3 on Windows, Mac, or Linux, but you'll need Docker installed on Linux to actually launch containers.
9de7320d
 
e8a6c7a3
 * For OpenShift 3 development, install the http://golang.org/[Go] programming language
 * To launch containers, install the https://docker.com/[Docker] platform
9de7320d
 
 Here's how to get set up:
 
f4d11ab5
 1. For Go, Git and optionally also Docker, follow the links below to get to installation information for these tools: +
17286387
 ** http://golang.org/doc/install[Installing Go]. You must install Go 1.4.
f4d11ab5
 ** http://git-scm.com/book/en/v2/Getting-Started-Installing-Git[Installing Git]
4580b5ee
 ** https://docs.docker.com/installation/#installation[Installing Docker]. NOTE: OpenShift now requires at least Docker 1.6. RPMs for CentOS 7 are not yet available in the default yum repositories. If you're running CentOS, please see the link:README.md#docker-16[README] for information on where to get Docker 1.6 RPMs for your platform.
9de7320d
 2. Next, create a Go workspace directory: +
 +
 ----
 $ mkdir $HOME/go
 ----
 3. In your `.bashrc` file or `.bash_profile` file, set a GOPATH and update your PATH: +
 +
 ----
 export GOPATH=$HOME/go
 export PATH=$PATH:$GOPATH/bin
 ----
e8a6c7a3
 4. Open up a new terminal or source the changes in your current terminal, and you're ready to code.
9de7320d
 
7bda5af7
 == Develop on virtual machine using Vagrant
 
57c5a628
 To facilitate rapid development we've put together a Vagrantfile you can use to stand up a development environment.
7bda5af7
 
 1.  http://www.vagrantup.com/downloads[Install Vagrant]
 
5b3e3f59
 2.  https://www.virtualbox.org/wiki/Downloads[Install VirtualBox] (Ex: `yum install VirtualBox`)
7bda5af7
 
5b3e3f59
 3.  Clone the project and change into the directory:
 
         $ mkdir -p $GOPATH/src/github.com/openshift
         $ cd $GOPATH/src/github.com/openshift
7bda5af7
         $ git clone git://github.com/openshift/origin
         $ cd origin
 
5b3e3f59
 4.  Bring up the VM:
7bda5af7
 
         $ vagrant up
 
5b3e3f59
 5.  SSH in:
7bda5af7
 
         $ vagrant ssh
 
169caa43
 6.  Run a build:
7bda5af7
 
5b3e3f59
         $ cd /data/src/github.com/openshift/origin
7bda5af7
         $ hack/build-go.sh
 
5b3e3f59
 7.  Start an OpenShift all-in-one server (includes everything you need to try OpenShift)
 
         $ sudo systemctl start openshift
 
cd996561
 8.  On your host system, try browsing to: https://localhost:8443/console
7bda5af7
 
5b3e3f59
 TIP: See https://github.com/openshift/vagrant-openshift for more advanced options
7bda5af7
 
57c5a628
 TIP: In some cases (eg. after git pull), you might run `make clean` in the `origin` directory to clean up outdated compiled files.
a18b01c3
 
d2e59476
 == Ensure virtual box interfaces are not managed by Network Manager
 
 If you are developing on a Linux host, then you need to ensure that Network Manager is ignoring the
 virtual box interfaces, otherwise they cause issues with multi-vm networking.
 
 Follow these steps to ensure that virtual box interfaces are unmanaged:
 
 1. Check the status of Network Manager devices:
 
 	$ nmcli d
 
 2. If any devices whose name start with vboxnet* are not unmanaged, then they need to be added to
    NetworkManager configuration to be ignored.
 
 	$ cat /etc/NetworkManager/NetworkManager.conf
 
         [keyfile]
         unmanaged-devices=mac:0a:00:27:00:00:00;mac:0a:00:27:00:00:01;mac:0a:00:27:00:00:02
 
 3. One can use the following command to help generate the configuration:
 
 	$ ip link list | grep vboxnet  -A 1 | grep link/ether | awk '{print "mac:" $2}' |  paste -sd ";" -
 
01b52e45
 4. Reload the Network Manager configuration:
 
     $ sudo nmcli con reload
 
9de7320d
 == Development: What's on the Menu?
a0d864e5
 Right now you can see what's happening with OpenShift development at:
9de7320d
 
a0d864e5
 https://github.com/openshift/origin[github.com/openshift/origin]
9de7320d
 
 Here's a quick summary of what we're doing there:
 
e8a6c7a3
 === The OpenShift Origin Repo
 This repo contains the OpenShift 3 https://www.youtube.com/watch?v=aZ40GobvA1c[Platform-as-a-Service], built on Kubernetes, along with some script-based examples of the +openshift+ utility in action. Kubernetes is included in this repo for ease of development, and the version we include is periodically updated. In the future it will be possible to run OpenShift on top of an existing system.
9de7320d
 
e8a6c7a3
 *Hacking OpenShift Origin:* +
9de7320d
 To get started, https://help.github.com/articles/fork-a-repo[fork] the https://help.github.com/articles/fork-a-repo[origin repo] and then set up a local copy:
 
 ----
8fc6ff7b
 $ go get github.com/openshift/origin
 $ cd $GOPATH/src/github.com/openshift/origin
1c532b6a
 $ git remote add <YOUR_GITHUB_USERNAME> git@github.com:<YOUR_GITHUB_USERNAME>/origin
9de7320d
 ----
 
7ee81936
 From here, you can follow the https://github.com/openshift/origin/#getting-started[Getting Started section] of the README for a brief tour of OpenShift 3 functionality, which includes single and multi-container pod examples.
9de7320d
 
 Ready to play with some code? Hop down and read up on our link:#_the_roadmap[roadmap] for ideas on where you can contribute.
 
 *If you are interested in contributing to Kubernetes directly:* +
 https://github.com/GoogleCloudPlatform/kubernetes#community-discussion-and-support[Join the Kubernetes community] and check out the https://github.com/GoogleCloudPlatform/kubernetes/blob/master/CONTRIBUTING.md[contributing guide].
 
da3b06d1
 === Troubleshooting
 
 If you run into difficulties running OpenShift, start by reading through the https://github.com/openshift/origin/blob/master/docs/debugging-openshift.md[troubleshooting guide].
 
9de7320d
 === The Roadmap
e8a6c7a3
 The OpenShift project roadmap lives https://trello.com/b/nlLwlKoz/openshift-origin-roadmap[on Trello]. Of particular interest to those who want to get involved with the OpenShift 3 architecture are the following topics:
9de7320d
 
 * https://trello.com/c/uqNIamJi[Orchestration]
 * https://trello.com/c/ja8bbQwy[Networking]
 * https://trello.com/c/3zHeVSla[Routing and Load Balancing]
 
 These link to active and backlog tasks that the OpenShift team is planning or working on for Kubernetes development.
 
 == Stay in Touch
 Reach out to the OpenShift team and other community contributors through IRC and our mailing list:
 
 * IRC: Hop onto the http://webchat.freenode.net/?randomnick=1&channels=openshift-dev&uio=d4[#openshift-dev] channel on http://www.freenode.net/[FreeNode].
 * E-mail: Join the OpenShift developers' http://lists.openshift.redhat.com/openshiftmm/listinfo/dev[mailing list].