add fork observer to docs
Closed this issue · 7 comments
in addition, maybe clean up ports each of the web UI services use, or try to reunite them again like #121
+1 on port cleanup (and prob best to switch from default ports to avoid clashes with common ports such as 8080?)
~0 on a dashboard. I think a super-simple homepage could make sense, with links to each of:
- Grafana
- Fork Observer
- Prometheus
- CAdvisor
I suppose it could be a dashboard of sorts, if it called warcli network status
it could tell you that info?
It could even be something as barebones as this (raw untested ChatGPT code special):
import http.server
import socketserver
import sys
class SimpleHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
services = ['CAdvisor', 'Prometheus', 'Grafana', 'Fork Observer']
response_html = "<html><body><h1>Service Links</h1>" + "".join(f'<p><a href="http://localhost:{port}/">{name}</a></p>' for name, port in zip(services, sys.argv[1:])) + "</body></html>"
self.wfile.write(response_html.encode('utf-8'))
server_port = int(sys.argv[1])
httpd = socketserver.TCPServer(("", server_port), SimpleHTTPRequestHandler)
httpd.serve_forever()
and we could run it as a subprocess, passing the main server port, and 4 service ports as command line arguments?
@Extheoisah @pinheadmz thoughts? Perhaps just as easy to write a quick server in another language too... (but we already have python dependency...)
quick server
We're already running a server with RPC endpoints, can that proxy some http endpoints too? localhost:6660/grafana
localhost:6660/fork-observer
etc ?
ChatGPT reckons something like this can work using the same flask instance as the RPC server...
from flask import Flask, send_from_directory
from flask_jsonrpc import JSONRPC
app = Flask(__name__)
jsonrpc = JSONRPC(app, '/api')
@app.route('/')
def index():
return send_from_directory('static', 'index.html')
@app.route('/link1')
def link1():
return send_from_directory('static', 'link1.html')
@app.route('/link2')
def link2():
return send_from_directory('static', 'link2.html')
@app.route('/link3')
def link3():
return send_from_directory('static', 'link3.html')
@app.route('/link4')
def link4():
return send_from_directory('static', 'link4.html')
@jsonrpc.method('example.ping')
def ping():
return 'pong'
if __name__ == '__main__':
app.run(port=5000)
Seems relatively un-complex, and will work nicely if we containerise the server (as done in the k8s pull)? Just navigate to the container IP address?
I don't think the dashboards are static though, they probably also need websockets?
Would the links not just be to e.g. <grafana_container_ip>:? I'm not good at webdev stuff, might bow out here...
(I wasn't talking about piping the dashboards into this page, just linking out to them)
closing, currently no fork obserer