Jump to: navigation, search

Difference between revisions of "Getting The Code"

(48 intermediate revisions by 21 users not shown)
Line 1: Line 1:
__NOTOC__
+
== Git source code repositories ==
= Getting the source code =
 
  
Because we're in this interesting open-source-yet-hidden state this week, there are a few hitches in the system. You will not be able to view the swift or ozone code via the web ui, but you can branch using bzr. (This restriction will go away at 12:01am EST on July 19. :) )
+
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.
  
Additionally, launchpad projects usually have a convenient URL shortcut to branch code, in the form of lp:''projectname'' - this also will not work until next week.
+
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:
 
 
'''For this week only''' to get the code, you need to do:
 
  
 
<pre><nowiki>
 
<pre><nowiki>
bzr branch lp:~swift-core/swift/trunk
+
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.
 +
 
 +
 
 +
== 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 [http://tarballs.openstack.org 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.
  
<pre><nowiki>
 
bzr branch lp:~ozone-core/ozone/trunk
 
</nowiki></pre>
 
  
You will also need to ensure you have logged in to launchpad with bzr. So the full walkthrough of getting started is:
+
== Hacking on your laptop and running unit tests ==
  
<pre><nowiki>
+
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.
bzr lp-login "your-launchpad-id"
 
</nowiki></pre>
 
  
then:
+
Each project should publish this info to docs.openstack.org (http://docs.openstack.org/developer/<PROJECT_NAME>/devref/development.environment.html
  
<pre><nowiki>
+
For example:
bzr init-repo swift
 
cd swift
 
bzr branch lp:~swift-core/swift/trunk
 
</nowiki></pre>
 
  
or:
+
http://docs.openstack.org/developer/cinder/devref/development.environment.html
  
<pre><nowiki>
+
[[Category:Contribute]]
bzr init-repo ozone
 
cd ozone
 
bzr branch lp:~ozone-core/swift/trunk
 
</nowiki></pre>
 

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