OK, I’m sorry it’s taken this long to come this this realization, but I’ve realized this week that this is not as straight forward as I’d thought. Right now you can put all the Desktop libraries (MATE, Gnome, and so on) in the container and that’s fairly straight forward and will work. But you still need vncserver and websockify on the host machine.
The issue is that the batch connect infrastructure is setup to do all this, but it’s never told to do it in a container. It just executes it all in a regular bash environment, as prep work before executing your script (whatever it may be). Then you’ve given your singuliarty command after all this is executed. But containers have 1 entrypoint right? Well we need to force that entrypoint to be before all of our batch connect commands.
That’s the main issue we’re having right now. All of this is being executed outside of any container.
I believe we may be able to hack this through the script_wrapper
parameter, if we dumped the contents of the script (%s) to a file then singualrity run entrypoint.sh
. It may look something like this, though I don’t know if this works off hand, it could throw the formatting off or any number of other things.
batch_connect:
template: vnc
script_wrapper: |
cat << EOF > container.sh
%s
EOF
singularity run myimage.sif container.sh
This way everything gets executed inside the container.
I’ll give this approach a shot when I get the chance and report back one way or another.