public single cell server

25 views
Skip to first unread message

Jason Grout

unread,
Jul 29, 2011, 8:11:16 PM7/29/11
to sage-...@googlegroups.com, sage-s...@googlegroups.com, sage...@googlegroups.com, sage-n...@googlegroups.com
Hi everyone,

I'd like to announce a trial beta run of a public single cell server:

http://sagemath.org:5467/

The idea is that this is a single cell that can very easily be embedded
in any webpage. This is the start of a comprehensive Sage web service
as well, and lays a piece of the ground work for a much more scalable
model for doing computations in the normal notebook.

It's ready to be hammered by the larger community at this point. I will
be mentioning this next week at Mathfest, so please try to break it :).
I think just about any normal Sage computation should work. Please
report any errors to me.

We've also rewritten interacts, so please especially test interacts.
There are some exciting new features for interacts in this rewrite that
I can detail later. The main focus for this testing is that current
existing interacts should work unchanged, hopefully.

Thanks especially to Ira Hanson and Alex Kramer for doing much of the
design and implementation work (funded by Drake University and the NSF),
to William for an early version, and Fernando Perez and Robert Bradshaw
for many helpful conversations. I'm sure there are people I've missed
who have contributed in some way; please let me know if I've missed someone!

The repository for the code is:
https://github.com/jasongrout/simple-python-db-compute. The
instructions are not quite up to date, but I'll be working on those soon.

Thanks,

Jason

--
Jason Grout

Jason Grout

unread,
Jul 30, 2011, 2:05:54 AM7/30/11
to sage-...@googlegroups.com, P Purkayastha, sage-s...@googlegroups.com, sage...@googlegroups.com, sage-n...@googlegroups.com
On 7/29/11 8:15 PM, P Purkayastha wrote:
> Hi,
> Some computations ran fine. However, the code from
> http://wiki.sagemath.org/interact/ didn't. Only the first order is
> shown, and moving the slider provides no update.


Thanks. That is fixed now.

Jason

Juanlu001

unread,
Jul 30, 2011, 5:40:21 AM7/30/11
to sage-n...@googlegroups.com, sage-...@googlegroups.com, sage-s...@googlegroups.com, sage...@googlegroups.com
I have tested multiple interacts of mine and some computations, and everything seems to work quite well except for the backslash \, which I tried to use to split lines. It gives a syntax error:

SyntaxError                               Traceback (most recent call last)
SyntaxError: invalid syntax (<string>, line 57)
The line number depends on the length of the code.

Anyway, well done :)

Jason Grout

unread,
Jul 30, 2011, 6:41:44 AM7/30/11
to sage-s...@googlegroups.com, sage-...@googlegroups.com, sage...@googlegroups.com

Jason Grout

unread,
Jul 31, 2011, 3:37:11 AM7/31/11
to sage-s...@googlegroups.com, sage-...@googlegroups.com, sage...@googlegroups.com
On 7/29/11 5:11 PM, Jason Grout wrote:
> Hi everyone,
>
> I'd like to announce a trial beta run of a public single cell server:
>
> http://sagemath.org:5467/
>
> The idea is that this is a single cell that can very easily be embedded
> in any webpage. This is the start of a comprehensive Sage web service as
> well, and lays a piece of the ground work for a much more scalable model
> for doing computations in the normal notebook.
>
> It's ready to be hammered by the larger community at this point. I will
> be mentioning this next week at Mathfest, so please try to break it :).


I posted a log of all commands that have been run on the singlecell
server.

http://sage.math.washington.edu/home/jason/commands.html

Of particular note are the commands around 2011-07-31 03:03:07.436000
(search for that string), where someone is apparently testing the
security of the setup. Whoever did it, how did the security and
infinite loop tests go?

It's fine to test the security (but please do so carefully...if you try
to delete some crucial file, make a backup copy first :), but at the
same time, I'll pull down the public beta server if William is
uncomfortable with those commands.

William: if that testing does make you uncomfortable, feel free to kill
-9 all of my processes on boxen. That would take down the server.

Thanks,

Jason

Jason Grout

unread,
Jul 31, 2011, 3:39:27 AM7/31/11
to sage-n...@googlegroups.com, Juanlu001, sage-...@googlegroups.com, sage-s...@googlegroups.com, sage...@googlegroups.com
On 7/30/11 2:40 AM, Juanlu001 wrote:
> I have tested multiple interacts of mine and some computations, and
> everything seems to work quite well except for the backslash \, which I
> tried to use to split lines. It gives a syntax error:
>
> SyntaxError Traceback (most recent call last)
> SyntaxError: invalid syntax (<string>, line 57)


Backslashes should work now. Can you test it please?

Thanks,

Jason

Juanlu001

unread,
Jul 31, 2011, 4:36:28 AM7/31/11
to sage-n...@googlegroups.com, Juanlu001, sage-...@googlegroups.com, sage-s...@googlegroups.com, sage...@googlegroups.com
Yep, it seems they work now. Great!

fbotana

unread,
Sep 12, 2011, 8:27:38 AM9/12/11
to sage-support
Hi all,

I've been using the single cell server at sagenb.org:5467 during a
couple of months and I find that it is a very interesting tool for
remote computations. Thanks!
I tried to install the server, but in each trial I get errors. Would
it be possible to get a VirtualBox appliance with the single server?

Thank you.
Francisco

Jason Grout

unread,
Sep 12, 2011, 10:24:35 PM9/12/11
to sage-s...@googlegroups.com

Certainly. Anyone is more than welcome to put one together---I'm sure
people would appreciate it. What errors do you get when you try to
install it? How far did you get and what did you do? We tried to make
the instructions explicit.

Thanks,

Jason

Alexander Juarez

unread,
Sep 12, 2011, 11:29:49 PM9/12/11
to sage-n...@googlegroups.com, sage-...@googlegroups.com, sage-s...@googlegroups.com, sage...@googlegroups.com
Hi Jason,
This is really neat and I love the way the code view is integrated. I
was checking out the cell, and would suggest a version optimized for
handhelds.
Awesome work,
Alex Juarez

Jason Grout

unread,
Sep 12, 2011, 11:40:24 PM9/12/11
to sage-s...@googlegroups.com, sage-...@googlegroups.com, sage...@googlegroups.com
On 9/12/11 10:29 PM, Alexander Juarez wrote:
> Hi Jason,
> This is really neat and I love the way the code view is integrated. I
> was checking out the cell, and would suggest a version optimized for
> handhelds.

We have been waiting for http://jquerymobile.com/ to come out of beta
before moving to it for the interact controls. We've also incorporated
several tweaks for handhelds (like the meta tag we suggest in the
embedding code).

Do you have some other optimizations in mind?

Thanks,

Jason

Alexander Juarez

unread,
Sep 13, 2011, 2:53:11 AM9/13/11
to sage-s...@googlegroups.com, sage-...@googlegroups.com, sage...@googlegroups.com
I ran some simple code in my iphone's browser and the result was an error. When I toggled plaintext input the code ran as expected. It would seem that the code view does not play well with the particular device. I am not sure if this is a problem experianced by other devices but, perhaps browser checking could determine the state of the plaintext input toggle.
Code:
def myfunc():
    return 2+2

print myfunc()
---------------------------------------------------------------------------
SyntaxError                               Traceback (most recent call last)
SyntaxError: invalid syntax (<string>, line 41)
Session 6673139e-8456-472c-96db-b6e72de127f4 done

Respectfully,
Alex



Thanks,

Jason

--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Jason Grout

unread,
Sep 13, 2011, 1:26:04 PM9/13/11
to sage-s...@googlegroups.com, sage-...@googlegroups.com, sage...@googlegroups.com
On 9/13/11 1:53 AM, Alexander Juarez wrote:
> I ran some simple code in my iphone's browser and the result was an
> error. When I toggled plaintext input the code ran as expected. It would
> seem that the code view does not play well with the particular device. I
> am not sure if this is a problem experianced by other devices but,
> perhaps browser checking could determine the state of the plaintext
> input toggle.
>
> Code:
> def myfunc():
> return 2+2
>
> print myfunc()
>
> ---------------------------------------------------------------------------
> SyntaxError Traceback (most recent call last)
> SyntaxError: invalid syntax (<string>, line 41)
>
> Session 6673139e-8456-472c-96db-b6e72de127f4 done
>


Your example worked fine on my ipad (both with codemirror and plain text
inputs). Is it possible that you accidentally something slightly
different on the ipod?

I did notice that the autocapitalization was very frustrating. I fixed
that just now.

Thanks,

Jason

fbotana

unread,
Sep 13, 2011, 1:45:47 PM9/13/11
to sage-support
Finally, I solved (almost) all problems.

There was a problem with permissions on /tmp/uwsgi.sock.
It remains an issue. I get "NOTE: Sage Mode is unavailable, which may
cause errors if using Sage-specific syntax.". Probably I forgot
something, but I cannot figure what the problem is (yes, the box is
ticked).

When|If solved, I will try to do a VBox appliance.

Best,
Francisco

Jason Grout

unread,
Sep 13, 2011, 2:35:23 PM9/13/11
to sage-s...@googlegroups.com
On 9/13/11 12:45 PM, fbotana wrote:
> Finally, I solved (almost) all problems.
>
> There was a problem with permissions on /tmp/uwsgi.sock.

Ah, okay. How should we change the instructions to make it work?

> It remains an issue. I get "NOTE: Sage Mode is unavailable, which may
> cause errors if using Sage-specific syntax.". Probably I forgot
> something, but I cannot figure what the problem is (yes, the box is
> ticked).
>

Did you install sage and are you using sage to run the device? Here's
an excerpt from my singlecell_config.py:

python='../sage/sage -python'
device_config={
'workers': 150,
'python': python,
'untrusted-account': 'deviceaccount@localhost',
'untrusted-python': 'nice '+python,
'untrusted-cpu': 100, # seconds
'untrusted-mem': 2500, # megabytes
}

Note that the "untrusted-python" is really 'sage -python'

As a test, can you try doing this on your server?

import sage

Thanks,

Jason


fbotana

unread,
Sep 13, 2011, 6:52:45 PM9/13/11
to sage-support
Jason,

regarding /tmp/uwsgi.sock I just change by hand its permission to 777
once it is created. Not an elegant way, I know, but it works.

I was confused about $SERVER and single-cell-server in your
instructions.
After the item 'Jmol'

the 'cd $SERVER/static' should be 'cd $SERVER/single-cell-server/
static'.

The item 'Single Cell Server' states:
-------------
First, minify CSS and JavaScript files (this is required):

cd $SERVER/static
make
---------------

and I think it should be

------------------
First, minify CSS and JavaScript files (this is required):

cd $SERVER/single-cell-server/static
make
-----------------

Your excerpt of singlecell_config.py showed my error (I wrote
'python': sage -python in the device-config, in place of python='sage -
python' before device-config). I suggest inserting this part of
singlecell_config.py in the instructions.

So, now my server is working ok (I can use Sage!). Nevertheless, I
don't get plots yet (I did not patch Sage as indicated in your
instructions).

Thank you very much!

Francisco

Jason Grout

unread,
Sep 13, 2011, 9:16:24 PM9/13/11
to sage-s...@googlegroups.com

Great! I've made your comments issue
https://github.com/jasongrout/simple-python-db-compute/issues/203 on the
singlecell bug tracker.

Thanks,

Jason

fbotana

unread,
Oct 21, 2011, 6:33:38 AM10/21/11
to sage-support
Hi,

a comment and a question about the single cell server.

Comment: Something prevents evaluation if foreign characters are used:
try "print 'adios'" vs. 'print "adiós"'

Q: I've used the standard simple server for remote computations, but
the need of authenticating was a bottleneck. How can I use my local
installation of the scs for getting textual computations of Sage
queries? For instance, if I send to http://localhost:5467 the query
"integrate(x,x)", where and how can I read the answer "1/2*x^2", by
using http protocol, without a browser.

Thanks!
Francisco
Reply all
Reply to author
Forward
0 new messages