Skip to content

Commit

Permalink
upgrade awesim
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Sep 18, 2024
1 parent 92f53d6 commit e9f0003
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 34 deletions.
18 changes: 10 additions & 8 deletions apps.awesim.org/apps/activejobs/initializers/filter.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Add a filter by group option and insert it after the first option.
Filter.list.insert(1, Filter.new.tap { |f|
group = OodSupport::User.new.group.name
f.title = "Your Group's Jobs (#{group})"
f.filter_id = "group"
# N.B. Need to use :egroup here for now. My Oodsupport group name is 'appl' but job 'Account_Name' is 'PZS0002'
f.filter_block = Proc.new { |job| job.native[:egroup] == group || job.native[:group_name] == group || job.accounting_id.to_s.downcase == group.downcase }
})
Rails.application.config.after_initialize do
# Add a filter by group option and insert it after the first option.
Filter.list.insert(1, Filter.new.tap { |f|
group = OodSupport::User.new.group.name
f.title = "Your Group's Jobs (#{group})"
f.filter_id = "group"
# N.B. Need to use :egroup here for now. My Oodsupport group name is 'appl' but job 'Account_Name' is 'PZS0002'
f.filter_block = Proc.new { |job| job.native[:egroup] == group || job.native[:group_name] == group || job.accounting_id.to_s.downcase == group.downcase }
})
end
14 changes: 8 additions & 6 deletions apps.awesim.org/apps/activejobs/initializers/ood_clusters_fix.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
OodAppkit.clusters = OodCore::Clusters.new(
OodAppkit.clusters.reject { |cluster| [:quick_pitzer].include?(cluster.id) }
)
Rails.application.config.after_initialize do
OodAppkit.clusters = OodCore::Clusters.new(
OodAppkit.clusters.reject { |cluster| [:quick_pitzer].include?(cluster.id) }
)

if defined?(OODClusters)
OODClusters = OodCore::Clusters.new(OodAppkit.clusters.select(&:job_allow?))
end
if defined?(OODClusters)
OODClusters = OodCore::Clusters.new(OodAppkit.clusters.select(&:job_allow?))
end
end
48 changes: 28 additions & 20 deletions apps.awesim.org/apps/dashboard/initializers/ood.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# AweSim OOD config

def add_paths
OodFilesApp.candidate_favorite_paths.tap do |paths|
# add project space directories
projects = User.new.groups.map(&:name).grep(/^P./)
paths.concat projects.map { |p| Pathname.new("/fs/project/#{p}") }
Rails.application.config.after_initialize do
def add_paths
OodFilesApp.candidate_favorite_paths.tap do |paths|
# add project space directories
projects = User.new.groups.map(&:name).grep(/^P./)

# add scratch space directories
paths << Pathname.new("/fs/scratch/#{User.new.name}")
paths.concat projects.map { |p| Pathname.new("/fs/scratch/#{p}") }

# add scratch space directories
paths << Pathname.new("/fs/scratch/#{User.new.name}")
paths.concat projects.map { |p| Pathname.new("/fs/scratch/#{p}") }

# add ess scratch and project directories
paths.concat projects.map { |p| Pathname.new("/fs/ess/scratch/#{p}") }
paths.concat projects.map { |p| Pathname.new("/fs/ess/#{p}") }
paths.concat projects.map { |p| Pathname.new("/fs/ess/#{p}") }
end
end
end

fs_outage = `grep node_file_test_failure /var/lib/node_exporter/textfile_collector/autofs-file-test.prom | grep -q ' 1'; echo $?`
add_paths if fs_outage.chomp == "1" && !File.exist?('/etc/ood/config/gpfs_outage')
fs_outage = `grep node_file_test_failure /var/lib/node_exporter/textfile_collector/autofs-file-test.prom | grep -q ' 1'; echo $?`
add_paths if fs_outage.chomp == "1" && !File.exist?('/etc/ood/config/gpfs_outage')

# don't show develop dropdown unless you are setup for app sharing
Configuration.app_development_enabled = UsrRouter.base_path.directory?
Configuration.app_sharing_facls_enabled = true
require 'socket'
hostname = Socket.gethostname
case hostname
when /dev/
idp = 'https://idp-dev.osc.edu'
when /test/
idp = 'https://idp-test.osc.edu'
NavConfig.categories_whitelist=true # TODO: need to remove when upgrading to 4.0
else
idp = 'https://idp.osc.edu'
NavConfig.categories_whitelist=true # TODO: need to remove when upgrading to 4.0
end

ENV['OOD_DASHBOARD_HELP_CUSTOM_URL'] = "#{idp}/realms/osc/account/#/security/linked-accounts"
end

NavConfig.categories_whitelist=true

0 comments on commit e9f0003

Please sign in to comment.