fully unrelated: question about webserver things
plom people want to start up a very very lightweight webserver from a docker thing so that people can connect to a plom server from browser
do people generally use like...flask for this still?
my understanding is flask is still the predominant python lightweight webserver
I suppose in theory using python's built-in http is the most "lightweight" but flask is probably very good and much more pleasant
I think I like flask in a way that I do not like pandas
I like some pieces of flask but
The main loop is annoying
Like the part where the decorators are modifying this invisible global state in a sense
And then you kick off an eventloop that reads everything and turns it into a server
Does make it hard to compose with other stuff
is there an alternative you'd recommend?
ah, so like
classic python library situation then
My bones tell me there should be an elegant asyncio version out there
But I use Flask in Hubert
With a wrapper that puts all of the state inside a class
I think we probably won't need something as..."flexible" as Hubert so maybe flask will be fine
I think it'll be fine
Goal: Be able to hotswap between servers (e.g. for different courses or for different assignments in the same course) without having to delete the current server directory and redownload all the student papers, etc.
Use case: When running multiple courses that use plom it might be helpful to be able to switch between different servers to look at how the marking process is going in each one. Or, sometimes when marking multiple sections of the same course it can be convenient to be able to switch quickly between sections (e.g., "I know somebody in the first section made this same mistake but I can't quite remember what I thought was wrong with it, let me go check what they said")
Store servers for each class/assignment combo in different local directories. Whenever the user wants to switch (course, assignment), check if a directory for that exists already. If so, then try and launch a server from that directory. Else, make the directory and initialize all the data, etc.
Whenever user wants to switch to a different (course, assignment), give the option to either kill the current server and start a new one in the new directory, or keep the old server alive and choose a different port for the new server and launch the new server.
CanvasServerStateso that we can do something like
assignmentinstead of using a hardcoded path (already implemented a few days ago)
LiveServersthat holds a list of all currently-running
LiveServersand have its information (e.g. directory, port number, etc.) written to some file so that it's easy to later show the user something like "here are some servers you used in the past, do you want to start them back up?"
from plom.server import PlomServerto make this possible welcome
PlomServer.server._server_proc.terminate()it doesn't seem to do it???
popen2and some builtin python thing: latter not reliable yet