Location of vnc.rb template / ood_core gem?

I’d like to modify vnc.rb found here in ood_core: ood_core/vnc.rb at master · OSC/ood_core · GitHub

However, I can’t figure out where the gem is actually installed to modify it or use a custom ood_core gem. Any suggestions? I’m not super familiar with Ruby.

Found it! /opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.28/gems/ood_core-0.21.0 for anyone else who might look in the future. Figured it out by examining the spec file.

Now I’m not sure if I can just modify the rb files in here or not!

Here’s the procedure to modify ood_core on an existing Open OnDemand install:

  1. Fork ood_core from github and add your changes
  2. Clone the repo on your ood machine
  3. source /opt/rh/ondemand/enable
  4. In ood_core, run bundle exec rake install

I was able to add some changes to the VNC template this way. Not sure if there’s an intended way!

If you’re running into a bug with vnserver and the -nohttpd flag, version 2.0.28 should have fixed that bug. Please let us know if it didn’t.

Also just let us know if there are other bugs you’re having to patch on your system and we can probably fix them upstream.

Thanks Jeff! No bug, I added a class vnccontainer that launches the vnc instance and websockify from within a container. I’m trying to fix a problem we’re having with a piece of software (ANSYS) that may be due to incompatibility with the desktop host OS (rocky, in our case). So, not really an OOD problem, just an extension.

The bonus is that we can now launch fully containerized desktops based on different operating systems, so that’s fun.

Got it, thanks! Well we’re happy to evaluate the feature if you want to contribute it back to us.

That said - (and unfortunately this is the only documentation for this) I’ve found this strategy for running VNC applications in a container.

Sure, I’ll polish it up and submit a pull request for y’all to look at. It seems to work pretty well and I tried to do it the “OOD way,” but I’m sure it could be improved.

1 Like

Found your fork from github. I wouldn’t worry too much about polishing, that can come either in the PR or later. At a glance I think it looks fine, and beyond that if it works for you, then that’s a great start anyhow.

In the interim, in case you need to patch your system again -

  • you’ve found the right location, though it can change (see the version numbers in the path)
  • you can edit those files directly. In fact you can just drop your vnccontainer.rb directly in the right location and it’ll just start to work

Great! That’s good to know. I tried to edit directly and it didn’t work, but I think I learned later that a portal refresh on the user end was needed for changes to ood_core to take effect.

I’m going to add an option to pick Apptainer or Singularity in batch_connect (right now it just uses Apptainer since that’s what the system I made it for has) and then submit.

PR submitted! I added the apptainer or singularity specification and tried to make it flexible.