Skip to content

Commit

Permalink
added container_index_location to tool config viewer and editor in th…
Browse files Browse the repository at this point in the history
…e web
  • Loading branch information
gkiar committed Sep 18, 2017
1 parent 74b7642 commit 3408f1a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion BrainPortal/app/controllers/tool_configs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def update #:nodoc:
form_tool_config.bourreau_id = @tool_config.bourreau_id

# Update everything else
[ :version_name, :description, :script_prologue, :group_id, :ncpus, :container_engine, :containerhub_image_name, :container_image_userfile_id,
[ :version_name, :description, :script_prologue, :group_id, :ncpus, :container_engine, :container_index_location, :containerhub_image_name, :container_image_userfile_id,
:extra_qsub_args, :cloud_disk_image, :cloud_vm_user, :cloud_ssh_key_pair, :cloud_instance_type,
:cloud_job_slots, :cloud_vm_boot_timeout, :cloud_vm_ssh_tunnel_port ].each do |att|
@tool_config[att] = form_tool_config[att]
Expand Down
6 changes: 5 additions & 1 deletion BrainPortal/app/models/tool_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class ToolConfig < ActiveRecord::Base
:message => "must be unique per pair [tool, server]" },
:if => :applies_to_bourreau_and_tool?

validates :container_index_location,
:format => { :with => /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/i },
:allow_blank => true

validate :container_rules

cb_scope :global_for_tools , where( { :bourreau_id => nil } )
Expand All @@ -64,7 +68,7 @@ class ToolConfig < ActiveRecord::Base

attr_accessible :version_name, :description, :tool_id, :bourreau_id, :env_array, :script_prologue,
:group_id, :ncpus, :container_image_userfile_id, :containerhub_image_name, :container_engine,
:containerindex_location, :extra_qsub_args,
:container_index_location, :extra_qsub_args,
# The configuration of a tool in a VM managed by a
# ScirCloud Bourreau is defined by the following
# parameters which specify the disk image where the
Expand Down
10 changes: 10 additions & 0 deletions BrainPortal/app/views/tool_configs/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@
</p>
</span>

<span title="Index of the container image">
<p><%= f.label :container_index_location, "Index of the container image:" %><br/>
<%= f.text_field :container_index_location %><br>
<div class="field_explanation">
The index/url of the Container image in which the docker/singularity container is
accessible through. Examples are: quay.io, index.docker.io (default).
</div>
</p>
</span>

<span title="ID of the container image">
<p><%= f.label :container_image_userfile_id, "ID of the container image:" %><br/>
<%= f.text_field :container_image_userfile_id %> <%= link_to_userfile_if_accessible(@tool_config.container_image) %><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@
end
}

t.column("Container Index", :container_index_location,
) { |tc|
if tc.container_index_location.present?
tc.container_index_location
end
}

t.column("Description", :description,
:sortable => true,
) { |tc| overlay_description(tc.description) }
Expand Down

0 comments on commit 3408f1a

Please sign in to comment.