Multi-User Matlab Docker Setup

9 次查看(过去 30 天)
Soul45
Soul45 2024-10-12
Some backstory on how things have been: I am working with a small team and we have a few beafy servers on which we run our models. We have Matlab installed and the instances can access a licence server, so we do not have to login with private accounts or something similar. Via X11 forwarding, anyone can run a Matlab instance and it does not conflict with other users. A colleague even mentioned that user settings are stored in the users home folder, so everyone has their preferences tailored to them, if they wish for it!
Now I was thinking to move the setup to a docker container, or even multiple of them. Some key benefits are:
  • easier version managing (just change the tag of the image)
  • the session does not terminate if the connection is cut for a short time
  • sometimes it can be really frustrating to install Matlab on servers with no GUI interface!
The only problem with this approach is: no private instances. Doesn't matter if it is via browser and/or vnc, the actions are always mirrored, so people are basically sharing the same session. I was wondering if there is a way to manage this behavior? Some "matlab user managing hub", which allows for multiple different session depending on the user (somehow, maybe a login via LDAP).
The only idea to bypass this "problem", would be a custom bash script which executes a docker command and runs a private instance, and forwards the vnc/browser ports depending on the users id on the machine, and mounts their home folder into the container. This isn't really elegant, but would get the job done.
If someone has a better solution, I would be eager to learn it. And if my solution peaks someones interest, and I get it to work successfully, hit me up and I can share it here :)

回答(1 个)

Swastik Sarkar
Swastik Sarkar 2024-10-16
The specified reasons for using Docker can be addressed without it.
  • easier version managing (just change the tag of the image)
  • sometimes it can be really frustrating to install Matlab on servers with no GUI interface!
This can be managed by using the MATLAB Package Manager (mpm), which facilitates the installation of specific releases and products without using a GUI. For more information refer below documentation:
  • the session does not terminate if the connection is cut for a short time
An application called Xpra can be used to manage open windows from X11 forwarding, ensuring session continuity. Further details can be found below:
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Containers 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by