Skip to content

Commit

Permalink
Merge branch 'master' into 3414-launcher-editable-log-location-support
Browse files Browse the repository at this point in the history
  • Loading branch information
euler-room committed Oct 28, 2024
2 parents 4742c5d + a6e1e9a commit ad329f6
Show file tree
Hide file tree
Showing 17 changed files with 265 additions and 288 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'rake'
gem 'dotenv', '~> 2.1'

group :package do
gem 'ood_packaging', '~> 0.15.1'
gem 'ood_packaging', '~> 0.15.2'
end

group :test do
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ GEM
oga (3.3)
ast
ruby-ll (~> 2.1)
ood_packaging (0.15.1)
ood_packaging (0.15.2)
rake (~> 13.0.1)
open_uri_redirections (0.2.1)
parallel (1.21.0)
Expand Down Expand Up @@ -179,7 +179,7 @@ DEPENDENCIES
beaker-docker (~> 1.4.0)
beaker-rspec
dotenv (~> 2.1)
ood_packaging (~> 0.15.1)
ood_packaging (~> 0.15.2)
rake
rspec
rubocop
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ GEM
activesupport
i18n
erubi (1.13.0)
execjs (2.9.1)
execjs (2.10.0)
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
Expand All @@ -133,7 +133,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -151,7 +151,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
mocha (2.4.5)
mocha (2.5.0)
ruby2_keywords (>= 0.0.5)
multi_json (1.15.0)
mustermann (3.0.3)
Expand Down Expand Up @@ -234,7 +234,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.8)
rexml (3.3.9)
rss (0.3.1)
rexml
ruby2_keywords (0.0.5)
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/app/controllers/active_jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def get_job(jobid, cluster)
ActiveJobs::Jobstatusdata.new(data, cluster, true)

rescue OodCore::JobAdapterError
OpenStruct.new(name: jobid, error: "No job details because job has already left the queue." , status: status_label("completed") )
OpenStruct.new(name: jobid, error: "No job details because job has already left the queue." , status: "completed" )
rescue => e
Rails.logger.info("#{e}:#{e.message}")
Rails.logger.info(e.backtrace.join("\n"))
OpenStruct.new(name: jobid, error: "No job details available.\n" + e.backtrace.to_s, status: status_label("") )
OpenStruct.new(name: jobid, error: "No job details available.\n" + e.backtrace.to_s, status: "" )
end
end

Expand Down
8 changes: 8 additions & 0 deletions apps/dashboard/app/lib/smart_attributes/attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ def select_choices(hide_excludable: true)
else
false
end
end.map do |entry|
# always cast to array so other layers can try .first & .second for labels and values.
# and let nils fall through and get caught in validate!
if entry.is_a?(Array)
entry
elsif entry.is_a?(String) || entry.is_a?(Symbol)
[entry.to_s, entry.to_s]
end
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AutoJobName < Attribute
# Defaults to ondemand/[dev,sys]/projects
# @return [String] attribute value
def value
job_name(opts[:value] || 'Project Manager Job')
opts[:value] || 'Project Manager Job'
end

def widget
Expand All @@ -32,7 +32,7 @@ def label(*)
# @param fmt [String, nil] formatting of hash
# @return [Hash] submission hash
def submit(*)
{ script: { job_name: value } }
{ script: { job_name: job_name(value) } }
end

# TODO: need to sanitize the job name for some schedulers
Expand Down
3 changes: 1 addition & 2 deletions apps/dashboard/app/models/active_jobs/jobstatusdata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module ActiveJobs
# @author Brian L. McMichael
# @version 0.0.1
class Jobstatusdata
include ActiveJobsHelper
attr_reader :pbsid, :jobname, :username, :account, :status, :cluster, :cluster_title, :nodes, :starttime, :walltime, :walltime_used, :submit_args, :output_path, :nodect, :ppn, :total_cpu, :queue, :cput, :mem, :vmem, :shell_url, :file_explorer_url, :extended_available, :native_attribs, :error

Attribute = Struct.new(:name, :value)
Expand All @@ -28,7 +27,7 @@ def initialize(info, cluster=OODClusters.first, extended=false)
self.jobname = info.job_name
self.username = info.job_owner
self.account = info.accounting_id || ''
self.status = status_label(info.status.state.to_s)
self.status = info.status.state.to_s
self.cluster = cluster.id.to_s
self.cluster_title = cluster.metadata.title || cluster.id.to_s.titleize
self.walltime_used = info.wallclock_time.to_i > 0 ? pretty_time(info.wallclock_time) : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="card-header">
<%# FIXME: ul/li with css %>
<strong>
<%= data.status %>
<%= status_label(data.status) %>
<span class="text-break ms-3"><%= data.jobname %></span>
<span class="ms-3"><%= data.pbsid %></span>
</strong>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
json.html_extended_panel render(partial: 'active_jobs/extended_panel', :locals => {:data => jobstatusdata}, :formats => [:html])
json.status jobstatusdata.status
json.status status_label(jobstatusdata.status)
json.html_ganglia_graphs_table render(partial: 'active_jobs/ganglia_graphs_table', :locals => {:d => jobstatusdata}, :formats => [:html])
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,31 @@

<ol class="list-group text-center col-md-4 mb-3">
<%- attrib.select_choices(hide_excludable: false).each do |select_data| %>
<%-
choice = parse_select_data(select_data)
disabled = attrib.exclude_select_choices.include?(choice)
last_option = attrib.exclude_select_choices.length + 1 == attrib.select_choices(hide_excludable: false).length
li_classes = disabled ? 'list-group-item list-group-item-danger text-strike' : 'list-group-item'
add_id = "#{field_id}_add_#{choice}"
remove_id = "#{field_id}_remove_#{choice}"
-%>

<li class="<%= li_classes %>">

<button class="btn btn-info float-start" type="button" id="<%= add_id %>"
data-select-toggler="add" data-select-id="<%= field_id %>"
<%= disabled ? nil : 'disabled="true"' %> >
<%= t('dashboard.add') %>
</button>

<span data-select-value><%= choice %></span>

<button class="btn btn-warning float-end" type="button" id="<%= remove_id %>"
data-select-toggler="remove" data-select-id="<%= field_id %>"
<%= disabled || last_option ? 'disabled="true"'.html_safe : nil %> >
<%= t('dashboard.remove') %>
</button>

</li>
<%-
choice = parse_select_data(select_data)
disabled = attrib.exclude_select_choices.include?(choice)
last_option = attrib.exclude_select_choices.length + 1 == attrib.select_choices(hide_excludable: false).length
li_classes = disabled ? 'list-group-item list-group-item-danger text-strike' : 'list-group-item'
add_id = "#{field_id}_add_#{choice}"
remove_id = "#{field_id}_remove_#{choice}"
-%>

<li class="<%= li_classes %>">

<span data-select-value class="text-break"><%= choice %></span><br/>

<button class="btn btn-info float-start w-45" type="button" id="<%= add_id %>"
data-select-toggler="add" data-select-id="<%= field_id %>"
<%= disabled ? nil : 'disabled="true"' %> >
<%= t('dashboard.add') %>
</button>

<button class="btn btn-warning float-end w-45" type="button" id="<%= remove_id %>"
data-select-toggler="remove" data-select-id="<%= field_id %>"
<%= disabled || last_option ? 'disabled="true"'.html_safe : nil %> >
<%= t('dashboard.remove') %>
</button>
</li>
<%- end -%>
</ol>

Expand Down
39 changes: 39 additions & 0 deletions apps/dashboard/test/system/batch_connect_widgets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,43 @@ def make_bc_app(dir, form)
assert(find("##{bc_ele_id('aa_b_cc')}").visible?)
end
end

test 'radio_buttons accept scalar and array options' do
Dir.mktmpdir do |dir|
form = <<~HEREDOC
---
cluster:
- owens
form:
- scalar
- vector
attributes:
scalar:
widget: radio_button
options:
- one
- two
vector:
widget: radio_button
options:
- [Three, three]
- [Four, four]
HEREDOC

make_bc_app(dir, form)
visit new_batch_connect_session_context_url('sys/app')

# values are all lowercase
assert_equal('one', find("##{bc_ele_id('scalar_one')}").value)
assert_equal('two', find("##{bc_ele_id('scalar_two')}").value)
assert_equal('three', find("##{bc_ele_id('vector_three')}").value)
assert_equal('four', find("##{bc_ele_id('vector_four')}").value)

# one and two's labels are lowercase, but Three and Four have uppercase labels.
assert_equal('one', find("[for='#{bc_ele_id('scalar_one')}']").text)
assert_equal('two', find("[for='#{bc_ele_id('scalar_two')}']").text)
assert_equal('Three', find("[for='#{bc_ele_id('vector_three')}']").text)
assert_equal('Four', find("[for='#{bc_ele_id('vector_four')}']").text)
end
end
end
68 changes: 34 additions & 34 deletions apps/dashboard/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==

"@rails/ujs@^7.0.1":
version "7.1.400"
resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.1.400.tgz#b2a76bdccb5197b9e866954536106386c87cfab5"
integrity sha512-YwvXm3BR5tn+VCAKYGycLejMRVZE3Ionj5gFjEeGXCZnI0Rpi+7dKpmyu90kdUY7dRUFpHTdu9zZceEzFLl38w==
version "7.1.402"
resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.1.402.tgz#5d4e7e5d1e2e22df081bf5693fc75f0725635130"
integrity sha512-q9dDlIR+anDtuGcV56rLnqHAxtWo8vkSnvfFt7juthvHc+97NEtGlnM++uhvnlDbR+7EGkX8nGqQIF8R93oWMQ==

"@transloadit/prettier-bytes@^0.3.4":
version "0.3.4"
resolved "https://registry.yarnpkg.com/@transloadit/prettier-bytes/-/prettier-bytes-0.3.4.tgz#51f837a49cab10a42ef64d6f227d1a859ba435aa"
integrity sha512-8/SnIF9Q2k52mbjRVAYLranwkaDTLb+O9r4Z/uo8uNw//SjygKvvbF4BHSOuReufaAyum1q13602VcNud25Dfg==

"@types/jquery@^3.5.16":
version "3.5.31"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.31.tgz#3605df86427f6c4e6b5b5a470ba180f74107cffa"
integrity sha512-rf/iB+cPJ/YZfMwr+FVuQbm7IaWC4y3FVYfVDxRGqmUCFjjPII0HWaP0vTPJGp6m4o13AXySCcMbWfrWtBFAKw==
version "3.5.32"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.32.tgz#3eb0da20611b92c7c49ebed6163b52a4fdc57def"
integrity sha512-b9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+Uk0vgACvoQHpWDg2rGdHkYPLmCiQ==
dependencies:
"@types/sizzle" "*"

Expand All @@ -40,9 +40,9 @@
integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==

"@types/sizzle@*":
version "2.3.8"
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.8.tgz#518609aefb797da19bf222feb199e8f653ff7627"
integrity sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==
version "2.3.9"
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.9.tgz#d4597dbd4618264c414d7429363e3f50acb66ea2"
integrity sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==

"@uppy/companion-client@^4.1.0":
version "4.1.0"
Expand All @@ -54,30 +54,30 @@
p-retry "^6.1.0"

"@uppy/core@^4.0":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@uppy/core/-/core-4.2.1.tgz#1b3cc54a89583a29c0f006657a08b397ac831937"
integrity sha512-5u6hoyESYbAswnSevo5mHnOQANqiEk1X3y4/JobmQEMdPJegbWgbZ0hpTx7zk/rBpEj5hr+xxNPF3LqqkC369g==
version "4.2.2"
resolved "https://registry.yarnpkg.com/@uppy/core/-/core-4.2.2.tgz#35b3f165f119b579310a1b0b788a73a06e0078aa"
integrity sha512-TfTXngDLHK+gNwbpt1tgKfQ0vQwa7V5ilAnD/VNT+6AGW+/dqGFLZbA6q8xKvVTZ2sUbwDMSWFtqem+G04AhNQ==
dependencies:
"@transloadit/prettier-bytes" "^0.3.4"
"@uppy/store-default" "^4.1.0"
"@uppy/utils" "^6.0.2"
"@uppy/utils" "^6.0.3"
lodash "^4.17.21"
mime-match "^1.0.2"
namespace-emitter "^2.0.1"
nanoid "^5.0.0"
preact "^10.5.13"

"@uppy/dashboard@^4.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@uppy/dashboard/-/dashboard-4.1.0.tgz#ac4caa2b7d5b6b63ed285e8600ff0a6e84e2cadf"
integrity sha512-TSwgW1x0YDnZP4yJwxVrxO6vsW3GrWoqXwOdpcTGDwdIOvZZJBAajqr3QrVdkbz1L4YfQAgTtHZlyUhm5qMuzg==
version "4.1.1"
resolved "https://registry.yarnpkg.com/@uppy/dashboard/-/dashboard-4.1.1.tgz#d632a0b5fbdd0b1033516fdf7bee50b8c75053f5"
integrity sha512-LGABotHj7zXAu1sATBN6pljF6ACtrRM/Kh32uWbwSbD5E8mIu8WUjIQ0K45OieS8KmzCDmQy7djkUOhVx8tMYg==
dependencies:
"@transloadit/prettier-bytes" "^0.3.4"
"@uppy/informer" "^4.1.0"
"@uppy/provider-views" "^4.0.1"
"@uppy/status-bar" "^4.0.3"
"@uppy/thumbnail-generator" "^4.0.0"
"@uppy/utils" "^6.0.2"
"@uppy/utils" "^6.0.3"
classnames "^2.2.6"
lodash "^4.17.21"
memoize-one "^6.0.0"
Expand Down Expand Up @@ -127,26 +127,26 @@
"@uppy/utils" "^6.0.0"
exifr "^7.0.0"

"@uppy/utils@^6.0.0", "@uppy/utils@^6.0.2":
version "6.0.2"
resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-6.0.2.tgz#fc5e86fa58e952fb075ca4bc0523fb5e6aa44053"
integrity sha512-ZoNeAa1YTKSlcvXe1SP3POjzjRZ9jSojorbst03vwd1Ks9vHPGf6pne61DowTXHZ3HMj1vpcIaQ1VIEWeeADlA==
"@uppy/utils@^6.0.0", "@uppy/utils@^6.0.2", "@uppy/utils@^6.0.3":
version "6.0.3"
resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-6.0.3.tgz#60813c42db0ff37d68c68c8f9ad79f51bdd158dd"
integrity sha512-GBVzyAIeVKNe/F3TT63rXR80MSL9ov/FG3BbApO+4wbIt4vai7xpOxGCeTXpW2JjEeOwEb50n1fn92zMCdV9Dg==
dependencies:
lodash "^4.17.21"
preact "^10.5.13"

"@uppy/xhr-upload@^4.0":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-4.2.0.tgz#1bcd632ef90568aa1b79874dd3fcffdd0a140bd2"
integrity sha512-MhpazjMEjFgEyB9Ewiz+ba4U3uZ6yBDrylBeMI0XSxJD5ZwygYBzqpacB6eoVZqHqyb9He90fdZnod5dD9Cc0g==
version "4.2.1"
resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-4.2.1.tgz#556ab847438edbdc5f23ff802dde23f73ea7a5d6"
integrity sha512-pafgk0vLr+FKDHo+xmBMwNncj68oRNoaTnj0por7LPND0QGXV7xwBZnGGkQhiHLooV2MNBEhFQtx93A76cEINg==
dependencies:
"@uppy/companion-client" "^4.1.0"
"@uppy/utils" "^6.0.2"
"@uppy/utils" "^6.0.3"

ace-code@^1.35.0:
version "1.36.2"
resolved "https://registry.yarnpkg.com/ace-code/-/ace-code-1.36.2.tgz#b2eed0a9052aee85890b98ed93cd5e88b7bee6b5"
integrity sha512-UeB7s95eP5MuFmjSzSRhmX5bAgAJ7Mpz84E+GYbGjzMmjeHrrv4IIZ3li6Ti4tRLS6SsLZ0V9iXtqorhdAYBwg==
version "1.36.3"
resolved "https://registry.yarnpkg.com/ace-code/-/ace-code-1.36.3.tgz#8c98d226bf104ded12430867569bcf4c84110a74"
integrity sha512-raUJgxuymTTHTwn33kg0KTOFZbfofWl14TltzhM3ZuhKTjATtgIwMx92BOa/L5Fgw0r21PZ9b5LXWXAsI10Kog==

anymatch@~3.1.2:
version "3.1.3"
Expand Down Expand Up @@ -546,19 +546,19 @@ p-retry@^6.1.0:
retry "^0.13.1"

p-timeout@^6.1.2:
version "6.1.2"
resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-6.1.2.tgz#22b8d8a78abf5e103030211c5fc6dee1166a6aa5"
integrity sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==
version "6.1.3"
resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-6.1.3.tgz#9635160c4e10c7b4c3db45b7d5d26f911d9fd853"
integrity sha512-UJUyfKbwvr/uZSV6btANfb+0t/mOhKV/KXcCUTp8FcQI+v/0d+wXqH4htrW0E4rR6WiEO/EPvUFiV9D5OI4vlw==

picomatch@^2.0.4, picomatch@^2.2.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

preact@^10.5.13:
version "10.24.2"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.24.2.tgz#42179771d3b06e7adb884e3f8127ddd3d99b78f6"
integrity sha512-1cSoF0aCC8uaARATfrlz4VCBqE8LwZwRfLgkxJOQwAlQt6ayTmi0D9OF7nXid1POI5SZidFuG9CnlXbDfLqY/Q==
version "10.24.3"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.24.3.tgz#086386bd47071e3b45410ef20844c21e23828f64"
integrity sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==

readdirp@~3.6.0:
version "3.6.0"
Expand Down
Loading

0 comments on commit ad329f6

Please sign in to comment.