Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for job composer to copy environment #1847

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/myjobs/app/models/resource_mgr_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def qsub(script_path, host: nil, depends_on: {}, account_string: nil)
script = OodCore::Job::Script.new(
content: script_path.read,
accounting_id: account_string,
job_array_request: workflow.job_array_request.presence
job_array_request: workflow.job_array_request.presence,
copy_environment: workflow.copy_environment.eql?("1") ? true: false
)
adapter(cluster).submit( script, **depends_on)

Expand Down
2 changes: 1 addition & 1 deletion apps/myjobs/app/models/workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Workflow < ApplicationRecord
# add accessors: [ :attr1, :attr2 ] etc. when you want to add getters and
# setters to add new attributes stored in the JSON store
# don't remove attributes from this list going forward! only deprecate
store :job_attrs, coder: JSON, accessors: [:account, :job_array_request]
store :job_attrs, coder: JSON, accessors: [:account, :job_array_request, :copy_environment]

attr_accessor :staging_template_dir

Expand Down
2 changes: 2 additions & 0 deletions apps/myjobs/app/views/workflows/_edit_form_job_attrs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ API at: https://github.com/bootstrap-ruby/rails-bootstrap-forms %>
placeholder: '1-10'
%>
<% end %>

<%= f.check_box :copy_environment, label: t('jobcomposer.options_copy_environment'), default: 0 %>
1 change: 1 addition & 0 deletions apps/myjobs/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ en:
options_script_title: "Specify job script"
options_script_help: "Files larger than 65KB are omitted for the job script field"
options_title: "Job Options"
options_copy_environment: "Copy environment"
xdmod_url_warning_message: "This job may not appear in Open XDMoD until 24 hours after the completion of the job."
xdmod_url_warning_message_seconds_after_job_completion: 86400