On Monday, 25 January 2016 at 20:02:10 UTC, rsw0x wrote:
On Monday, 25 January 2016 at 18:17:09 UTC, André wrote:
This tour doesn't allow compiling online because the current
implementation would just make it too easy to hijack the
server :-) Compiling and running online can be activated when
compiling locally though. My goal would be to integrate the
tour with DPaste in the long run.
I wonder how much bandwidth it would use to host a sandboxed
server with dmd on it. Are any of the dpaste guys around that
could give an estimate?
If DPaste isn't an option I thought about implementing sandbox
compiling within Docker containers. A Docker container running
rdmd to compile online code is quite easily put together. The
advantage with Docker is that it starts quickly and can be
limited in terms of memory and CPU. And it is a pretty safe
sandbox (so far). The current code actually implements caching
already so that not every unchanged code example has to be
compiled online.
The dlang-tour currently runs in a Docker container itself
because it makes deployment later on very easy. So together with
some sandboxing mechanism for compiling it should be able to
scale quite well depending on future usage.
The question is just whether it's better to use the existing
DPaste infrastructure or to implement something especially for
the tour?