Merge lp:~michael.nelson/rnr-server/improve_readme into lp:rnr-server

Proposed by Michael Nelson
Status: Merged
Approved by: Michael Nelson
Approved revision: 209
Merged at revision: 208
Proposed branch: lp:~michael.nelson/rnr-server/improve_readme
Merge into: lp:rnr-server
Diff against target: 92 lines (+60/-11)
1 file modified
README (+60/-11)
To merge this branch: bzr merge lp:~michael.nelson/rnr-server/improve_readme
Reviewer Review Type Date Requested Status
Aaron Peachey (community) Approve
Ratings and Reviews Developers Pending
Review via email: mp+81830@code.launchpad.net

Commit message

Improve README for setting up developer environment.

Description of the change

Overview
========

Just an update to the README to improve the experience of setting up a development environment.

I've tested all the steps on an fresh Oneiric machine to verify that it works, given that that's what most devs will be using. I currently use a lucid vm, and the setup is mostly the same.

Long-term, I'm keen for a much less error-prone process, like setting up an lc-container and installing packages (rather than virtualenv) to match whatever the current staging/production servers are running.

To post a comment you must log in.
Revision history for this message
Aaron Peachey (aaronp) wrote :

This is much better for new contributors to use and hopefully get up to speed quickly and easily. Thanks Michael

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2011-09-13 10:13:45 +0000
3+++ README 2011-11-10 11:14:23 +0000
4@@ -2,21 +2,28 @@
5 Setting up the development environment
6 ======================================
7
8-You can simply use:
9-
10- $ fab bootstrap test
11-
12-to setup and test your development environment. If you haven't used
13-pip before or setup its download cache, you may want to do the
14-following first so that you don't need to download eggs for each
15-branch or project that you work on:
16+This branch sets up its own development environment using fabric and
17+virtualenv. You can ensure all the required packages are installed on
18+your development machine with:
19+
20+ $ sudo apt-get install fabric python-virtualenv postgresql-server-dev-9.1 python-dev unzip
21+
22+(python-dev and postgresql-server-dev-9.1 are required for building
23+the psycopg driver on Oneiric).
24+
25+To bootstrap your development environment:
26+ $ fab bootstrap
27+
28+And to verify that all tests are passing in your development environment:
29+ $ fab test
30+
31+If you haven't used pip before or setup its download cache, you may want to do
32+the following first so that you don't need to download eggs for each branch or
33+project that you work on:
34
35 $ mkdir -p ~/.pip/cache
36 $ echo -e "[global]\ndownload_cache = ~/.pip/cache" > ~/.pip/pip.conf
37
38-If you will also be testing against postgres, you'll also need
39-the postgres debversion package (for your version of postgres).
40-
41 ==================
42 Running the server
43 ==================
44@@ -77,6 +84,48 @@
45 >>> response = api.submit_review(review=request)
46
47
48+====================================
49+Testing and developing with Postgres
50+====================================
51+
52+Currently our production servers run postgresql-8.4 on lucid,
53+but until we provide a virtual machine or bootstrap an lx-container
54+matching our production OS, we need to satisfy dependencies for
55+a dev environment in Oneiric, which means using postgresql-9.1
56+(as the debversion plugin is only available for 9.1 in oneiric).
57+
58+ $ sudo apt-get install postgresql-9.1 postgresql-9.1-debversion
59+
60+then edit the postgres authentication file to allow trusted access
61+to the postgres user (note: obvious security risk for any net-facing
62+machine - if you're using a publicly accessible machine, then you should
63+know a more secure way of enabling access :P):
64+
65+ $ sudo vim /etc/postgresql/9.1/main/pg_hba.conf
66+
67+find the line that looks like:
68+
69+{{{
70+# Database administrative login by Unix domain socket
71+local all postgres peer
72+}}}
73+
74+and change peer to trust, save, then restart postgres with:
75+
76+ $ sudo service postgresql restart
77+
78+Finally, for postgres, we need to ensure that the rnr database
79+first exists:
80+
81+ $ psql -U postgres
82+ postgres=# create database rnr;
83+ CREATE DATABASE
84+ postgres=# \q
85+
86+You can now verify your setup with:
87+ $ fab test:pg=true
88+
89+
90 ========================
91 Updating a remote server
92 ========================

Subscribers

People subscribed via source and target branches