Refactored code, set up containers, prepared routing.
Didn't feel much like working today, and i kind of lost control of the day, so this is going to be a short session. Today, I hope to set up stopping containers in preparation for routing.
I've added a cleanup that stops all containers when the service is shut down.
I also set the containers memory to 400mb with a 1g memory swap. I've done some brief testing and the codeserver + dotnet test seem to go up to 400-ish MB, so hopefully this will be enough for a decent UX. This does mean, though, that I can only handle about 5 concurrent users with my current machine. I guess that's fine for now.
Now, to figure out the routing. Let's start with the user flow:
- User clicks to start a course.
- Request is sent to spin up the container POST orchestrator/start
- Once response is received, the editor is opened at wss://orchestrator/editor
- the orchestrator knows to route this connection based on the user id and the port that it keeps track of.
I've refactored and organized the code, and added the container endpoint. It can accept websocket requests and proxy them to the code-server container based on user id. I can see it's sending messages, but I can't test it further now. I'll continue tommorrow.