class KeepDisksController < ApplicationController
+ def create
+ defaults = { is_readable: true, is_writable: true }
+ @object = KeepDisk.new defaults.merge(params[:keep_disk] || {})
+ super
+ end
end
pipeline[component_name][:script_parameters][param_name] = param_value[:value]
elsif param_value[:default]
pipeline[component_name][:script_parameters][param_name] = param_value[:default]
- elsif param_value[:optional] != nil or param_value[:required] != nil
+ elsif param_value[:optional] != nil or param_value[:required] != nil or param_value[:dataclass] != nil
pipeline[component_name][:script_parameters][param_name] = ""
else
pipeline[component_name][:script_parameters][param_name] = param_value
return attrvalue if !object.attribute_editable? attr
- if not dataclass
+ if dataclass
+ begin
+ dataclass = dataclass.constantize
+ rescue NameError
+ end
+ else
rsc = template
if template.is_a? Hash
if template[:value]
t.collect { |r| r[2] }.inject(0.0) { |sum,a| sum += a } / t.size
end
+ def self.queue
+ self.where('active = true')
+ end
+
protected
def bootstrap_components
if pipeline_template and (!components or components.empty?)
def refresh_todo
@todo = Job.queue
+ @todo_pipelines = PipelineInstance.queue
end
def sinfo
@running.delete job_done.uuid
end
+ def update_pipelines
+ puts @todo_pipelines
+ @todo_pipelines.each do |p|
+ puts "arv-run-pipeline-instance --no-wait --instance #{p.uuid}"
+ puts `env`
+ `arv-run-pipeline-instance --no-wait --instance #{p.uuid}`
+ end
+ end
+
def run
act_as_system_user
@running ||= {}
unless @todo.empty? or did_recently(:start_jobs, 1.0) or $signal[:term]
start_jobs
end
+ unless @todo_pipelines.empty? or did_recently(:update_pipelines, 5.0)
+ update_pipelines
+ end
end
reap_children
select(@running.values.collect { |j| [j[:stdout], j[:stderr]] }.flatten,
end
end
+
+
protected
def did_recently(thing, min_interval)