Running simulations in the cloud: Difference between revisions
No edit summary |
|||
| Line 27: | Line 27: | ||
== NetLogo in the cloud == | == NetLogo in the cloud == | ||
Run headless on an AWS machine. Please see the [[NetLogo]] page for instructions on [http://www.seslink.org/wiki/NetLogo#Running_NetLogo_headless how to run NetLogo headless.] | Run headless on an AWS machine. Please see the [[NetLogo]] page for instructions on [http://www.seslink.org/wiki/NetLogo#Running_NetLogo_headless how to run NetLogo headless.] | ||
== R in the clouds == | |||
Run a local script on a remote (fast) computer directly without RServer | |||
'''Prerequsites:''' | |||
* you can access the remote computer with 'ssh' from a terminal | |||
* R (and necessary packages) is installed on the remote computer | |||
* R has access to all the data that are analyzed (upload i.e. with 'rsync', 'sftp' or [https://filezilla-project.org/ filezilla]) | |||
* to see plots directly: | |||
** MacOS needs: [https://www.xquartz.org/ XQuarz], | |||
** Windows needs: | |||
**:[http://mobaxterm.mobatek.net/ MobaXterm] - a powerful X-Server with many remote access features or | |||
**:[https://sourceforge.net/projects/xming/ Xming], a minimalistic X server for Windows | |||
** Linux needs ... nothing ;-) | |||
'''Procedure:''' | |||
# Write your R script in a(ny) text editor (perferably one with R syntax highlight mode and bracket auto-close: e.g. Geany, Gedit, TextWrangler, Atom, etc.) | |||
# Save it (Ctrl-s/Cmd-s). Do not close the editor! | |||
# Open a terminal | |||
# use commmand <br /> | |||
#: 'ssh -X user@ssh-server 'R --slave' < ~/path-to/MyRscript.R | |||
#: | |||
#: -> exchange 'user', 'ssh-server' and 'MyScript.R' accordingly | |||
# Look at your results, | |||
# modify your script, save ('Ctrl-s/Cmd-s') | |||
# re-run terminal command (use the 'up arrow' on your keyboard to get it back) | |||
'''Repeat steps 6 and 7 as often needed''' | |||
''Comments:'' | |||
*The '-X' flag allows you to have a result plot shown directly as a pop-up window. | |||
*In Windows exchange path separators '/'for '\' | |||
Revision as of 16:40, 24 January 2017
Amazon Web Services (AWS)
Amazon Web Services, or AWS for short, is a cloud computing platform created by Amazon. We use it to rent computational capacity when we need to run models or other computations in the cloud. There are two main ways of running computations on AWS; using an existing machine or using a spot instance. Both ways are outlined below.
AWS offers a whole host of different services, most of them named something incomprehensible. This handy glossary will help you decipher AWS's odd naming scheme.
Accessing AWS machines
TODO: Describe SSH procedure
Existing machines
TODO: AWS HOWTO
Spot instances
TODO: Scripts
Paying for time
Amazon requires that you add a credit card to the account that owns the virtual servers. This will then be charged per month for usage over the last calendar month. Note that the person who owns the account will need to do the reimbursement.
Cost reimbursement should be charged to the SES-LINK project. Use the following cost carriers in Primula:
Project 1483701 EU SES Link Department 481 Project 1483701 Unit 48110 Cost carrier 481002
The expense should be recorded in Primula as an expense in foreign currency. Add it as "Laboratory supplies" and add a note saying that it's computation time. Attach the invoice from Amazon, and if desired a printout from your bank account so you get the correct exchange rate. Send these in as any other expense, and CC Maja on the e-mail so she can verify the expense to the project.
NetLogo in the cloud
Run headless on an AWS machine. Please see the NetLogo page for instructions on how to run NetLogo headless.
R in the clouds
Run a local script on a remote (fast) computer directly without RServer
Prerequsites:
- you can access the remote computer with 'ssh' from a terminal
- R (and necessary packages) is installed on the remote computer
- R has access to all the data that are analyzed (upload i.e. with 'rsync', 'sftp' or filezilla)
- to see plots directly:
Procedure:
- Write your R script in a(ny) text editor (perferably one with R syntax highlight mode and bracket auto-close: e.g. Geany, Gedit, TextWrangler, Atom, etc.)
- Save it (Ctrl-s/Cmd-s). Do not close the editor!
- Open a terminal
- use commmand
- 'ssh -X user@ssh-server 'R --slave' < ~/path-to/MyRscript.R
- -> exchange 'user', 'ssh-server' and 'MyScript.R' accordingly
- Look at your results,
- modify your script, save ('Ctrl-s/Cmd-s')
- re-run terminal command (use the 'up arrow' on your keyboard to get it back)
Repeat steps 6 and 7 as often needed
Comments:
- The '-X' flag allows you to have a result plot shown directly as a pop-up window.
- In Windows exchange path separators '/'for '\'