Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Train status web interface #141

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

whackashoe
Copy link

This builds upon #82 and uses lua-websockets to have a websocket server running if -visualization flag is enabled (enabling also sets the port for which the server is to run). Instead of using files the initial data is sent when a connection is initiated, from there every time a client requests an update.. the info on page is updated.

I was not able to obtain as clean of a solution as I would have liked due to cross-boundary c-code issues when copas yields, the downside of this is we currently must call update on client side prior to receiving the data (whereas I had hoped to stream it with no need to request past initial connection). Perhaps in future this can be solved but someone more knowledgeable.

All dependencies on js/css side are also now local, in case user is not connected to internet.

All settings were default other than gpu while testing, it would probably be smart to check with gpu enabled for a few minutes just in case any magical bugs sprout from the depths of hell.

@whackashoe
Copy link
Author

@karpathy any thoughts on this?

@EricZeiberg
Copy link
Contributor

What is the downside of having the JS code request an update vs streaming directly to client?

Also, nice job. I had a hard time finding a way to use JSON since I'm less experienced with Lua, but you seemed to have solved the problem.

@whackashoe
Copy link
Author

Slight overhead - isn't noticeable amount though. It's just unnecessary to have a request & response rather than streaming responses after handshake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants