I have the following problem: I want to add a custom Tornado Service to my JupyterHub Service, which runs on an OpenShift Cluster inside a Pod.
I found a similar issue here, which could help to solve our problem: How to set up the jupyterhub services?
c.JupyterHub.services = [
{"name": "aboutservice",
"command": [sys.executable, "/usr/local/bin/aboutservice.py"],
"url": "http://127.0.0.1:8888",
}]
The app is a very simple Tornado Hello World example.
class MainHandler(tornado.web.RequestHandler):
def get(self):
html = "<html><body><h1>Hello, world</h1></body></html>"
self.write(html)
async def main():
application = tornado.web.Application(
[
(r"/", MainHandler),
]
)
application.listen(8888)
await asyncio.Event().wait()
if __name__ == "__main__":
asyncio.run(main())
The ConfixProxy adds the service as so:
13:30:12.005 [ConfigProxy] info: Route added /services/aboutservice -> http://127.0.0.1:8888
However, the URL mapping seems to be wrong.
“Server at http://127.0.0.1:8888/services/aboutservice/ responded with 404”
Shouldn´t the extra service on port 8888 being mapped to http://127.0.0.1:8080/services/aboutservice/ ?
Does anyone know what we are doing wrong? Thank you for any help!
Curling it works fine:
sh-4.4$ curl 127.0.0.1:8888
<html><body><h1>Hello, world</h1></body></html>sh-4.4$ ^C
sh-4.4$