--- /dev/null
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
--- /dev/null
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
--- /dev/null
+// Place all the styles related to the JobSteps controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
--- /dev/null
+// Place all the styles related to the Jobs controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
--- /dev/null
+class Orvos::V1::JobStepsController < ApplicationController
+end
--- /dev/null
+class Orvos::V1::JobsController < ApplicationController
+end
--- /dev/null
+module JobStepsHelper
+end
--- /dev/null
+module JobsHelper
+end
--- /dev/null
+class Job < OrvosModel
+ include AssignUuid
+ include KindAndEtag
+ include CommonApiTemplate
+ serialize :command_parameters, Hash
+ before_create :ensure_unique_submit_id
+
+ class SubmitIdReused < StandardError
+ end
+
+ api_accessible :superuser, :extend => :common do |t|
+ t.add :submit_id
+ t.add :priority
+ t.add :command
+ t.add :command_parameters
+ t.add :command_version
+ t.add :cancelled_at
+ t.add :cancelled_by_client
+ t.add :cancelled_by_user
+ t.add :started_at
+ t.add :finished_at
+ t.add :success
+ t.add :running
+ end
+
+ protected
+
+ def ensure_unique_submit_id
+ if !submit_id.nil?
+ if Job.where('submit_id=?',self.submit_id).first
+ raise SubmitIdReused.new
+ end
+ end
+ true
+ end
+end
--- /dev/null
+class JobStep < OrvosModel
+ include AssignUuid
+ include KindAndEtag
+ include CommonApiTemplate
+
+ api_accessible :superuser, :extend => :common do |t|
+ end
+end
Server::Application.routes.draw do
+ resources :job_steps
+ resources :jobs
resources :api_client_authorizations
resources :api_clients
resources :logs
resources :nodes
resources :pipelines
resources :pipeline_invocations
- resources :pipelineInvocations
resources :specimens
resources :projects
resources :logs
resources :users
+ resources :jobs
+ resources :job_steps
end
end
--- /dev/null
+class CreateJobs < ActiveRecord::Migration
+ def change
+ create_table :jobs do |t|
+ t.string :uuid
+ t.string :owner
+ t.string :modified_by_client
+ t.string :modified_by_user
+ t.datetime :modified_at
+ t.string :submit_id
+ t.string :command
+ t.string :command_version
+ t.text :command_parameters
+ t.string :cancelled_by_client
+ t.string :cancelled_by_user
+ t.datetime :cancelled_at
+ t.datetime :started_at
+ t.datetime :finished_at
+ t.boolean :running
+ t.boolean :success
+ t.string :output
+
+ t.timestamps
+ end
+ add_index :jobs, :uuid, :unique => true
+ add_index :jobs, :submit_id, :unique => true
+ add_index :jobs, :command
+ add_index :jobs, :finished_at
+ add_index :jobs, :started_at
+ add_index :jobs, :output
+ end
+end
--- /dev/null
+class CreateJobSteps < ActiveRecord::Migration
+ def change
+ create_table :job_steps do |t|
+ t.string :uuid
+ t.string :owner
+ t.string :modified_by_client
+ t.string :modified_by_user
+ t.datetime :modified_at
+ t.string :job_uuid
+ t.integer :sequence
+ t.text :parameters
+ t.text :output
+ t.float :progress
+ t.boolean :success
+
+ t.timestamps
+ end
+ add_index :job_steps, :uuid, :unique => true
+ add_index :job_steps, :job_uuid
+ add_index :job_steps, :sequence
+ add_index :job_steps, :success
+ end
+end
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130130205749) do
+ActiveRecord::Schema.define(:version => 20130203104824) do
create_table "api_client_authorizations", :force => true do |t|
t.string "api_token", :null => false
add_index "collections", ["uuid"], :name => "index_collections_on_uuid", :unique => true
+ create_table "job_steps", :force => true do |t|
+ t.string "uuid"
+ t.string "owner"
+ t.string "modified_by_client"
+ t.string "modified_by_user"
+ t.datetime "modified_at"
+ t.string "job_uuid"
+ t.integer "sequence"
+ t.text "parameters"
+ t.text "output"
+ t.float "progress"
+ t.boolean "success"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "job_steps", ["job_uuid"], :name => "index_job_steps_on_job_uuid"
+ add_index "job_steps", ["sequence"], :name => "index_job_steps_on_sequence"
+ add_index "job_steps", ["success"], :name => "index_job_steps_on_success"
+ add_index "job_steps", ["uuid"], :name => "index_job_steps_on_uuid", :unique => true
+
+ create_table "jobs", :force => true do |t|
+ t.string "uuid"
+ t.string "owner"
+ t.string "modified_by_client"
+ t.string "modified_by_user"
+ t.datetime "modified_at"
+ t.string "submit_id"
+ t.string "command"
+ t.string "command_version"
+ t.text "command_parameters"
+ t.string "cancelled_by_client"
+ t.string "cancelled_by_user"
+ t.datetime "cancelled_at"
+ t.datetime "started_at"
+ t.datetime "finished_at"
+ t.boolean "running"
+ t.boolean "success"
+ t.string "output"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "jobs", ["command"], :name => "index_jobs_on_command"
+ add_index "jobs", ["finished_at"], :name => "index_jobs_on_finished_at"
+ add_index "jobs", ["output"], :name => "index_jobs_on_output"
+ add_index "jobs", ["started_at"], :name => "index_jobs_on_started_at"
+ add_index "jobs", ["submit_id"], :name => "index_jobs_on_submit_id", :unique => true
+ add_index "jobs", ["uuid"], :name => "index_jobs_on_uuid", :unique => true
+
create_table "links", :force => true do |t|
t.string "uuid"
t.string "owner"
--- /dev/null
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
--- /dev/null
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
--- /dev/null
+require 'test_helper'
+
+class JobStepsControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
--- /dev/null
+require 'test_helper'
+
+class JobsControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
--- /dev/null
+require 'test_helper'
+
+class JobStepsHelperTest < ActionView::TestCase
+end
--- /dev/null
+require 'test_helper'
+
+class JobsHelperTest < ActionView::TestCase
+end
--- /dev/null
+require 'test_helper'
+
+class JobStepTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
--- /dev/null
+require 'test_helper'
+
+class JobTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end