I currently have a setup where I have a python web server using a vtk wheel and wslink to create a server and I have an javascript client connecting to it and I can load my models on the server and see them successfully on the client.
However, I want to create a multi-user setup where each user logs in to his account and creates a new session.
I am wondering if I should create my own custom code to achieve this or if you guys have this functionality built in.
I have seen this page:
Is this the approach I should be exploring? Or is there another way of achieving the same result?
Is there any more documentation or examples on this topic?
wslink provide the python launcher module which allow you to start a new process per user session. At that point you only need to configure it and the same is true with Apache.
So in short, you have all the pieces, but you need to configure them so they can work together and that documentation explain the role of each and what you should do to configure them.
Thank you Sebastien, I managed to get a working version. However I have a couple of questions:
Is there an example using nginx?
Also I think there’s a problem with wslink version 1.1.0 in the client, if I use version 0.1.15 in the client it works but if I use 1.1.0 on the client this error pops:
Error event: ConnectionReady TypeError: t.protocol.subscribeToImageStream(...).then is not a function
at Object.e.connect (index.js:54)
at Object.<anonymous> (index.js:134)
at index.js:105
at Array.forEach (<anonymous>)
at l (index.js:102)
One more thing, if I close the browser tab, the process keeps going on the server, is this a mistake on my end or what can I do to close the session (plus the python process running on the server) once a user closes his tab?
There is indeed a breaking change in wslink 1.1 vs 0.1 but using vtk 9.1 with latest vtk.js should be just fine.
When you close your tab the process should go away after a timeout. I think the default is 300 seconds. But you can make it shorter if you provide the argument --timeout 10 for example.
Hi @Sebastien_Jourdain, I have tried using the “–launcher” argument while running trame application with multi user support. However, a new session window is opened even on refreshing the browser page. I have added “–timeout 30” to close older sessions But, I’m having doubt if the new session window should open on page refresh.
When users are inactive for a period of time (for example, they freeze their computer). I want to clear the session and stop the process to free up resources
Hi @Sebastien_Jourdain
when the client side has connected the websocket to the server. I call the api to the launcher to delete the current session but the current server process is not stopped, and I check in the proxy-mapping file and see that the session has been deleted.
Can you give me some ideas?
Assuming you are talking about the DELETE http endpoint of the launcher, this should be triggered. Make sure it runs, and maybe try fixing that method if possible.