-
Notifications
You must be signed in to change notification settings - Fork 7
/
aws.html
414 lines (401 loc) · 21.8 KB
/
aws.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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Amazon Web Services EC2 Clawpack AMI — Clawpack 5.11.x documentation</title>
<link rel="stylesheet" href="_static/base.css" type="text/css" />
<link rel="stylesheet" href="_static/layout.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/flasky.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="shortcut icon" href="_static/clawicon.ico"/>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Clawpack Applications repository" href="apps.html" />
<link rel="prev" title="Clawpack Virtual Machine" href="vm.html" />
</head><body>
<div id="main-wrapper" class="sphinx">
<div id="header-wrapper">
<section id="header">
<!-- <h1><a href="http://clawpack.org/">Clawpack</a></h1> -->
<h1><a href="http://clawpack.org/">Clawpack-5</a></h1>
<nav>
<ul>
<li>
<a href="contents.html">Docs</a>
</li>
<li>
<a href="installing.html">Install</a>
</li>
<li>
<a class="" href="http://clawpack.org/gallery/index.html">Gallery</a>
</li>
<li>
<a href="about.html">Citation</a>
</li>
<li>
<a class="active" href="http://github.com/clawpack">GitHub</a>
</li>
<li>
<a class="" href="community.html">Community</a>
</li>
<li>
<a class="" href="developers.html">Contribute</a>
</li>
</ul>
</nav>
</section>
<div class="decoration"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<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="apps.html" title="Clawpack Applications repository"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="vm.html" title="Clawpack Virtual Machine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="contents.html">Clawpack 5.11.x documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Amazon Web Services EC2 Clawpack AMI</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="amazon-web-services-ec2-clawpack-ami">
<span id="aws"></span><h1>Amazon Web Services EC2 Clawpack AMI<a class="headerlink" href="#amazon-web-services-ec2-clawpack-ami" title="Permalink to this heading">¶</a></h1>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This has not been updated for Clawpack-5 yet,
but it should still work if you start up an instance as described below
and then install Clawpack-5 by following the
<a class="reference internal" href="installing.html#installing"><span class="std std-ref">Installing Clawpack</span></a>.</p>
</div>
<p>To run Clawpack in the Cloud using Amazon Web Services Elastic Cloud
Computing (EC2), first sign up for an account. Note that
you can get 750 hours free micro instance usage
(which may be sufficient for many things) in the
<a class="reference external" href="http://aws.amazon.com/free/">free usage tier</a>.</p>
<p>For general information and a guide to getting started:</p>
<ul class="simple">
<li><p><a class="reference external" href="http://escience.washington.edu/get-help-now/get-started-amazon-web-services">UW eScience information on AWS</a>.</p></li>
<li><p><a class="reference external" href="http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/">Getting started with EC2</a>,
with tutorial to lead you through an example (a similar tutorial geared
to Clawpack is included below).</p></li>
<li><p><a class="reference external" href="http://aws.amazon.com/ec2/faqs">EC2 FAQ</a>.</p></li>
<li><p><a class="reference external" href="http://aws.amazon.com/ec2/#pricing">Pricing</a>. Note: you are charged
per hour for hours (or fraction thereof) that your instance is in
<cite>running</cite> mode, regardless of whether the CPU is being used.</p></li>
</ul>
<section id="finding-the-clawpack-ami">
<h2>Finding the Clawpack AMI<a class="headerlink" href="#finding-the-clawpack-ami" title="Permalink to this heading">¶</a></h2>
<p>Once you have an AWS account, sign in to the
<a class="reference external" href="https://console.aws.amazon.com/ec2/">management console</a>
and click on the
EC2 tab, and then select Region US East (which has cheaper rates) and click
on <cite>AMIs</cite> on the menu to the left.</p>
<p>Change <cite>Viewing:</cite> to <cite>All Images</cite> and <cite>All Platforms</cite> and then <em>after</em> it
has finished loading the database start typing
<cite>uwamath-clawpack</cite> in the search bar. You
should find at least one AMI, as shown in this screen shapshot:</p>
<a class="reference internal image-reference" href="_images/aws1.png"><img alt="_images/aws1.png" src="_images/aws1.png" style="width: 15cm;" /></a>
</section>
<section id="launching-an-instance">
<h2>Launching an instance<a class="headerlink" href="#launching-an-instance" title="Permalink to this heading">¶</a></h2>
<p>Select the Clawpack image and then
click on the <cite>Launch</cite> button on this page to start launching an instance
based on this AMI. This means a virtual machine will be started for you,
initialized with this disk image (which is a Ubuntu linux distribution with
Clawpack and its dependencies).</p>
<p>This should give a popup page that looks like this:</p>
<a class="reference internal image-reference" href="_images/aws2.png"><img alt="_images/aws2.png" src="_images/aws2.png" style="width: 15cm;" /></a>
<p>Here you can select what sort of instance you wish to start (larger
instances cost more per hour).</p>
<p>Click <cite>Continue</cite> on the next few screens and eventually you get to one that
looks like:</p>
<a class="reference internal image-reference" href="_images/aws3.png"><img alt="_images/aws3.png" src="_images/aws3.png" style="width: 15cm;" /></a>
<p>If you don’t already have a key pair, create a new one and then
select this key pair here.</p>
<p>Click <cite>Continue</cite> and you will get a screen to set Security Groups. Select
the <cite>quick-start-1</cite> option. On the next screen click <cite>Launch</cite>.</p>
</section>
<section id="logging-on-to-your-instance">
<h2>Logging on to your instance<a class="headerlink" href="#logging-on-to-your-instance" title="Permalink to this heading">¶</a></h2>
<p>Click <cite>Close</cite> on the next page to
go back to the Management Console. Click on <cite>Instances</cite> on the left menu
and you should see a list of instance you
have created, in your case only one. If the status is not yet <cite>running</cite>
then wait until it is (click on the <cite>Refresh</cite> button if necessary).</p>
<p><em>Click on the instance</em> and information about it should appear at the bottom
of the screen. Scroll down until you find the <cite>Public DNS</cite> information,
highlighted on the screenshot below:</p>
<a class="reference internal image-reference" href="_images/aws4.png"><img alt="_images/aws4.png" src="_images/aws4.png" style="width: 15cm;" /></a>
<p>Go into the directory where your key pair is stored, in a file with a name
like <cite>rjlkey.pem</cite> and you should be able to <cite>ssh</cite> into your instance using
the name of the public DNS, with format like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ssh -i KEYPAIR-FILE ubuntu@DNS
</pre></div>
</div>
<p>where KEYPAIR-FILE and DNS must be replaced by the appropriate
things, e.g. for the above example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ssh -i rjlkey.pem [email protected]
</pre></div>
</div>
<p>Note:</p>
<ul class="simple">
<li><p>You must include <cite>-i keypair-file</cite></p></li>
<li><p>You must log in as user ubuntu.</p></li>
</ul>
</section>
<section id="using-clawpack">
<h2>Using Clawpack<a class="headerlink" href="#using-clawpack" title="Permalink to this heading">¶</a></h2>
<p>Once you have logged into your instance, you are on Ubuntu Linux that has
software needed for Clawpack pre-installed, including:</p>
<ul class="simple">
<li><p>gfortran</p></li>
<li><p>Ipython, numpy, scipy, matplotlib</p></li>
<li><p>make</p></li>
<li><p>git</p></li>
<li><p>netcdf</p></li>
<li><p>apache web server</p></li>
</ul>
<p>Other software is easily installed using <cite>apt-get install</cite>.</p>
<p>The current development version of Clawpack is installed in
<cite>/claw/clawpack-4.x</cite>. If you want to use this version, you might want to:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ cd /claw/clawpack-4.x
$ git fetch origin # bring over any recent changes
$ git merge origin/master # merge them in
$ python python/make_libs.py # compile libraries
</pre></div>
</div>
<p>The <cite>$CLAW</cite> variable is set to point to this version of Clawpack (in the
<cite>.bashrc</cite> file).</p>
<p>Of course you could instead download a tar file of Clawpack and install
following the instructions at <a class="reference internal" href="installing.html#installing"><span class="std std-ref">Installing Clawpack</span></a>. At any rate, see that
section for instructions on what to do next if you are new to Clawpack.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>If you want to use Clawpack-5, instead follow the
<a class="reference internal" href="installing.html#installing"><span class="std std-ref">Installing Clawpack</span></a>.</p>
</div>
</section>
<section id="viewing-plots-of-results">
<h2>Viewing plots of results<a class="headerlink" href="#viewing-plots-of-results" title="Permalink to this heading">¶</a></h2>
<p>If you run Clawpack on your instance then you will probably want to view the
results. There are at least three possible approaches (see <a class="reference internal" href="plotting.html#plotting"><span class="std std-ref">Plotting with Visclaw</span></a>
for general information about plotting in Clawpack):</p>
<ul>
<li><p>If you are on a computer that supports X windows and you
add the <cite>-X</cite> flag to your <cite>ssh</cite> command, then you should be able to
plot interactively (see <a class="reference internal" href="plotting_python.html#plotting-iplotclaw"><span class="std std-ref">Interactive plotting with Iplotclaw</span></a>).
Response may be pretty slow, however.</p></li>
<li><p>If you create plots using</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .plots
</pre></div>
</div>
<p>then you will have a directory (named <cite>_plots</cite> by default) that contains
<cite>.png</cite>
figures and <cite>.html</cite> files for viewing them. You can tar this directory up
and transfer it to your local machine using <cite>sftp</cite>, and then view locally.</p>
<p>Note that the plot files are often <strong>much</strong> smaller than the Fortran
output files in <cite>_output</cite>, and so much quicker to transfer.</p>
</li>
<li><p>You can view the plots directly using a web browser as explained in the
next section.</p></li>
</ul>
</section>
<section id="viewing-webpages-directly-from-your-instance">
<h2>Viewing webpages directly from your instance<a class="headerlink" href="#viewing-webpages-directly-from-your-instance" title="Permalink to this heading">¶</a></h2>
<p>If you use</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .plots
</pre></div>
</div>
<p>to make a set of plot files and html files for viewing them, you can view
them directly by opening a web browser to an appropriate path on your
instance.</p>
<p>The apache webserver should already be running, but to allow people to view
webpages you will need to adjust the security settings. Go back to the
Management Console and click on <cite>Security Groups</cite> on the left menu. Select
<cite>quick-start-1</cite> and then click on <cite>Inbound</cite>. You should see a list of ports
that only lists 22 (SSH). You want to add port 80 (HTTP). Select HTTP from
the drop-down menu that says <cite>Custom TCP Rule</cite> and type 80 for the <cite>Port
range</cite>. Then click <cite>Apply Rule Changes</cite>. This should give something like
the next screen shot:</p>
<a class="reference internal image-reference" href="_images/aws5.png"><img alt="_images/aws5.png" src="_images/aws5.png" style="width: 15cm;" /></a>
<p>Now you should be able to point your browser to <cite>http://DNS</cite> where <cite>DNS</cite> is
replaced by the Public DNS name of your instance, the same as used for the
<cite>ssh</cite> command. So for the example above, this would be</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>`http://ec2-50-19-75-229.compute-1.amazonaws.com`.
</pre></div>
</div>
<p>You should see this page:</p>
<a class="reference internal image-reference" href="_images/aws6.png"><img alt="_images/aws6.png" src="_images/aws6.png" style="width: 15cm;" /></a>
<p>The page being displayed can be found in <cite>/var/www/index.html</cite> on your
instance. Any files you want to be visible on the web should be in
<cite>/var/www</cite>, or it is sufficient to have a link from this directory to where
they are located (created with the <cite>ln -s</cite> command in linux).</p>
<p>So, for example, if you do the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ cd /var/www
$ ln -s /claw/clawpack-4.x/apps ./apps
</pre></div>
</div>
<p>Then you should be able to see the <cite>apps</cite> directory in your web browser,
which would be at</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">ec2</span><span class="o">-</span><span class="mi">50</span><span class="o">-</span><span class="mi">19</span><span class="o">-</span><span class="mi">75</span><span class="o">-</span><span class="mf">229.</span><span class="n">compute</span><span class="o">-</span><span class="mf">1.</span><span class="n">amazonaws</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">apps</span><span class="o">/</span>
</pre></div>
</div>
<p>for the above example. You will have to replace the DNS with that of your
instance.</p>
<p>If you want to expose all of your home directory to the web:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ cd /var/www
$ ln -s /home/ubuntu ./home
</pre></div>
</div>
</section>
<section id="transferring-files-to-from-your-instance">
<h2>Transferring files to/from your instance<a class="headerlink" href="#transferring-files-to-from-your-instance" title="Permalink to this heading">¶</a></h2>
<p>You can use <cite>scp</cite> to transfer files between a running instance and
the computer on which the ssh key is stored.</p>
<p>From your computer (not from the instance):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ scp -i KEYPAIR-FILE FILE-TO-SEND ubuntu@DNS:REMOTE-DIRECTORY
</pre></div>
</div>
<p>where DNS is the public DNS of the instance and <cite>REMOTE-DIRECTORY</cite> is
the path (relative to home directory)
where you want the file to end up. You can leave off
<cite>:REMOTE-DIRECTORY</cite> if you want it to end up in your home directory.</p>
<p>Going the other way, you can download a file from your instance to
your own computer via:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ scp -i KEYPAIR-FILE ubuntu@DNS:FILE-TO-GET .
</pre></div>
</div>
<p>to retrieve the file named <cite>FILE-TO-GET</cite> (which might include a path
relative to the home directory) into the current directory.</p>
</section>
<section id="stopping-your-instance">
<h2>Stopping your instance<a class="headerlink" href="#stopping-your-instance" title="Permalink to this heading">¶</a></h2>
<p>Once you are done computing for the day, you will probably want to stop your
instance so you won’t be charged while it’s sitting idle. You can do this
by selecting the instance from the Management Console / Instances, and then
select <cite>Stop</cite> from the <cite>Instance Actions</cite> menu.</p>
<p>You can restart it later and it will be in the same state you left it in.
But note that it will probably have a new Public DNS!</p>
</section>
<section id="creating-your-own-ami">
<h2>Creating your own AMI<a class="headerlink" href="#creating-your-own-ami" title="Permalink to this heading">¶</a></h2>
<p>If you add additional software and want to save a disk image of your
improved virtual machine (e.g. in order to launch additional images in the
future to run multiple jobs at once), simply click on <cite>Create Image (EBS
AMI)</cite> from the <cite>Instance Actions</cite> menu.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p><a href="http://clawpack.org/">
<img class="logo" src= "_static/clawlogo.jpg" alt="Logo"/>
</a>
<h2>Version 5.11.x</h2>
</p>
<div>
<h3><a href="contents.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Amazon Web Services EC2 Clawpack AMI</a><ul>
<li><a class="reference internal" href="#finding-the-clawpack-ami">Finding the Clawpack AMI</a></li>
<li><a class="reference internal" href="#launching-an-instance">Launching an instance</a></li>
<li><a class="reference internal" href="#logging-on-to-your-instance">Logging on to your instance</a></li>
<li><a class="reference internal" href="#using-clawpack">Using Clawpack</a></li>
<li><a class="reference internal" href="#viewing-plots-of-results">Viewing plots of results</a></li>
<li><a class="reference internal" href="#viewing-webpages-directly-from-your-instance">Viewing webpages directly from your instance</a></li>
<li><a class="reference internal" href="#transferring-files-to-from-your-instance">Transferring files to/from your instance</a></li>
<li><a class="reference internal" href="#stopping-your-instance">Stopping your instance</a></li>
<li><a class="reference internal" href="#creating-your-own-ami">Creating your own AMI</a></li>
</ul>
</li>
</ul>
</div><h3>Related Topics</h3>
<ul>
<li><a href="contents.html">Documentation overview</a><ul>
<li>Previous: <a href="vm.html" title="previous chapter">Clawpack Virtual Machine</a></li>
<li>Next: <a href="apps.html" title="next chapter">Clawpack Applications repository</a></li>
</ul></li>
</ul>
<div class="widget navlinks">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/aws.rst.txt"
rel="nofollow"
target="_blank">Source .rst</a></li>
<li><a href="https://github.com/clawpack/doc/blob/dev/doc/aws.rst"
rel="nofollow"
target="_blank">Source on GitHub</a></li>
<li><a href="https://github.com/clawpack/doc/commits/dev/doc/aws.rst"
rel="nofollow"
target="_blank">History</a></li>
<li><a href="https://github.com/clawpack/doc/edit/dev/doc/aws.rst"
rel="nofollow"
target="_blank">Suggest Edits</a></li>
<li><a href="https://github.com/clawpack/doc/issues/new/choose"
rel="nofollow"
target="_blank">Raise an Issue</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
<h4>Latest Version</h4>
<ul>
<li><a href="./dev/aws.html">dev</a></li>
<li><a href="aws.html">v5.11.x</a></li>
</ul>
<h4>Older Versions</h4>
<ul>
<li><a href="./v5.10.x/aws.html">v5.10.x</a></li>
<li><a href="./v5.7.x/aws.html">v5.7.x</a></li>
<li><a href="./v5.8.x/aws.html">v5.8.x</a></li>
<li><a href="./v5.9.x/aws.html">v5.9.x</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright CC-BY 2024, The Clawpack Development Team.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44811544-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>