-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbootstrap.html
More file actions
235 lines (223 loc) · 10.7 KB
/
Copy pathbootstrap.html
File metadata and controls
235 lines (223 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Setting up a dev instance — openlibrary v2.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '2.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="openlibrary v2.0 documentation" href="index.html" />
<link rel="next" title="Getting Started with Development" href="dev/index.html" />
<link rel="prev" title="Welcome" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="dev/index.html" title="Getting Started with Development"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome"
accesskey="P">previous</a> |</li>
<li><a href="index.html">openlibrary v2.0 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="setting-up-a-dev-instance">
<span id="bootstrap"></span><h1>Setting up a dev instance<a class="headerlink" href="#setting-up-a-dev-instance" title="Permalink to this headline">¶</a></h1>
<p>Setting up an Open Library dev instance requires installing some third-party
software and python modules. This document will step you though the
installation process.</p>
<div class="section" id="supported-platforms">
<h2>Supported Platforms<a class="headerlink" href="#supported-platforms" title="Permalink to this headline">¶</a></h2>
<p>The Open Library dev instance has been tested on the following platforms.</p>
<ul class="simple">
<li>Ubuntu 10.10</li>
<li>Ubuntu 10.04</li>
<li>Mac OS X Snow Leopard (with <a class="reference external" href="http://developer.apple.com/technologies/xcode.html">XCode</a> and <a class="reference external" href="http://mxcl.github.com/homebrew/">homebrew</a> installed)</li>
</ul>
<p>Make sure you have at least 1GB of RAM on your dev machine or virtual machine.</p>
</div>
<div class="section" id="getting-the-source">
<h2>Getting the source<a class="headerlink" href="#getting-the-source" title="Permalink to this headline">¶</a></h2>
<p>Open Library uses <tt class="docutils literal"><span class="pre">git</span></tt> for version control and the <a class="reference external" href="https://github.com/internetarchive/openlibrary">code repository</a> is
hosted on github.</p>
<p>You can get the source code from there using:</p>
<div class="highlight-python"><pre>$ git clone git://github.com/internetarchive/openlibrary.git
$ cd openlibrary</pre>
</div>
<p>This will create a directory called openlibrary with the entire
codebase checked out.</p>
<p>In case you don’t have git installed already, you can install it on Ubuntu using:</p>
<div class="highlight-python"><pre>$ sudo apt-get install git-core</pre>
</div>
<p>and on Mac OS X using:</p>
<div class="highlight-python"><pre>$ brew install git</pre>
</div>
</div>
<div class="section" id="installing-dependencies">
<h2>Installing dependencies<a class="headerlink" href="#installing-dependencies" title="Permalink to this headline">¶</a></h2>
<p>Open Library depends a lot of third-party programs.</p>
<p>To install all the dependencies:</p>
<div class="highlight-python"><pre>$ sudo ./scripts/install_dependencies.sh</pre>
</div>
<p>Note that this is run as root.</p>
<p>See <a class="reference internal" href="appendices/dependencies.html"><em>Dependencies</em></a> for the list of dependencies.</p>
</div>
<div class="section" id="setting-up-the-dev-instance">
<h2>Setting up the dev instance<a class="headerlink" href="#setting-up-the-dev-instance" title="Permalink to this headline">¶</a></h2>
<p>Once all the dependencies are installed the dev instance can be setup by running:</p>
<div class="highlight-python"><pre>$ make bootstrap</pre>
</div>
<p>This will do the following tasks, each of which can be invoked independenetly using make.</p>
<ul class="simple">
<li>create virtualenv (<tt class="docutils literal"><span class="pre">make</span> <span class="pre">venv</span></tt>)</li>
<li>install solr (<tt class="docutils literal"><span class="pre">make</span> <span class="pre">install_solr</span></tt>)</li>
<li>setup coverstore (<tt class="docutils literal"><span class="pre">make</span> <span class="pre">setup_coverstore</span></tt>)</li>
<li>setup openlibrary webapp (<tt class="docutils literal"><span class="pre">make</span> <span class="pre">setup_ol</span></tt>)</li>
</ul>
</div>
<div class="section" id="destroying-the-dev-instance">
<h2>Destroying the dev instance<a class="headerlink" href="#destroying-the-dev-instance" title="Permalink to this headline">¶</a></h2>
<p>You want to destroy the current dev instance to build a new one, you can do it using:</p>
<div class="highlight-python"><pre>$ make destroy</pre>
</div>
</div>
<div class="section" id="running-the-dev-instance">
<h2>Running the dev instance<a class="headerlink" href="#running-the-dev-instance" title="Permalink to this headline">¶</a></h2>
<p>Running the dev instance requires running 2 services. Solr is run the background as daemon and the the ol webapp is run in the foreground.</p>
<p>The Solr processes can be started and stopped using <cite>solr.sh</cite> script.:</p>
<div class="highlight-python"><pre>$ ./scripts/solr.sh start
Starting Solr
Done. Output is logged to var/log/solr.log.
$ ./scripts/solr.sh status
Solr running with pid 97208.
$ ./scripts/solr.sh stop
Stopping Solr
Done
$ ./scripts/solr.sh status
Solr is not running</pre>
</div>
<p>The OL webapp can be started as:</p>
<div class="highlight-python"><pre>$ make run</pre>
</div>
<p>Make sure Solr is running before starting the webapp.</p>
<p>Once the webapp is started, the website can be accessed at <a class="reference external" href="http://0.0.0.0:8080/">http://0.0.0.0:8080/</a>.</p>
</div>
<div class="section" id="loading-sample-data">
<h2>Loading sample data<a class="headerlink" href="#loading-sample-data" title="Permalink to this headline">¶</a></h2>
<p>Use the <cite>copydocs.py</cite> script to load sample records from openlibrary.org website.:</p>
<div class="highlight-python"><pre>$ make load_sample_data</pre>
</div>
<p>Make sure both Solr and the webapp are running before running this.</p>
<p>Restart the webapp to see the books on homepage.</p>
</div>
<div class="section" id="known-issues">
<h2>Known Issues<a class="headerlink" href="#known-issues" title="Permalink to this headline">¶</a></h2>
<p>It is known that the following issues.</p>
<ul class="simple">
<li>Stats on the home page is not working</li>
<li>/admin is failing</li>
<li>/libraries/stats is failing</li>
<li>Lists are not working</li>
<li>subject search not working</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo_OL-lg.png" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Setting up a dev instance</a><ul>
<li><a class="reference internal" href="#supported-platforms">Supported Platforms</a></li>
<li><a class="reference internal" href="#getting-the-source">Getting the source</a></li>
<li><a class="reference internal" href="#installing-dependencies">Installing dependencies</a></li>
<li><a class="reference internal" href="#setting-up-the-dev-instance">Setting up the dev instance</a></li>
<li><a class="reference internal" href="#destroying-the-dev-instance">Destroying the dev instance</a></li>
<li><a class="reference internal" href="#running-the-dev-instance">Running the dev instance</a></li>
<li><a class="reference internal" href="#loading-sample-data">Loading sample data</a></li>
<li><a class="reference internal" href="#known-issues">Known Issues</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="dev/index.html"
title="next chapter">Getting Started with Development</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/bootstrap.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="dev/index.html" title="Getting Started with Development"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome"
>previous</a> |</li>
<li><a href="index.html">openlibrary v2.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2006-2011, Internet Archive.
Last updated on Dec 20, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>
</html>