[ Breaking OOD ] /etc/ood/config/apps/dashboard/initializers/ood.rb

Hi All,

I believe I have tried a couple of approaches to expose portal access to our shared scratch area and group drives, etc. These are mounted on the FS via either GPFS or NFS, depending on the share.

Here are two examples of what I have tried but it broke the portal when attempting to login after resetting the Web server. If I remove the ood.rb file the portal does not error out but I only get access to the default home dirs. Likely something small I am missing and I’m not a clueless no Ruby coder. So apologies in advance.

Example: 1.

# /etc/ood/config/apps/dashboard/initializers/ood.rb

  Rails.application.config.after_initialize do
   
     paths << FavoritePath.new("/ibm/hpcfs1/tmp/")
  
  end


Example 2. - Taken from the example in the documentation

# /etc/ood/config/apps/dashboard/initializers/ood.rb

Rails.application.config.after_initialize do
  OodFilesApp.candidate_favorite_paths.tap do |paths|

    # Hash of base paths to check for additional directories with titles
    # location => Title
    base_paths = {
      '/ibm/hpcfs1/tmp/' => 'Shared scratch',
      # Add more paths and titles here if needed
    }

    base_paths.each do |base_path, title|
      # Check if the base path exists and is a directory, to avoid error
      next unless Dir.exist?(base_path)

      # Get all entries in the current base path
      Dir.entries(base_path).each do |entry|
        # Construct the full path for the current entry
        full_path = File.join(base_path, entry)

        # Skip if it's not a directory or if it's a special entry like '.' or '..'
        next unless File.directory?(full_path) && !['.', '..'].include?(entry)

        # Check if the directory is readable and executable
        if File.readable?(full_path) && File.executable?(full_path)
          # Access the value of the current base_path using the `title` variable
          paths << FavoritePath.new(full_path, title: "#{title}: #{File.basename(full_path)}")
        end
      end
    end
  end
end

# The variable ``base_paths`` is an hash (``dirname`` => ``Title``) of all directories you want to parse. For the directory ``OSC_test`` in ``/srv/scratch/groups/``; the favorite path will be displayed as following

#| Group scratch: OSC_test | /srv/scratch/groups/OSC_test |

#On each request, the Dashboard will check for the existence of the directories
#in ``OodFilesApp.candidate_favorite_paths`` array and whichever directories
#exist and the user has access to will appear as links in the Files menu under
#the Home Directory link.

Error Page:

I would welcome any examples that should work from your POV or corrections here.
Aim is for users to have access to /misc, /groups and /ibm/hpcfs1/tmp/ from their file browser in OOD and select from a shortcut in the menu. Thx

I will try find the passenger logs.
Running Rhel 9.6

ondemand-release-web-4.0-1.el9.noarch
ondemand-runtime-4.0.3-1.el9.x86_64
ondemand-nginx-1.26.1-3.p6.0.23.ood4.0.3.el9.x86_64
ondemand-ruby-4.0.3-1.el9.x86_64
ondemand-passenger-6.0.23-3.ood4.0.3.el9.x86_64
ondemand-nodejs-4.0.3-1.el9.x86_64
ondemand-apache-4.0.3-1.el9.x86_64
ondemand-gems-4.0.6-1-4.0.6-1.el9.x86_64
ondemand-4.0.6-1.el9.x86_64
ondemand-dex-2.41.1-1.el9.x86_64


You’ll have to find some logs about why this failed. Maybe there’s a /tmp file that has more details if you’re being shown a Passenger error.

Syntax looks OK - I tried the 2nd example and it worked for me. The second example worked for when I changed the first entry base_paths to my actual scratch directory.

Not seeing any logs in: /tmp/passenger.Nd8iK2Z

Jeff, can you advise on how to turn the logs on?

[root@login002 passenger.Nd8iK2Z]# ls -ltR

.:

total 20

drwx--x--x. 2 chris.welsh chris.welsh.dg  82 Aug 26 11:01 apps.s

-rw-r--r--. 1 chris.welsh chris.welsh.dg   0 Aug 26 11:01 creation_finalized

drwxr-xr-x. 2 chris.welsh chris.welsh.dg  33 Aug 26 11:01 web_server_info

drwxr-xr-x. 2 chris.welsh chris.welsh.dg  54 Aug 26 11:01 agents.s

-rw-r--r--. 1 chris.welsh chris.welsh.dg   6 Aug 26 11:01 core.pid

-rw-------. 1 chris.welsh chris.welsh.dg  24 Aug 26 11:01 full_admin_password.txt

-rw-r--r--. 1 chris.welsh chris.welsh.dg   0 Aug 26 11:01 lock

-rw-r--r--. 1 chris.welsh chris.welsh.dg 394 Aug 26 11:01 properties.json

-rw-------. 1 chris.welsh chris.welsh.dg  24 Aug 26 11:01 read_only_admin_password.txt

-rw-r--r--. 1 chris.welsh chris.welsh.dg   6 Aug 26 11:01 watchdog.pid



./apps.s:

total 0

srw-------. 1 chris.welsh chris.welsh.dg 0 Aug 26 11:01 ruby.tgnl5zWm7XYOVHNLSe0ws5bjZvmQiUN6fzu17QCn1Zco10Dn98QdPg2MghzxHBQ



./web_server_info:

total 4

-rw-r--r--. 1 chris.welsh root 6 Aug 26 11:01 control_process.pid



./agents.s:

total 0

srw-rw-rw-. 1 chris.welsh chris.welsh.dg 0 Aug 26 11:01 core

srw-rw-rw-. 1 chris.welsh chris.welsh.dg 0 Aug 26 11:01 core_api

srw-rw-rw-. 1 chris.welsh chris.welsh.dg 0 Aug 26 11:01 watchdog_api

Ok, I think I have the logging turned on. Stay tuned.

Can you share the web page you’re presented with when you the portal breaks?

The folder you’re is not what we’re looking for. Generally it’s a single html file that has the word ‘error’ in the name.