Jump to: navigation, search

Difference between revisions of "Getting The Code"

(29 intermediate revisions by 15 users not shown)
Line 1: Line 1:
__NOTOC__
+
== Git source code repositories ==
= Getting the source code =
 
  
There is a page detailing full instructions on how to work with bzr and Launchpad at [[LifeWithBzrAndLaunchpad]].
+
OpenStack manages source code in git using a code review tool called Gerrit. The workflow for working with Gerrit is described at [http://docs.openstack.org/infra/manual/developers.html#development-workflow Development Workflow]. Git repositories are mirrored to [http://git.openstack.org/ git.openstack.org] and [https://github.com/openstack Github]. Installing git varies by platform, and if you're a developer is probably something you already have - but if it isn't, [[InstallingGit]] may help.
 
 
You can go directly to Launchpad to look at the [https://launchpad.net/openstack OpenStack Project Group], [https://launchpad.net/swift OpenStack Object Storage (swift)], and [https://launchpad.net/nova OpenStack Compute (nova)] code or you can use bzr from the command line. Instructions on how to get the code for (swift) using bzr:
 
  
 +
To get a copy of an OpenStack project, you can clone a repo from [http://git.openstack.org/ git.openstack.org] and browse the source code at [http://git.openstack.org/cgit git.openstack.org/cgit].  For instance, to clone the Swift repo:
  
 
<pre><nowiki>
 
<pre><nowiki>
bzr branch lp:swift
+
git clone git://git.openstack.org/openstack/swift
 
</nowiki></pre>
 
</nowiki></pre>
  
or
+
Alternatively, you can use the [https://github.com/openstack Github mirror] to clone repos and browse code.  The git.openstack.org and GitHub mirrors are maintained the same way and contain the same code, so you can use either one, with the difference being that git.openstack.org is hosted by the OpenStack infrastructure team.
  
<pre><nowiki>
 
bzr branch lp:nova
 
</nowiki></pre>
 
  
You will also need to ensure you have logged in to launchpad with bzr. If you don't want to follow the [[LifeWithBzrAndLaunchpad|full walkthrough]], the quick version of of getting started is:
+
== Source code tarballs ==
 
 
<pre><nowiki>
 
bzr lp-login "your-launchpad-id"
 
bzr whoami "Full Name <email@address.com>"
 
</nowiki></pre>
 
  
then:
+
You can find all source code tarballs of OpenStack projects on https://releases.openstack.org .
  
<pre><nowiki>
+
Alternatively, you can find all source code tarballs generated for OpenStack projects at [http://tarballs.openstack.org tarballs.openstack.org].
bzr init-repo swift
 
cd swift
 
bzr branch lp:swift
 
</nowiki></pre>
 
  
or:
 
  
<pre><nowiki>
+
== Getting dependencies ==
bzr init-repo nova
 
cd nova
 
bzr branch lp:nova
 
</nowiki></pre>
 
  
 +
Python runtime and test dependencies are described in requirements.txt in each project. Some dependencies are not Python dependencies, though. See [[DevStack]] for more information on setting up the required dependencies.
  
= Nova Dependencies (OSX) =
 
  
Commands for installing dependencies on OSX => [[DependsOnOSX]]
+
== Hacking on your laptop and running unit tests ==
  
= Nova Dependencies (Ubuntu) =
+
Questions about running unit tests locally are fairly common.  While all of the projects are pretty similar in how this works, it's best to consult each projects documentation for things like setting up a dev environment and running unit tests.
  
Commands for installing dependencies on Ubuntu => [[DependsOnUbuntu]]
+
Each project should publish this info to docs.openstack.org (http://docs.openstack.org/developer/<PROJECT_NAME>/devref/development.environment.html
 
 
= Swift All in One (Manual Install) =
 
 
 
Swift documentation can be found at [http://swift.openstack.org/]].  The [[http://swift.openstack.org/development_saio.html Swift All in One] documentation will lead you step by step to do a development install of Swift on a VM.
 
 
 
= Swift All In One (Chef Auto Install) =
 
 
 
You'll want to have an Ubuntu 10.04 system/VM that you're willing to turn in to a Swift development environment.  First step is to get the SSH key you are using for launchpad in your ~/.ssh directory.
 
 
 
Log in as your user, and do the following:
 
 
 
 
 
<pre><nowiki>
 
curl http://c0020195.cdn1.cloudfiles.rackspacecloud.com/install-swift.sh > install-swift.sh
 
bash install-swift.sh
 
</nowiki></pre>
 
  
 +
For example:
  
You'll be prompted for your username, group name (which is your user group name likely identical to your username), launchpad login, and the email address you want bzr to use when sending commits. Eventually, you will also be prompted to accept the Launchpad SSH Host Key, and may be prompted for your keyphrase.
+
http://docs.openstack.org/developer/cinder/devref/development.environment.html
  
When the script completes, you'll have a functioning Swift All In One that's prepped for running the functional tests.
+
[[Category:Contribute]]

Revision as of 15:24, 1 April 2016

Git source code repositories

OpenStack manages source code in git using a code review tool called Gerrit. The workflow for working with Gerrit is described at Development Workflow. Git repositories are mirrored to git.openstack.org and Github. Installing git varies by platform, and if you're a developer is probably something you already have - but if it isn't, InstallingGit may help.

To get a copy of an OpenStack project, you can clone a repo from git.openstack.org and browse the source code at git.openstack.org/cgit. For instance, to clone the Swift repo:

git clone git://git.openstack.org/openstack/swift

Alternatively, you can use the Github mirror to clone repos and browse code. The git.openstack.org and GitHub mirrors are maintained the same way and contain the same code, so you can use either one, with the difference being that git.openstack.org is hosted by the OpenStack infrastructure team.


Source code tarballs

You can find all source code tarballs of OpenStack projects on https://releases.openstack.org .

Alternatively, you can find all source code tarballs generated for OpenStack projects at tarballs.openstack.org.


Getting dependencies

Python runtime and test dependencies are described in requirements.txt in each project. Some dependencies are not Python dependencies, though. See DevStack for more information on setting up the required dependencies.


Hacking on your laptop and running unit tests

Questions about running unit tests locally are fairly common. While all of the projects are pretty similar in how this works, it's best to consult each projects documentation for things like setting up a dev environment and running unit tests.

Each project should publish this info to docs.openstack.org (http://docs.openstack.org/developer/<PROJECT_NAME>/devref/development.environment.html

For example:

http://docs.openstack.org/developer/cinder/devref/development.environment.html