-
Notifications
You must be signed in to change notification settings - Fork 1
/
faq.html
321 lines (219 loc) · 12.5 KB
/
faq.html
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FAQ — datacats 1.2.0 documentation</title>
<link rel="stylesheet" href="_static/css/datacats_theme.css" type="text/css" />
<link rel="top" title="datacats 1.2.0 documentation" href="index.html"/>
<link rel="next" title="How datacats uses Docker" href="docker.html"/>
<link rel="prev" title="User Guide" href="guide.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> datacats
</a>
<div class="version">
1.2.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="guide.html">User Guide</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">FAQ</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#run-an-interactive-paster-shell">Run an interactive Paster Shell</a></li>
<li class="toctree-l2"><a class="reference internal" href="#run-celery-tasks">Run Celery tasks</a></li>
<li class="toctree-l2"><a class="reference internal" href="#cleaning-the-database-doesn-t-work">Cleaning the database doesn’t work.</a></li>
<li class="toctree-l2"><a class="reference internal" href="#insecureplatformwarning">InsecurePlatformWarning</a></li>
<li class="toctree-l2"><a class="reference internal" href="#working-on-core-ckan">Working on Core CKAN</a></li>
<li class="toctree-l2"><a class="reference internal" href="#boot2docker-upgrading-or-recovering-from-failures">boot2docker - Upgrading or Recovering from failures</a></li>
<li class="toctree-l2"><a class="reference internal" href="#modify-local-docker-images">Modify local Docker images</a></li>
<li class="toctree-l2"><a class="reference internal" href="#remove-obsolete-docker-images">Remove obsolete Docker images</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="docker.html">How datacats uses Docker</a></li>
<li class="toctree-l1"><a class="reference internal" href="commands.html">Command Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Change Log</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">datacats</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>FAQ</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<span id="forkongithub"><a href="https://github.com/datacats/datacats">Fork me on GitHub</a></span>
<div class="section" id="faq">
<h1>FAQ<a class="headerlink" href="#faq" title="Permalink to this headline">¶</a></h1>
<p>This page contains a few recipes on how to use DataCats to easily accomplish
common CKAN tasks. We’re always looking for more. If you have examples of your
own you wish to share, please submit a pull request.</p>
<div class="section" id="run-an-interactive-paster-shell">
<h2>Run an interactive Paster Shell<a class="headerlink" href="#run-an-interactive-paster-shell" title="Permalink to this headline">¶</a></h2>
<p>Anywhere within a datacats source directory, run:</p>
<div class="highlight-python"><div class="highlight"><pre>datacats shell . paster --plugin=pylons shell
</pre></div>
</div>
</div>
<div class="section" id="run-celery-tasks">
<h2>Run Celery tasks<a class="headerlink" href="#run-celery-tasks" title="Permalink to this headline">¶</a></h2>
<p>If you have an extension that is using Celery, make sure that the extension is
installed with <code class="docutils literal"><span class="pre">datacats</span> <span class="pre">install</span></code>. You can then run a
container with a celery daemon like this:</p>
<div class="highlight-python"><div class="highlight"><pre>datacats paster celeryd
</pre></div>
</div>
</div>
<div class="section" id="cleaning-the-database-doesn-t-work">
<h2>Cleaning the database doesn’t work.<a class="headerlink" href="#cleaning-the-database-doesn-t-work" title="Permalink to this headline">¶</a></h2>
<p>When running the command <code class="docutils literal"><span class="pre">paster</span> <span class="pre">db</span> <span class="pre">clean</span></code>, the command will freeze as it is
blocked from cleaning the database if CKAN is connected to the db (<a class="reference external" href="https://github.com/ckan/ckan/issues/2306">see issue</a>)
. To get around this, stop the <code class="docutils literal"><span class="pre">web</span></code> docker container for your site
first, then issue the command, and reload datacats:</p>
<div class="highlight-python"><div class="highlight"><pre>docker stop datacats_web_myckan
datacats paster db clean
datacats reload
</pre></div>
</div>
</div>
<div class="section" id="insecureplatformwarning">
<h2>InsecurePlatformWarning<a class="headerlink" href="#insecureplatformwarning" title="Permalink to this headline">¶</a></h2>
<p>If you get an <code class="docutils literal"><span class="pre">InsecurePlatformWarning</span></code>, this is an issue with the <code class="docutils literal"><span class="pre">urllib3</span></code>
library - <a class="reference external" href="https://urllib3.readthedocs.org/en/latest/security.html">more info here</a>. If you’d like to make it go away, you can run the
<a class="reference external" href="https://urllib3.readthedocs.org/en/latest/security.html#pyopenssl">following</a>:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install pyopenssl ndg-httpsclient pyasn1
</pre></div>
</div>
</div>
<div class="section" id="working-on-core-ckan">
<h2>Working on Core CKAN<a class="headerlink" href="#working-on-core-ckan" title="Permalink to this headline">¶</a></h2>
<p>If you plan on working on core CKAN code, you should first <code class="docutils literal"><span class="pre">unshallow</span></code> your
copy of the CKAN source. By default datacats only checks out a shallow copy of
the CKAN github repo. This can cause minor headaches if you are planning on
contributing your code changes to core CKAN.</p>
<p>In the <code class="docutils literal"><span class="pre">/ckan</span></code> directory of your datacats source directory, run the following git
command:</p>
<div class="highlight-python"><div class="highlight"><pre>git fetch --unshallow
</pre></div>
</div>
</div>
<div class="section" id="boot2docker-upgrading-or-recovering-from-failures">
<h2>boot2docker - Upgrading or Recovering from failures<a class="headerlink" href="#boot2docker-upgrading-or-recovering-from-failures" title="Permalink to this headline">¶</a></h2>
<p>Sometimes you will need to upgrade boot2docker. Or, you may encounter a problem
where the boot2docker VM is unreachable or otherwise broken. Whatever the case,
if you had to delete the boot2docker VM and create a new one, follow these steps
to get your CKAN sites up and running again:</p>
<ul>
<li><p class="first">First, you will need to pull the CKAN docker images again:</p>
<div class="highlight-python"><div class="highlight"><pre>datacats pull
</pre></div>
</div>
</li>
<li><p class="first">Clean your datacats environments so they can be re-initialized:</p>
<div class="highlight-python"><div class="highlight"><pre>cd myckan
datacats purge
</pre></div>
</div>
</li>
<li><p class="first">Finally, initialize the environment:</p>
<div class="highlight-python"><div class="highlight"><pre>datacats init
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="modify-local-docker-images">
<h2>Modify local Docker images<a class="headerlink" href="#modify-local-docker-images" title="Permalink to this headline">¶</a></h2>
<p>When developing or troubleshooting, it might be desirable to modify local
Docker containers. Note, this is not part of the normal workflow and should
not be necessary in day-to-day deployment and use.</p>
<p>First, pull the all the latest images with <code class="docutils literal"><span class="pre">datacats</span> <span class="pre">pull</span> <span class="pre">-a</span></code>.
Next, run each command separately on the desired container, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre>docker run datacats/web apt-get install -y some-extra-package
docker ps -lq
6f51fba7febb
docker commit 6f51fba7febb datacats/web
</pre></div>
</div>
<p>This will persist until you <code class="docutils literal"><span class="pre">datacats</span> <span class="pre">pull</span></code> again.</p>
</div>
<div class="section" id="remove-obsolete-docker-images">
<h2>Remove obsolete Docker images<a class="headerlink" href="#remove-obsolete-docker-images" title="Permalink to this headline">¶</a></h2>
<p>Building Docker images locally will retain the image snapshots and eventually
raise a “Docker APIError 500: no space left on device”.</p>
<p>To free up hard drive space, remove only the obsolete docker images with:</p>
<div class="highlight-python"><div class="highlight"><pre>rmi $(docker images -q)
</pre></div>
</div>
<p>Remember that the user running this command must be in the <code class="docutils literal"><span class="pre">docker</span></code> group.
<code class="docutils literal"><span class="pre">rmi</span></code> will only remove images which are not currently running as containers.
This step is largely risk-free, as you can restore any images by simply pulling
or building them again - only local modifications to images can be lost.</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="docker.html" class="btn btn-neutral float-right" title="How datacats uses Docker" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="guide.html" class="btn btn-neutral" title="User Guide" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2015, boxkite.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.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>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>