ondemand icon indicating copy to clipboard operation
ondemand copied to clipboard

Myjobs: Add ENV override for showing job array

Open covert8 opened this issue 3 years ago • 4 comments

Hi,

We are exploring ondemand at Kuleuven and we would like to not show the job array in the myjobs app due to a competing implementation.

This pr would add an environment variable acting as an override for showing the job array. Is this the best way to go about it?

Thank you in advance.

┆Issue is synchronized with this Asana task by Unito

covert8 avatar Oct 12 '22 12:10 covert8

Hi, thank you for your contribution!

While what you have is OK - It's probably better to put this into the configuration_singleton just so all configurations are co-located in one file.

Here's an example (also using a to_bool helper): https://github.com/OSC/ondemand/blob/da4af66f1397280bfaf0b77c18f56f6544fda916/apps/myjobs/config/configuration_singleton.rb#L57-L59

  def self.show_job_arrays?
    return false if Configuration.show_job_arrays?

    OODClusters.any? { |cluster| cluster.job_adapter.supports_job_arrays? }
  end

johrstrom avatar Oct 12 '22 13:10 johrstrom

Thank you for the tips and quick response

Due to the to_bool behavior an empty string (unset variable) would lead to a false causing the default behavior to be not showing the job array; i changed the variable to be a hide, to make sure the default behavior would be to show the job array.

Also, where in the docs are the variables kept so I can update it?

covert8 avatar Oct 12 '22 14:10 covert8

Docs are held in another repository.

You should probably put it under this section: https://github.com/OSC/ood-documentation/blob/27e31bf1eb4a73cff78781c06c1a4b2d14822da4/source/customizations.rst?plain=1#L509

So it'll show up here: https://osc.github.io/ood-documentation/latest/customization.html#job-composer-script-size-limit

johrstrom avatar Oct 12 '22 16:10 johrstrom

Hi, just for confirmation. Are there any more changes required to merge this commit?

covert8 avatar Oct 18 '22 11:10 covert8

A thousand apologies for not updating you - I was at a conference last week so I couldn't get to it.

I don't believe there are updates I require, I just need to find the time to look it over a second time. I should be able to get it today or tomorrow.

johrstrom avatar Oct 24 '22 13:10 johrstrom