Skip to content

Commit

Permalink
minor modifications following @prioux code review
Browse files Browse the repository at this point in the history
  • Loading branch information
gkiar committed Sep 19, 2017
1 parent f1313b2 commit f1cb996
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions BrainPortal/app/models/tool_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ def container_rules #:nodoc:

if self.container_engine.present? && self.container_engine == "Singularity"
if self.container_index_location.present? && ! /^[a-z0-9]+\:\/\/$/.match(self.container_index_location)
errors[:container_index_location] = "Invalid index location type for container engine Singularity. Should end in '://'."
errors[:container_index_location] = "is invalid for container engine Singularity. Should end in '://'."
end
elsif self.container_engine.present? && self.container_engine == "Docker"
if self.container_index_location.present? && ! /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/.match(self.container_index_location)
errors[:container_index_location] = "Invalid index location type for container engine Docker. Should be a valid hostname."
errors[:container_index_location] = "is invalid for container engine Docker. Should be a valid hostname."
end
end
return errors.empty?
Expand Down
10 changes: 6 additions & 4 deletions BrainPortal/app/views/tool_configs/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<p><%= f.label :containerhub_image_name, "Container image name:" %><br/>
<%= f.text_field :containerhub_image_name %><br/>
<div class="field_explanation">
The name and tag of the Container image in which the tool is installed,
The name and tag of the container image in which the tool is installed,
for instance "centos:latest". This name refers to the Docker/Singulariry index
accessed by the Bourreau, which is configured manually in the Bourreau
for now.
Expand All @@ -116,8 +116,10 @@
<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).
The index/url of the container image in which the docker/singularity container is
accessible through.
Examples for Docker are: quay.io, index.docker.io (default).
Examples for Singularity are: docker://, shub:// (default).
</div>
</p>
</span>
Expand All @@ -126,7 +128,7 @@
<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>
<div class="field_explanation">
The ID number of the Container image in which the tool is installed.
The ID number of the container image in which the tool is installed.
This ID refers to userfile registered in CBRAIN.
</div>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@

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

t.column("Description", :description,
Expand Down

0 comments on commit f1cb996

Please sign in to comment.