Jump to: navigation, search

Difference between revisions of "HackingNovaMacOSX"

 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__NOTOC__
 
= How to Set up a Development Environment on MacOS X =
 
  
Notes for hacking and cleaning on Nova on MacOS X
+
= How to Set up a Development Environment on Mac OS X =
  
Install BZR
+
Notes for hacking and cleaning on Nova on Mac OS X
  
<code><nowiki>brew install bzr</nowiki></code>
+
== Git and Github ==
  
Register your username
+
OpenStack code is hosted on Github and uses git, which should already be
 +
installed on Mac OS X. To grab the latest code:
  
<code><nowiki>bzr lp-login heckj</nowiki></code> (your username here, see also [[[LifeWithBzrAndLaunchpad|| learning BZR and Launchpad]]])
 
  
Get Virtual Env
+
<pre><nowiki>
 +
git clone git://github.com/openstack/nova.git
 +
</nowiki></pre>
 +
 
 +
 
 +
== Install Python Dependencies ==
 +
 
 +
Use Python's easy_install to install virtualenv
 +
 
 +
 
 +
<pre><nowiki>
 +
sudo easy_install virtualenv
 +
</nowiki></pre>
 +
 
 +
 
 +
You'll also need swig (install any way you want, but brew is nice http://mxcl.github.com/homebrew/):
 +
 
 +
 
 +
<pre><nowiki>
 +
brew install swig
 +
</nowiki></pre>
 +
 
  
<code><nowiki>sudo easy_install virtualenv</nowiki></code>
+
== Initial code setup ==
  
 
Initial Code Setup:
 
Initial Code Setup:
  
 
<pre><nowiki>
 
<pre><nowiki>
bzr branch lp:nova
 
 
cd nova
 
cd nova
 
python tools/install_venv.py
 
python tools/install_venv.py
source .nova_venv/bin/activate
+
source .venv/bin/activate
pip install pep8 # submitting patch so that Nova has pep8 and pylint in PIP requirements file
+
</nowiki></pre>
pip install pylint
+
 
 +
 
 +
== OpenSSL Dependency ==
 +
 
 +
If you have installed OpenSSL 1.0.0a on Mac OS X, which can happen when installing a [[MacPorts]] package for OpenSSL, you will see an error when running nova.tests.auth_unittest.[[AuthTestCase]].test_209_can_generate_x509. The version that functions correctly is OpenSSL 0.9.8l 5, installed with MacOS 10.6 as a base element. 
 +
 
 +
There is no easy way to install an older package version using macports, but if it had been installed you can reactivate it.
  
 +
<pre><nowiki>
 +
sudo port activate openssl @0.9.8n_0+darwin
 
</nowiki></pre>
 
</nowiki></pre>
  
  
If you have installed OpenSSL 1.0.0a on MacOS, which can happen when installing a [[MacPorts]] package for OpenSSL, you will see an error when running nova.tests.auth_unittest.[[AuthTestCase]].test_209_can_generate_x509. The version that functions correctly is OpenSSL 0.9.8l 5, installed with MacOS 10.6 as a base element.
+
The alternative is to remove it and use the default OSX openssl. This will give you dependency errors on the port command, so you need to force it.
 
 
from http://wiki.openstack.org/InstallationNova20100729 (I do this in a separate window that I hide to let Redis be as noisy as it wants to in the background. Redis won't be needed after the Austin release, most likely.)
 
  
 
<pre><nowiki>
 
<pre><nowiki>
cd nova
+
sudo - f port uninstall openssl
curl http://redis.googlecode.com/files/redis-2.0.0-rc4.tar.gz -o redis-2.0.0-rc4.tar.gz
 
tar xvfz redis-2.0.0-rc4.tar.gz
 
cd redis-2.0.0-rc4
 
# Make and start Redis server
 
make
 
./redis-server &
 
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
 +
== Run the Tests ==
  
  
 
<pre><nowiki>
 
<pre><nowiki>
 
cd nova
 
cd nova
bzr pull # get the latest stuff...
+
git pull # get the latest stuff...
source .nova_venv/bin/activate
 
redis-2.0.0-rc4/redis-server &
 
 
./run_tests.sh
 
./run_tests.sh
 
 
#... do cleaning work ...
 
#... do cleaning work ...
 
bzr push lp:~heckj/nova/cleaning
 
 
</nowiki></pre>
 
</nowiki></pre>
  
  
To submit the merge/patch:
+
To submit the merge/patch, see [http://docs.openstack.org/infra/manual/developers.html#development-workflow development workflow]
* navigate to https://code.launchpad.net/~heckj/nova/cleaning
 
* click on the link "Propose for merging"
 
 
 
Open questions
 
* Once merged in and accepted, does the proposal get closed?
 
** Do we then delete this branch and create another with the next cleaning/merge request?
 
** Or do we make more changes, push to this branch, and then submit another merge request?
 

Latest revision as of 17:47, 5 December 2014

How to Set up a Development Environment on Mac OS X

Notes for hacking and cleaning on Nova on Mac OS X

Git and Github

OpenStack code is hosted on Github and uses git, which should already be installed on Mac OS X. To grab the latest code:


git clone git://github.com/openstack/nova.git


Install Python Dependencies

Use Python's easy_install to install virtualenv


sudo easy_install virtualenv


You'll also need swig (install any way you want, but brew is nice http://mxcl.github.com/homebrew/):


brew install swig


Initial code setup

Initial Code Setup:

cd nova
python tools/install_venv.py
source .venv/bin/activate


OpenSSL Dependency

If you have installed OpenSSL 1.0.0a on Mac OS X, which can happen when installing a MacPorts package for OpenSSL, you will see an error when running nova.tests.auth_unittest.AuthTestCase.test_209_can_generate_x509. The version that functions correctly is OpenSSL 0.9.8l 5, installed with MacOS 10.6 as a base element.

There is no easy way to install an older package version using macports, but if it had been installed you can reactivate it.

sudo port activate openssl @0.9.8n_0+darwin


The alternative is to remove it and use the default OSX openssl. This will give you dependency errors on the port command, so you need to force it.

sudo - f port uninstall openssl


Run the Tests

cd nova
git pull # get the latest stuff...
./run_tests.sh
#... do cleaning work ...


To submit the merge/patch, see development workflow