ComputationalRadiationPhysics / isaac

In Situ Animation of Accelerated Computations :microscope:
http://ComputationalRadiationPhysics.github.io/isaac/
GNU Lesser General Public License v3.0
25 stars 15 forks source link

Server: http fallback? #75

Open ax3l opened 6 years ago

ax3l commented 6 years ago

Is there a way to use a http:// fallback in isaac-server?

Some platforms (NGC) do not yet proxy ws:// (or http2) fully. If we could use http(s):// (http 1.1!) polling on those (and also adjust the HTML client accordingly) this would be awesome, because otherwise we can't simply ship live demos.

libwebsockets should support that as well: https://github.com/warmcat/libwebsockets

theZiz commented 6 years ago

First if all: What is NGC? Secondly, do you want, that the client is always asking the server for updates via http instead of keeping a ws connection open the whole time? In fact that would be possible, but need a new isaac-server DataConnector and of course a supporting client. I am not sure whether lws will helpful at all for this task or whether this new connector should use a different http 1.1 library.

ax3l commented 6 years ago

NGC is a cloud service, such as AWS (Amazon) or GCP (Google), with GPUs: https://ngc.nvidia.com/

It's one of PIConGPU's new distribution channels: https://github.com/ComputationalRadiationPhysics/picongpu/pull/2557

Cloud computers are, like HPC compute nodes, not directly reachable from the internet. We can select specific ports (isaac-server) that are forwarded to the outside world on a "secret" (per-container) URL. This forwarding (proxying) on NGC is currently limited to HTTP1.

One can run websockets via long polling on HTTP1 as a (less efficient) fallback. lws seems to support various protocols (http1, http2, ws, ...) but I am not sure what we need to change in the HTML client for that, maybe we need to include a helper .js lib.

theZiz commented 6 years ago

Okay, it seems to be possible as far as I understand. https://libwebsockets.org/lws-api-doc-master/html/md_READMEs_README_8coding.html I need to investigate this further.

ax3l commented 6 years ago

Hey also seem to have new quick-start http/ws examples: https://libwebsockets.org/git/libwebsockets/tree/minimal-examples

theZiz commented 6 years ago

I am having a look into this at the moment, but it is not as clear as intended. :laughing:

ax3l commented 6 years ago

On the HTML client site, we probably will have to do manual XMLHttpRequest requests if I don't see something more fancy. (jQuery example)

ax3l commented 6 years ago

@theZiz how is your progress? Something in sight? :-)

theZiz commented 6 years ago

Not really, I took a look, but I guess I would need to refactor the whole code to a different API. The way I am using libwebsockts I doubt I can add this feature.

ax3l commented 6 years ago

Ok. Wonna have, plz. giphy

theZiz commented 6 years ago

No

ax3l commented 6 years ago

But, pretty please! We need it desperately to make awesome demos and user tutorials in - da - cloud. spongebob-begging-please-meme

theZiz commented 6 years ago

Okay, I took a deeeeep look into lws. It is not possible to just change the protocol and magically http instead of websockets is working. The method = "GET" option we found is only for clients (I am a ws server) and it meant for pure http connections.

So what are our possibilities?

ax3l commented 6 years ago

Writing an independent http DataConnector [with the same lwf dependency]

sounds legit.

we need to implement some benefits of websockets ourself, e.g. a heartbeat functionality

Yes, unfortunately we have to do this on the client side. That's what I was referring to above.

Some tunneling approach

I am still talking to them, but they don't do TCP-level tunneling but only on a http/1 proxy which does not yet support UPGRADE which means no http/2 and no websockets since both rely on it.