Changes to file structure after update to 1.7

We updated to 1.7.10-2 in our development setup and found that files we had previously modified are no longer there. We use QOS and needed to add that into some of the ruby files for the slurm adapter. We previously edited:

/var/www/ood/apps/sys/dashboard/vendor/bundle/ruby/2.4.0/gems/ood_core-0.9.3/lib/ood_core/job/script.rb

and

/var/www/ood/apps/sys/dashboard/vendor/bundle/ruby/2.4.0/gems/ood_core-0.9.3/lib/ood_core/job/adapters/slurm.rb

Sorry for the dumb question just not able to find anything like these on the system.

Thanks!
Dori

The gems have been moved to a central shared location:

/opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.7.11/gems

Though every time a new ondemand version installs, the new gemset will be included. For example at OSC since we have installed every patch version of 1.7 while doing development, we have these older directories:

/opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.7.1, /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.7.2, /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.7.3, /opt/ood/ondemand/root/usr/share/gems/2.5/ondemand/1.7.4…

So if you modify it directly it will likely be unused in the next installed release.

Could you share the modifications you made? We may be able to suggest an alternative location for those modifications, or even patch OnDemand so modifications are no longer required.

Great! Thanks. Every time we do an update I have to update these files. Been meaning to put it in github to share but just haven’t gotten around to it. Here’s what we do (line numbers are approximate as they can change with each upgrade):

/var/www/ood/apps/sys/dashboard/vendor/bundle/ruby/2.4.0/gems/ood_core-0.9.3/lib/ood_core/job/script.rb
Everywhere queue showed up, we copy and paste the config and modify it to be qos:
Approximately line 77 add:

# The qos selected for job
# @return [String, nil] qos
attr_reader :qos

Approximately line 127 add:
# @param qos [#to_s, nil] qos name

Approximately line 134 in "def initialize" after queue_name add:
qos: nil,

Approximately line 158 add:
@qos              = qos             && qos.to_s

Approximately line 187 add:
qos:                 qos,


/var/www/ood/apps/sys/dashboard/vendor/bundle/ruby/2.4.0/gems/ood_core-0.9.3/lib/ood_core/job/adapters/slurm.rb
Approximately line 358, Add to # Set sbatch options:

args += ["--qos", script.qos] unless script.qos.nil?

Hi @efranz,

Have you had a chance to look to see if there is a better place or better way to add the slurm qos value/option?

Thanks,
Dori

After reviewing the code you add in more detail and the implementation of the Slurm adapter, I realize there isn’t a clean monkey patch you could add under /etc.

Adding qos to the adapter is a good idea though so I just opened https://github.com/OSC/ood_core/issues/195.

1 Like

Just in case someone else finds this later, qos was added for Slurm and Torque in 1.8 through the Issue/pull request in the message above. so there’s no need to add additional code for this moving forward.

To use it, simply add it to the script element in your submit.yml (or submit.yml.erb).

script:
  qos: "very_best"