-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set data-max-auto-cores for auto-clusters.
- Loading branch information
1 parent
822c0af
commit c32048e
Showing
9 changed files
with
1,559 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { makeChangeHandlers } from './dynamic_forms'; | ||
|
||
jQuery(function() { | ||
makeChangeHandlers('script'); | ||
makeChangeHandlers('launcher'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
module ClusterCache | ||
def cluster_options | ||
Rails.cache.fetch('script_cluster_options', expires_in: 4.hours) do | ||
max_cores_map = cluster_max_cores | ||
batch_clusters.map do |cluster| | ||
options = if max_cores_map[cluster.id] | ||
{ 'data-max-auto-cores': max_cores_map[cluster.id] } | ||
else | ||
{} | ||
end | ||
[cluster.id.to_s, cluster.id.to_s, options] | ||
end.sort_by { |option| option[0] } | ||
end | ||
end | ||
|
||
def cluster_nodes | ||
Rails.cache.fetch('script_cluster_nodes', expires_in: 4.hours) do | ||
{}.tap do |hash| | ||
batch_clusters.map do |cluster| | ||
hash[cluster.id] = cluster.job_adapter.nodes if cluster.slurm? | ||
end | ||
end | ||
end | ||
end | ||
|
||
def cluster_max_cores | ||
Rails.cache.fetch('script_cluster_max_values', exipres_in: 4.hours) do | ||
{}.tap do |hash| | ||
cluster_nodes.each do |cluster_id, nodes| | ||
max_node = nodes.max { |a, b| a.procs <=> b.procs } | ||
hash[cluster_id] = max_node.procs if max_node | ||
end | ||
end | ||
end | ||
end | ||
|
||
def batch_clusters | ||
Rails.cache.fetch('script_batch_clusters', expires_in: 4.hours) do | ||
Configuration.job_clusters.reject do |c| | ||
reject_cluster?(c) | ||
end | ||
end | ||
end | ||
|
||
def reject_cluster?(cluster) | ||
cluster.kubernetes? || cluster.linux_host? || cluster.systemd? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
644 changes: 644 additions & 0 deletions
644
apps/dashboard/test/fixtures/cmd_output/sinfo_nodes_oakley.txt
Large diffs are not rendered by default.
Oops, something went wrong.
816 changes: 816 additions & 0 deletions
816
apps/dashboard/test/fixtures/cmd_output/sinfo_nodes_owens.txt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters