SageMathCloud docker image!

317 views
Skip to first unread message

William Stein

unread,
Aug 22, 2016, 12:43:36 AM8/22/16
to sage-cloud, sage-cloud-members
Hi,

For a long time people have asked for a docker SageMathCloud image, so
to start your own private SMC install would be very, very easy. Today
I made such a docker image.

https://hub.docker.com/r/williamstein/sagemathcloud/
https://github.com/sagemathinc/smc/tree/master/src/dev/docker

This may be exciting to some people!

Of course, there are surely still issues...

william

--

Best Regards,
William Stein

CEO, SageMath, Inc.

Christophe Bal

unread,
Aug 23, 2016, 10:49:25 AM8/23/16
to sage-cloud, sage-clou...@googlegroups.com
Thanks for this.

I want to try this today on a Debian in a virtual machine.

Is there a doc explaining how to launch the SMC server locally ?

Harald Schilly

unread,
Aug 23, 2016, 1:09:16 PM8/23/16
to sage-cloud, sage-cloud-members
On Tue, Aug 23, 2016 at 4:49 PM, Christophe Bal <proj...@gmail.com> wrote:
> Is there a doc explaining how to launch the SMC server locally ?

In the mentioned github repository is a README.md file. That explains
all this to you.

-- harald

Christophe Bal

unread,
Aug 24, 2016, 7:54:54 AM8/24/16
to sage-...@googlegroups.com
Shame on me. 


Christophe BAL
Enseignant de mathématiques en Lycée et développeur Python amateur
---
French teacher of math in a high school and amateur Python developer


--
You received this message because you are subscribed to a topic in the Google Groups "sage-cloud" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-cloud/S9WqlcaZ_9k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-cloud+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CAGG4CB4AY0RxAZKsvrEywbRCiSfM30CJQbVvPQnZtJW%3DGsnszA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Dima Pasechnik

unread,
Aug 24, 2016, 11:27:32 AM8/24/16
to sage-cloud, sage-clou...@googlegroups.com
except that nothing about OS is said:
 
-- harald

William Stein

unread,
Aug 24, 2016, 11:34:05 AM8/24/16
to Dima Pasechnik, sage-cloud, sage-cloud-members
The OS has to support Docker.  So most any recent version of Windows, OS X, and Linux.

William

c.d. mclean

unread,
Aug 24, 2016, 3:05:35 PM8/24/16
to sage-cloud, dim...@gmail.com, sage-clou...@googlegroups.com

potentially of interest:

"might want to check out quay.io as a hosted docker container build service, it says it has "unlimited storage and serving of public repositories" at https://quay.io/plans/. Not sure if that extends to building open source containers (or how their time limit and auto-building setup compares to docker hub), but it may be worth trying. Travis CI uses it for their docker containers."

Bill Page

unread,
Aug 24, 2016, 5:58:01 PM8/24/16
to sage-cloud, sage-cloud-members
OK, I tried it and I do find it exciting. Thanks!

--
You received this message because you are subscribed to the Google Groups "sage-cloud" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CA%2BjwZMj%2B6sjNWs1d6yjA7TSUyGLgzqmSYr8_tDJJaFN%3DfwKsOw%40mail.gmail.com.

Андрей Ширшов

unread,
Aug 26, 2016, 6:26:53 AM8/26/16
to sage-cloud, sage-clou...@googlegroups.com
Many thanks!!!

Best regards, Andrey.



понедельник, 22 августа 2016 г., 7:43:36 UTC+3 пользователь William Stein написал:

Bill Page

unread,
Aug 26, 2016, 6:32:00 PM8/26/16
to sage-cloud, sage-cloud-members
I wanted to be able to install SageManifolds in the SMC docker image. To do this I needed to get root access to the SMC docker image. If you are a regular docker user perhaps this is obvious but I thought that for other people like me I would mention how I did this:

wspage@suse:~> docker ps
CONTAINER ID        IMAGE                        COMMAND                 CREATED             STATUS              PORTS                                           NAMES
7141c3e867cd        williamstein/sagemathcloud   "/bin/sh -c ./run.py"   2 days ago          Up 2 days           0.0.0.0:32769->80/tcp, 0.0.0.0:32768->443/tcp   admiring_pasteur

wspage@suse:~> docker exec -it 7141c3e867cd /bin/bash

root@7141c3e867cd:/# export TERM=xterm

Replace '7141c3e867cd' above with the container id on your system.

After a few false starts and a couple of missing dependencies I managed to build Sage 7.3 from source and then installed SageManifolds. Now I can run my Jupyter SageMantifolds worksheets on my local SMC.

I do have a question.

How can I change the project quotas?  Is there some command that I can use to give myself more resources?

William Stein

unread,
Aug 26, 2016, 6:40:01 PM8/26/16
to Bill Page, sage-cloud, sage-cloud-members
Awesome to it worked!   The quotas are not enforced in any way so just ignore them. 
You received this message because you are subscribed to the Google Groups "sage-cloud-members" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud-members+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-cloud-members.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud-members/CAC6x94SpdP1bpkBjK5mmyw%2B8GC3RKhYGEnYfFFAOQc%2BsqjbioQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Bill Page

unread,
Aug 26, 2016, 10:30:37 PM8/26/16
to William Stein, sage-cloud, sage-cloud-members
Well um, something is killing my terminal sessions (and maybe the
worksheets too, I am not sure yet) in after about an hour. I assumed
that it is because of the idle timeout.

On 26 August 2016 at 18:39, William Stein <wst...@sagemath.com> wrote:
> ...

William Stein

unread,
Aug 26, 2016, 11:49:54 PM8/26/16
to Bill Page, William Stein, sage-cloud, sage-cloud-members
On Fri, Aug 26, 2016 at 7:30 PM, Bill Page <bill...@newsynthesis.org> wrote:
> Well um, something is killing my terminal sessions (and maybe the
> worksheets too, I am not sure yet) in after about an hour. I assumed
> that it is because of the idle timeout.

Oops -- idle timeout is the one quota that is implemented. I've added
directions here

https://github.com/sagemathinc/smc/tree/master/src/dev/docker#make-all-users-admins

about how to make your user an admin.

-- William



> On 26 August 2016 at 18:39, William Stein <wst...@sagemath.com> wrote:
>> ...
>> The quotas are not enforced in any way so just ignore them.
>>
>> On Friday, August 26, 2016, Bill Page <bill...@newsynthesis.org> wrote:
>>>
>>> How can I change the project quotas? Is there some command that I can use to give myself more resources?
>>>
>
> --
> You received this message because you are subscribed to the Google Groups "sage-cloud-members" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud-memb...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud-members/CAC6x94TTc3LNQU_2tcY0m2hJ4Ssxyca%3D%2Btkjht3ZBPPqP35WvA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Bill Page

unread,
Aug 27, 2016, 9:21:42 AM8/27/16
to William Stein, William Stein, sage-cloud, sage-cloud-members
Perfect. Thanks.

William Stein

unread,
Sep 4, 2016, 6:59:50 PM9/4/16
to Bill Page, William Stein, sage-cloud, sage-cloud-members
Hi,

I've updated the free local Docker SMC build here

https://github.com/sagemathinc/smc/tree/master/src/dev/docker

and also pushed a new image to Docker hub (actually -- I started it
now -- it could take an hour to finish). The main changes are to
make things much more secure, in case you want to host several users
or a class:

- the database password is a random 63 character string now, that
users can't see.
- the umask defaults to 077 so user files are only visible to themselves.

Also, I updated all the code for SMC to the latest, which has all the
newest improvements, e.g., avatars at the projects and files level,
new version of Codemirror, better sync, etc.

-- William
--
William (http://wstein.org)

Bill Page

unread,
Sep 4, 2016, 10:45:09 PM9/4/16
to William Stein, William Stein, sage-cloud, sage-cloud-members
Thanks again.

I have a question about using the docker image for development and
testing. Does it make sense to use docker to help with development?
Suppose I clone the smc repo, create a branch, make some changes
locally and then in src/dev/docker/

$ make build
$ make run

If I understand correctly this should give me a reasonably good way to
test my changes locally. If I like what I did, then I could just
commit, push my changes and make a pull request. Does that sound OK?

--

BTW, here is another note for people like me who are less familiar
with using docker: Rather than using a random port assignment (-P) and
leaving the terminal attached to the container as suggested in the
README.md, I prefer to create the smc container like this:

$ docker run --name=smc -v ~/smc:/projects -d -p 8080:80
williamstein/sagemathcloud

This gives the container a name (smc), detaches the terminal and
assigns local port 8080 for http (you can use a different unused port
and also assign another port for https). The name makes it easier to
refer to the container and to use commands like:

$ docker stop smc
$ docker start smc

William Stein

unread,
Sep 4, 2016, 10:59:03 PM9/4/16
to Bill Page, William Stein, sage-cloud, sage-cloud-members


On Sunday, September 4, 2016, Bill Page <bill...@newsynthesis.org> wrote:
Thanks again.

I have a question about using the docker image for development and
testing. Does it make sense to use docker to help with development?
Suppose I clone the smc repo, create a branch, make some changes
locally and then in src/dev/docker/

  $ make build
  $ make run

If I understand correctly this should give me a reasonably good way to
test my changes locally. If I like what I did, then I could just
commit, push my changes and make a pull request. Does that sound OK?

Yes.  Also you can do dev through a project in your docker container as explained in dev/project.  
 

--

BTW, here is another note for people like me who are less familiar
with using docker: Rather than using a random port assignment (-P) and
leaving the terminal attached to the container as suggested in the
README.md, I prefer to create the smc container like this:

  $  docker run --name=smc -v ~/smc:/projects -d -p 8080:80
williamstein/sagemathcloud

This gives the container a name (smc), detaches the terminal and
assigns local port 8080 for http (you can use a different unused port
and also assign another port for https).  The name makes it easier to
refer to the container and to use commands like:

  $ docker stop smc
  $ docker start smc


Send a PR updating the readme with the above!

Christophe Bal

unread,
Sep 5, 2016, 4:20:59 AM9/5/16
to sage-...@googlegroups.com
Thanks for this major update. It's time form me to use it with my young students.


Christophe BAL
Enseignant de mathématiques en Lycée et développeur Python amateur
---
French teacher of math in a high school and amateur Python developer

--
You received this message because you are subscribed to a topic in the Google Groups "sage-cloud" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-cloud/S9WqlcaZ_9k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-cloud+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CA%2BjwZMi6RqQpRj6KLLUQYrE7sD3piG8SQwx4DPLu3cXM4hMBCQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages