How to i run a sagecell server on docker?

61 views
Skip to first unread message

wj Chan

unread,
Sep 22, 2021, 10:52:44 AM9/22/21
to sage-cell
Hey, i want to know if its possible to dockerise a sagecell server? 

Andrey Novoseltsev

unread,
Sep 22, 2021, 2:52:53 PM9/22/21
to sage-cell
Are there things that cannot run on Docker??? I can't easily do it as I have no Docker experience, but for those who do it should be straightforward. You can check the script that builds LXC containers if it is useful.

Qingping Zheng

unread,
Sep 23, 2021, 5:45:44 AM9/23/21
to sage-cell
> script that builds LXC containers

Hey, was wondering which script this would be referring to?

I'm currently referring to a few sources

https://github.com/sagemath/sagecell says that I can create my own server
sagecell/contrib/vm at master · sagemath/sagecell (github.com) also says that I can create my own server.

The docker image at dockerhub doesn't seem like what i'm looking for, was wondering if anyone else on the Sagecell team can chime in on the feasibility?

Andrey Novoseltsev

unread,
Sep 23, 2021, 11:28:20 AM9/23/21
to sage-cell
This script
creates LXC containers with SageMathCell running inside, as well as manages HAProxy on the host machine to serve those containers.

Qingping Zheng

unread,
Sep 25, 2021, 2:41:15 AM9/25/21
to sage-cell
I've made some progress following the instructions on  sagemath/sagecell: The Sage Cell Server---providing a way to embed Sage computations into any web page. (github.com)
I'm having an issue with the Makefile, it assumes a sage-root, which ends up being the sage/ directory i cloned in earlier instruction. 
 cp: can't stat '/sage/local/lib/python3.9/site-packages/notebook/static': No such file or directory

Where should sage-root be pointing to?

Andrey Novoseltsev

unread,
Sep 25, 2021, 8:56:57 PM9/25/21
to sage-cell
I don't point sage-root anywhere - if you run make from within the Sage shell, it is detected automatically. Current master branches were successfully deployed on public servers, so no errors with paths are expected. 

Qingping Zheng

unread,
Oct 4, 2021, 11:25:14 AM10/4/21
to sage-cell

Hi, sorry for the revived thread. I have managed to dockerise the server, but would like to ask, is it possible to remove the internet restrictions, and how?
I'm already hosting the server on the client end, unless I'm misunderstanding something I would like to "whitelist" all sites, aka remove the internet access restrictions.

Andrey Novoseltsev

unread,
Oct 4, 2021, 10:12:16 PM10/4/21
to sage-cell
There is a firewall script in the root directory, if you don't want any restrictions - remove it from the systemd script!

Qingping Zheng

unread,
Oct 14, 2021, 4:33:56 AM10/14/21
to sage-cell
Hi, in terms of your instructions here (https://github.com/sagemath/sagecell), not running on the VM:

git clone https://github.com/sagemath/sagecell.git 
pushd sagecell 
git submodule update --init --recursive
 ../sage/sage -sh -c make

is it possible to remove the firewall rules at this point? Or anywhere in web_server.py?

Andrey Novoseltsev

unread,
Oct 14, 2021, 12:10:02 PM10/14/21
to sage-cell
If you are following simple instructions, there are no firewall rules whatsoever, they are implemented completely independent on SageMathCell code itself. However, I would strongly advice against using such a setup in anything exposed to the outside world - by design it is possible to run arbitrary code...
Reply all
Reply to author
Forward
0 new messages