Run relax at cloud.sagemath.com
- 1 Try relax at cloud.sagemath.com
- 2 Sign-up and ssh to account
- 3 Inspect cloud.sagemath.com
- 4 Upload files to the server
- 5 Install trunk of relax
- 6 Use of relax trunk
- 7 See also
Try relax at cloud.sagemath.com
This tutorial shows how to get relax running at cloud.sagemath.com.
cloud.sagemath.com is optimal for
- fully functional linux and python environment
- online accessibility
- rapid installation of relax
- testing purposes
cloud.sagemath.com is not the optimal for
- long-time calculations stretching over several days
- multiple CPU's (above 4 CPU's )
- The benefits are well explained here: http://www.sagemath.org/library-why.html
- The pricing is here: https://cloud.sagemath.com/policies/pricing.html
- For the FAQ of sagemath, visit: https://github.com/sagemathinc/smc/wiki/FAQ
- Miling list: https://groups.google.com/forum/?fromgroups#!forum/sage-cloud
The meanings are
- Member hosting: This lets you move a project to a members-only server, which has much less load. If you have 16 of these, you can move 16 projects. You can change which projects you move at any time, though it can take a little while to move a project (depending on load).
- Network access:' This makes it so your project has 100% access to the whole internet, so you can connect to any external website. Otherwise, there is a small whitelist of sites (e.g., pypi, github) that a project may connect to.
- Idle timeout You can allocate time between projects so that if you just shut your browser and come back (or aren't active), the project will continue running your code instead of just shutting down. By default, projects top running after 1 hour of not being actively used through a web browser.
- CPU shares: This allows you to increase your priority relative to other users on the same computer. So if the system is loaded, your code will run a bit faster than other users.
Sign-up and ssh to account
Do the following
- Go to https://cloud.sagemath.com/
- Sign-up for account. Note, you don't even need a "working e-mail", as no confirmation mail is send. It just works.
Establish file access over SSH
At your own computer, create a SSH-keypair.
Generating public/private rsa key pair. Enter file in which to save the key (/Users/tlinnet/.ssh/id_rsa): id_sage Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in id_sage. Your public key has been saved in id_sage.pub. The key fingerprint is: SHA256:SqvIflxxxxx/xxxxxxxxxxxxx/XXXX tlinnet@linmac The key's randomart image is: +---[RSA 2048]----+ xxxxx +----[SHA256]-----+
Then load your key and copy the content the public-key to clipboard
tlinnet@linmac:~$ ssh-add $HOME/.ssh/id_sage
Enter passphrase for /Users/tlinnet/.ssh/id_sage: Identity added: /Users/tlinnet/.ssh/id_sage (/Users/tlinnet/.ssh/id_sage)
tlinnet@linmac:~$ ssh-add -l
Then copy the content of the public key to clipboard
cat $HOME/.ssh/id_sage.pub # On a mac, one can copy directly to the the clipboard of the computer cat $HOME/.ssh/id_sage.pub | pbcopy # On linux
Then create a project at cloud.sagemath.com
- Click at the project, and click then on the settings wrench.
- Under the info box Project control, there is a button to >_ SSH into your project...
- Then click on the link to ~/.ssh/authorized_keys,
- In the next window, paste in the line from before of cat $HOME/.ssh/id_sage.pub
- Save and close the tab of ~/.ssh/authorized_keys, .
- Click again on the settings wrench.
- Again under the info box Project control, there is a button to >_ SSH into your project...
- Here comes the USER@HOST info you need
It could look like this:
From you own terminal at your computer, try
To make things easier, you can but this in your SSH config file
bash SAGEUSER=79688471c8704aa2b7b0be59d626e9cf SAGEHOST=compute2-us.sagemath.com cat <<EOF >> $HOME/.ssh/config Host sage User $SAGEUSER HostName $SAGEHOST Compression yes ForwardX11 no Port 22 EOF cat $HOME/.ssh/config
Then try the connection
When ssh connected to your project, try some of the following commands:
uptime whoami lscpu htop -u `whoami` tmux
Upload files to the server
We download the latest version of relax and upload from your personal computer to the server.
NOTE, you should have a webbrowser open where you are logged in to the project. The IDLE time of 1 hour could have closed the connection.
bash v=4.0.3 CDIR=$HOME/Downloads/relax_test mkdir -p $CDIR cd $CDIR curl http://download.gna.org/relax/relax-$v.GNU-Linux.x86_64.tar.bz2 -o relax-$v.GNU-Linux.x86_64.tar.bz2
Then copy it to the server, using SSH and the config file prepared before with the hostname sage
#First fast check touch test.txt scp test.txt sage: ssh sage ls exit # Upload of approx 100 MB file scp relax-4.0.3.GNU-Linux.x86_64.tar.bz2 sage: ssh sage ls exit # Or use rsync rsync --progress -avzhe ssh $CDIR sage: ssh sage ls exit
Unpack relax and run
ssh sage mkdir -p $HOME/bin tar xvjf relax-4.0.3.GNU-Linux.x86_64.tar.bz2 rm relax-4.0.3.GNU-Linux.x86_64.tar.bz2 ln -s $HOME/relax-4.0.3/relax $HOME/bin # See version and test relax -i relax --time -u relax --time -s
Install trunk of relax
ssh sage git clone git://git.code.sf.net/p/nmr-relax/code/ relax # Build cd relax scons # Link to executable cd $HOME mkdir -p $HOME/bin ln -s $HOME/relax/relax $HOME/bin/relax # See relax info relax -i
v=1.0.12 mkdir -p $HOME/Downloads cd $HOME/Downloads curl http://download.gna.org/minfx/minfx-$v.tar.gz -o minfx-$v.tar.gz tar -xzf minfx-$v.tar.gz cd minfx-$v pip install . cd $HOME # Test relax relax_trunk -i
v=1.0.4 mkdir -p $HOME/Downloads cd $HOME/Downloads curl http://download.gna.org/bmrblib/bmrblib-$v.tar.gz -o bmrblib-$v.tar.gz tar -xzf bmrblib-$v.tar.gz cd bmrblib-$v pip install . cd $HOME # Test relax relax_trunk -i
Use of relax trunk
Systemtests of relax trunk
# Test relax relax_trunk -i relax_trunk --time -u relax_trunk --time -s Relax_disp.test_repeat_cpmg relax_trunk --time -s Relax_disp relax_trunk --time -s