Skip to content

AllAboutProjects

Gregory V. Bard edited this page Jul 20, 2016 · 27 revisions

All about Projects!

Remember: if you don't find what you need, or if you'd like to ask a question, then please email [email protected] at any time. We'd love to hear from you! Please include a link (the URL address in your browser) to any relevant project or document, as part of your email.

List of Questions:

Question: How can I move a file from one project to another?

This is currently done with the "copy" command, not the "move" command. That's for the safety of your files. If you like, you can copy the file from one project to another, and then delete the original.

Question: How can I create public projects on SageMathCloud?

You can make individual files and folders public. Pull up information for a file (click the info icon), and click on "Share Publicly". Once you do this, simply share the URL that is displayed in the top of your browser when you look at the file (or directory). Anybody else who views that link will see the file, and can create an account and copy it to their own project.

You can also publish Jupyter notebooks via a Publish button -- see this video.

Question: If I "share" a file, does it become public to everyone and/or searchable? Or is the only way to get to it via a link and a SageMath account?

When you click "Share Publicly" in the info dialog for a file or directory, then yes, it does become public to everyone (as the name "publicly" suggests). It is NOT searchable (via Google, say) right now, but may become searchable later, when I implement something to encourage that. The only way to get it today is via a link, after you share it publicly. But that is temporary. The person getting the link does not need a SageMath account -- try opening the link in private browsing mode to see.

Question: How Do I Restart a project?

First, when the project is open, you should see an icon with a wrench marked "settings." This is near the top of the window, towards the left about 1/4th of the way across your screen. Click on that wrench.

Second, there is a box with several items in it, called "Project Control." There is an icon with some gears next to that. Often you have to scroll-down to find that box.

Third, inside that box, there is a button marked "Restart Project..." with a lightening bolt. Click that. By the way, the reason a lightening bolt was used is that this is not a minor operation.

  • All computations will be stopped (in UNIX-language, that means "all processes will be killed").
  • Good News: You don't lose unsaved files.
  • You do lose any information (state of variables/processes) in RAM.
  • However, anything in files, as long as it's moved from the browser to the web servers (in most cases, at most a few seconds of information), is actually permanently saved to disk already in the database, and will not be lost.
  • When the project starts back up, even if the files on disk are in an older state, the files you see yourself editing in your browser are new with nothing lost. Those files will then be updated on disc very shortly.
  • On the other hand, it will update the project code, and start the project running again.

Fourth, after you click on the "Restart Project..." icon, a warning pops up. Read the warning, and then click on "Restart Project Server" if you want to restart the project. Otherwise, hit "cancel."

Fifth, give the project a good 30 seconds to restart. A lot has to happen, and it might take some time.

Question: I can access some of my files/projects in my SageMathCloud account but not others in that same account. What's wrong?

Sometimes this can happen if you are using multiple SageMathCloud accounts in the same browser. This can happen even if you are not using two different accounts simultaneously.

We have a short help page, Tips for using more than one SageMathCloud account which discusses this. The suggestions there will make it work very smoothly for you.

Question: What can I store in a project?

The available webspace is a courtesy to be able to run your computational projects online. It's not for downloading arbitrary stuff from the internet. For more details about our policies, please read https://cloud.sagemath.com/policies/terms.html

Question: How do I connect via SSH into one of my SageMathCloud projects?

This is about the Secure SHell (SSH), a tool for connecting securely between two computers. If you're unfamiliar with SSH, then you probably don't want to attempt this.

To SSH into your SageMathCloud project you need to create public/private keys. That's covered by the next question, immediately below. You only have to do this once per project.

After that's done, under "Project Control" in project settings (the wrench icon), you'll find a button labeled "SSH into your project." Click it, and then you will see the ssh command line that you can type (on any computer anywhere) to ssh to your project.

Question: How do I create public/private keys, so that I can SSH into my project?

For Microsoft Windows users, a free SSH client with key generator is Putty; see instructions for generating key with Putty.

On OS X, open a Terminal, then type cat .ssh/id_rsa.pub to see if you already have a public key. If not type ssh-keygen to create a public key. Then type cat .ssh/id_rsa.pub to see your key; you may then copy and paste it into the file .ssh/authorized_keys inside your SageMathCloud project.

** Next Steps:**

Once you have your public key, convert it into the format below---which must all be on one long line!

Next, you must add an ssh public key to your project. After that's done, under "Project Control" in project settings (the wrench icon), you'll find a button labeled "SSH into your project." Click it, and you will see a link "add a public key to ~/.ssh/authorized_keys" right there. Now click on that, and paste an ssh public key into that file, then save it.

This is what you will paste into the file .ssh/authorized_keys in your project in SageMathCloud.

ssh-rsa
AAAAB3NzaC1yc2EAAAABJQAAAQEAkN6u3LIzcNgvWE3iNm4sySrR8X7UAc0ydWCKDZXaPM8XVhrCX3O5V+wyxufyZPDh3NmarDLoiLKTSVJap5tU05UKbO5lyINz76y+/LX74VOZf1lB+TiTgsXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXVNMFPYTG1mSaSLv8wDzFgF+CDfm9IOWZKZFERlGzUokEflQ89tQMPywKEfo/L1TJo3mJwWG3yg8gFmkKE4pfX1hF2Dyq5hHS/8L5YvCu141wITwkmtv+LYdui8WpWL5p8egBDjjMYRy0ChcNb3hmAo8xIRJ7YzGw+9uxsPUAebsQuUPCbx+19r3UQOJ8mgsP1tyjHLw==

Now you can ssh to your project. Right there, under "Project Control", you will see the ssh command line that you can type (on any computer anywhere) to ssh to your project.

Question: I created an ssh key in my project; how do I easily copy it?

If you type ssh-keygen in a terminal, then you'll generate an ssh key, which you might use with github (say) or sage's trac to easily push and pull to repositories. To copy this ssh key, you could type cat .ssh/id_rsa.pub and copy in the terminal, but you'll have to manually delete a bunch of newlines. Alternatively, do the following:

  1. In the project file list, click on the icon that looks like an eye in the middle on the right side of the screen to reveal hidden files (those that start with a dot).

  2. Click on the .ssh directory -- you can easily find it by typing "ssh" in the search box labeled "choose files..." on the left.

  3. Click on id_rsa.pub, then highlight everything and copy as usual.

  4. Click the eye again to turn off viewing hidden files.

Alternatively, type this into the small "terminal command" box in "files": cat ~/.ssh/*.pub. Below the box, you can conveniently copy/paste it!

You can also type the following into a full terminal: open ~/.ssh/id_rsa.pub

Question: "I would like to use hashtags to describe my projects" or "I want to categorize my projects"

You can put #foo in the title or description of any project. When you view your list of projects a button will appear for each hashtag, which you can click to show only projects with that tag. There is also excellent support for hashtags in task lists (SageMathCloud's todo list functionality).

Question: I want to start long-running numerically intensive computations on SageMathCloud. What are the current limitations?

Open your project and click on Settings. The default limitations are listed under "Quotas" in the lower left. These can be raised, as mentioned there. Notes:

  1. Projects on free non-members only Virtual Machines will get restarted regularly (these are hosted on Google preemtible instances). You can check if a VM rebooted by typing "uptime". crontab files are persistent.

  2. If a project isn't used (via the web-based UI) for the idle timeout (as listed in quotas), then all processes in that project are terminated and the user is removed (so ssh into the project also is not possible). You can pay to raise the idle timeout.

Question: I want some scratch space

Use /tmp. Files in /tmp may be deleted at any time, and aren't backed up.

Question: Will my code keep running if I disconnect? Even if my computer is put to sleep? Or do I need to have a machine open in order for the process to run?

Under project settings (that's the wrench icon) there is an entry under "Project Usage and Quotas" (left-hand side), which will tell you how long the process will run "in the background." There is an idle timeout for each project, and it will be completely stopped (the technical term in UNIX is "killed") if you don't actively edit a file for that amount of time.

The default for free projects is 1 hour. You can increase this to 24 hours for only $7 per month. This means that if you use your project a little bit once per day, then it will never timeout.

However, free projects have another limitation. A free project can be "killed" (stopped) at any time, whatsoever. This will happen at least once per day. You have to keep this in mind when designing your project. (For example, use checkpointing.) In contrast, all paid projects are immune to this issue. See also Subscription and Pricing Information.

The next question will discuss the output of your processes.

Question: If I have code that has been running for a while, and it times out or is otherwise "killed" (see previous question), what happens to the output?

If you are using a Jupyter notebook, then all output that is printed will be lost if no browser is viewing it. This is a major design flaw in Jupyter.

In contrast, Sage worksheets will capture output even if no browser is observing them.

You can also (of course) write to a file on disk, which might be preferable in some cases.

Question: I want to see all processes running in my project

Type exactly the following in a full terminal (+New--> Terminal) to see all processing running in a project:

htop

You can kill things, etc. See http://linux.die.net/man/1/htop.

Question: I want to know how much memory I am using

Type exactly the following in a full terminal (+New--> Terminal):

smem -tk

It lists all processes and the bottom line shows the total sum. The last RSS column is probably the most interesting one, for more consult man smem. The total used memory is also listed under 'Project usage and quotas" in project settings.

Question: How do I raise the limit on the number of output messages per cell in a Sage worksheet?

import sage_server
sage_server.MAX_OUTPUT_MESSAGES=100000

See this published worksheet for more details.

Also, type sage_server.[tab key] to see information about other limitations.

Question: I want to XXX, but I don't see XXX above.

Do not hesitate to email THE LINK TO YOUR PROJECT TO [email protected] or https://groups.google.com/forum/?fromgroups#!forum/sage-cloud and ask a question.

Clone this wiki locally