naf 1.1.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -2
- data/app/assets/images/{papertrail_job.png → job.png} +0 -0
- data/app/assets/images/{papertrail_machine.png → machine.png} +0 -0
- data/app/assets/images/{papertrail_machine_runner.png → machine_runner.png} +0 -0
- data/app/assets/javascripts/col_reorder_with_resize.js +1228 -0
- data/app/assets/javascripts/dataTablesTemplates/applications.js +2 -1
- data/app/assets/javascripts/dataTablesTemplates/jobs.js +2 -1
- data/app/assets/javascripts/dataTablesTemplates/machine_runner_invocations.js +2 -1
- data/app/assets/javascripts/dataTablesTemplates/machine_runners.js +2 -1
- data/app/assets/javascripts/dataTablesTemplates/machines.js +2 -1
- data/app/assets/javascripts/jquery.dataTables.js +10339 -5103
- data/app/assets/javascripts/naf.js +1 -0
- data/app/assets/stylesheets/jquery_ui/jquery-ui-1.8.5.custom.css.erb +6 -6
- data/app/assets/stylesheets/min_naf/layout.css.scss +94 -43
- data/app/assets/stylesheets/naf/layout.css.scss +94 -43
- data/app/controllers/naf/affinities_controller.rb +1 -1
- data/app/controllers/naf/applications_controller.rb +3 -0
- data/app/controllers/naf/historical_job_affinity_tabs_controller.rb +1 -1
- data/app/controllers/naf/historical_jobs_controller.rb +2 -5
- data/app/controllers/naf/log_parsers_controller.rb +16 -0
- data/app/controllers/naf/log_viewer_controller.rb +19 -0
- data/app/controllers/naf/machine_affinity_slots_controller.rb +1 -1
- data/app/controllers/naf/machine_runners_controller.rb +12 -0
- data/app/controllers/naf/machines_controller.rb +8 -10
- data/app/controllers/naf/status_controller.rb +12 -0
- data/app/helpers/naf/application_helper.rb +19 -38
- data/app/helpers/naf/time_helper.rb +37 -0
- data/app/models/logical/naf/application.rb +13 -19
- data/app/models/logical/naf/construction_zone/boss.rb +1 -1
- data/app/models/logical/naf/construction_zone/foreman.rb +1 -1
- data/app/models/logical/naf/job.rb +39 -34
- data/app/models/logical/naf/job_creator.rb +19 -23
- data/app/models/logical/naf/job_fetcher.rb +36 -6
- data/app/models/logical/naf/log_file.rb +70 -0
- data/app/models/logical/naf/log_parser/base.rb +272 -0
- data/app/models/logical/naf/log_parser/job.rb +65 -0
- data/app/models/logical/naf/log_parser/machine.rb +64 -0
- data/app/models/logical/naf/log_parser/runner.rb +72 -0
- data/app/models/logical/naf/log_reader.rb +85 -0
- data/app/models/logical/naf/machine.rb +39 -1
- data/app/models/naf/affinity.rb +18 -0
- data/app/models/naf/application_schedule_affinity_tab.rb +1 -0
- data/app/models/naf/application_type.rb +2 -1
- data/app/models/naf/historical_job.rb +9 -29
- data/app/models/naf/machine.rb +8 -0
- data/app/models/naf/machine_runner.rb +11 -2
- data/app/models/naf/machine_runner_invocation.rb +9 -1
- data/app/models/naf/running_job.rb +40 -1
- data/app/models/process/naf/application.rb +3 -3
- data/app/models/process/naf/log_archiver.rb +78 -0
- data/app/models/process/naf/machine_manager.rb +3 -1
- data/app/models/process/naf/runner.rb +286 -162
- data/app/models/process/naf/runner_log.rb +26 -0
- data/app/views/naf/application_schedule_affinity_tabs/_form.html.erb +1 -5
- data/app/views/naf/applications/show.html.erb +1 -1
- data/app/views/naf/historical_job_affinity_tabs/_form.html.erb +1 -5
- data/app/views/naf/historical_jobs/_form.html.erb +1 -1
- data/app/views/naf/historical_jobs/_runners.html.erb +21 -12
- data/app/views/naf/historical_jobs/_search_container.html.erb +1 -2
- data/app/views/naf/historical_jobs/index.html.erb +0 -1
- data/app/views/naf/historical_jobs/index.json.erb +4 -4
- data/app/views/naf/historical_jobs/show.html.erb +57 -51
- data/app/views/naf/log_viewer/_job_logs.html.erb +65 -0
- data/app/views/naf/log_viewer/_log_display.html.erb +259 -0
- data/app/views/naf/log_viewer/_log_layout.html.erb +59 -0
- data/app/views/naf/log_viewer/_machine_logs.html.erb +62 -0
- data/app/views/naf/log_viewer/_runner_logs.html.erb +62 -0
- data/app/views/naf/log_viewer/_search_options.html.erb +36 -0
- data/app/views/naf/log_viewer/_update_page_title.html.erb +9 -0
- data/app/views/naf/log_viewer/index.html.erb +1 -0
- data/app/views/naf/logger_names/_form.html.erb +1 -2
- data/app/views/naf/machine_affinity_slots/_form.html.erb +1 -5
- data/app/views/naf/machine_runner_invocations/show.html.erb +4 -0
- data/app/views/naf/machine_runners/show.html.erb +44 -34
- data/app/views/naf/machines/index.json.erb +14 -6
- data/app/views/naf/machines/show.html.erb +44 -40
- data/app/views/naf/shared/_auto_resize_width.html.erb +7 -0
- data/app/views/naf/shared/_date_select.html.erb +65 -0
- data/app/views/naf/shared/_select_per_page.html.erb +48 -13
- data/app/views/naf/status/index.html.erb +27 -0
- data/bin/naf +26 -0
- data/config/initializers/naf.rb +13 -1
- data/config/routes.rb +16 -2
- data/db/migrate/20131106162436_add_uuid_column_to_machine_runner_invocations.rb +15 -0
- data/db/migrate/20131121185222_move_tabs_column_from_historical_jobs_to_running_jobs.rb +15 -0
- data/lib/generators/templates/config/logging/naf.yml +0 -8
- data/lib/generators/templates/config/logging/nafjob.yml +0 -8
- data/lib/generators/templates/config/logging/nafrunner.yml +0 -8
- data/lib/generators/templates/naf.rb +0 -8
- data/lib/naf.rb +0 -8
- data/lib/naf/configuration.rb +0 -4
- data/lib/naf/version.rb +1 -1
- data/lib/tasks/naf_tasks.rake +18 -0
- data/naf.gemspec +3 -1
- data/spec/controllers/naf/affinities_controller_spec.rb +0 -1
- data/spec/controllers/naf/applications_controller_spec.rb +3 -2
- data/spec/controllers/naf/machine_affinity_slots_controller_spec.rb +0 -1
- data/spec/controllers/naf/machines_controller_spec.rb +1 -1
- data/spec/dummy/config/logging/naf.yml +0 -8
- data/spec/dummy/config/logging/nafjob.yml +0 -9
- data/spec/dummy/config/logging/nafrunner.yml +0 -10
- data/spec/factories/naf.rb +4 -0
- data/spec/models/logical/naf/application_spec.rb +3 -4
- data/spec/models/logical/naf/job_creator_spec.rb +91 -21
- data/spec/models/logical/naf/job_spec.rb +19 -6
- data/spec/models/logical/naf/log_file_spec.rb +105 -0
- data/spec/models/logical/naf/machine_runner_invocation_spec.rb +41 -0
- data/spec/models/logical/naf/machine_runner_spec.rb +42 -0
- data/spec/models/logical/naf/machine_spec.rb +98 -28
- data/spec/models/naf/affinity_classification_spec.rb +20 -0
- data/spec/models/naf/affinity_spec.rb +21 -0
- data/spec/models/naf/historical_job_spec.rb +2 -44
- data/spec/models/naf/machine_runner_invocation_spec.rb +17 -1
- data/spec/models/naf/running_job_spec.rb +64 -1
- metadata +40 -9
- data/app/models/log4r/papertrail_outputter.rb +0 -19
- data/app/views/naf/historical_jobs/edit.html.erb +0 -11
- data/app/views/naf/machines/_show.html.erb +0 -169
|
@@ -4,8 +4,9 @@ module Logical
|
|
|
4
4
|
module Naf
|
|
5
5
|
|
|
6
6
|
describe Machine do
|
|
7
|
-
let(:physical_machine) { FactoryGirl.create(:machine) }
|
|
8
|
-
let(:physical_machine_two) { FactoryGirl.create(:machine_two) }
|
|
7
|
+
let!(:physical_machine) { FactoryGirl.create(:machine, server_name: 'example.com') }
|
|
8
|
+
let!(:physical_machine_two) { FactoryGirl.create(:machine_two) }
|
|
9
|
+
let!(:logical_machine) { ::Logical::Naf::Machine.new(physical_machine) }
|
|
9
10
|
let(:columns) { [:id,
|
|
10
11
|
:server_name,
|
|
11
12
|
:server_address,
|
|
@@ -18,43 +19,112 @@ module Logical
|
|
|
18
19
|
:affinities,
|
|
19
20
|
:marked_down] }
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
describe '#self.all' do
|
|
23
|
+
it 'return an array of logical wrappers around machines' do
|
|
24
|
+
::Logical::Naf::Machine.all.map(&:id).should == [physical_machine.id, physical_machine_two.id]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe '#process_pool_size' do
|
|
29
|
+
it 'return the correct value' do
|
|
30
|
+
physical_machine.thread_pool_size = 5
|
|
31
|
+
logical_machine.process_pool_size.should == 5
|
|
32
|
+
end
|
|
24
33
|
end
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
describe '#last_checked_schedules_at' do
|
|
36
|
+
it 'render result nicely' do
|
|
37
|
+
physical_machine.mark_checked_schedule
|
|
38
|
+
logical_machine.should_receive(:time_ago_in_words).and_return('')
|
|
39
|
+
logical_machine.last_checked_schedules_at.split(',').first.should =~ /ago$/
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe '#last_seen_alive_at' do
|
|
44
|
+
it 'render result nicely' do
|
|
45
|
+
physical_machine.mark_alive
|
|
46
|
+
logical_machine.should_receive(:time_ago_in_words).and_return('')
|
|
47
|
+
logical_machine.last_seen_alive_at.split(',').first.should =~ /ago$/
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe '#to_hash' do
|
|
52
|
+
it 'return with the specified columns' do
|
|
53
|
+
logical_machine.to_hash.keys.should == columns
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
describe '#affinities' do
|
|
58
|
+
let!(:slot) { FactoryGirl.create(:normal_machine_affinity_slot, machine: physical_machine) }
|
|
59
|
+
|
|
60
|
+
it 'return short_name and affinity_parameter when both are present' do
|
|
61
|
+
slot.update_attributes!(affinity_parameter: 5)
|
|
62
|
+
logical_machine.affinities.should == 'short_name(5.0)'
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it 'return short_name when affinity_parameter is not present' do
|
|
66
|
+
logical_machine.affinities.should == 'short_name'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
it 'return classification and affinity names as last resort' do
|
|
70
|
+
slot.affinity.update_attributes!(affinity_short_name: nil)
|
|
71
|
+
logical_machine.affinities.should == 'purpose_normal'
|
|
72
|
+
end
|
|
30
73
|
end
|
|
31
74
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
75
|
+
describe '#name' do
|
|
76
|
+
it 'return short_name when present' do
|
|
77
|
+
physical_machine.short_name = 'short_name1'
|
|
78
|
+
logical_machine.name.should == 'short_name1'
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'return server_name when short_name is not present' do
|
|
82
|
+
physical_machine.short_name = nil
|
|
83
|
+
logical_machine.name.should == 'example.com'
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it 'return server_address when server_name is not present' do
|
|
87
|
+
physical_machine.short_name = nil
|
|
88
|
+
physical_machine.server_name = nil
|
|
89
|
+
logical_machine.name.should == '0.0.0.1'
|
|
90
|
+
end
|
|
37
91
|
end
|
|
38
92
|
|
|
39
|
-
|
|
40
|
-
physical_machine
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
93
|
+
describe '#status' do
|
|
94
|
+
let!(:runner) { FactoryGirl.create(:machine_runner, machine: physical_machine) }
|
|
95
|
+
let!(:invocation) { FactoryGirl.create(:machine_runner_invocation, machine_runner: runner) }
|
|
96
|
+
|
|
97
|
+
it 'report correctly when runner is up' do
|
|
98
|
+
hash = {
|
|
99
|
+
server_name: logical_machine.name,
|
|
100
|
+
status: 'Good',
|
|
101
|
+
notes: ''
|
|
102
|
+
}
|
|
103
|
+
logical_machine.status.should == hash
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
it 'report correctly when runner is down' do
|
|
107
|
+
hash = {
|
|
108
|
+
server_name: logical_machine.name,
|
|
109
|
+
status: 'Bad',
|
|
110
|
+
notes: 'Runner down'
|
|
111
|
+
}
|
|
112
|
+
invocation.update_attributes!(wind_down_at: Time.zone.now, dead_at: Time.zone.now)
|
|
113
|
+
logical_machine.status.should == hash
|
|
114
|
+
end
|
|
44
115
|
end
|
|
45
116
|
|
|
46
|
-
|
|
47
|
-
it
|
|
48
|
-
|
|
49
|
-
|
|
117
|
+
describe '#runner' do
|
|
118
|
+
it 'return server_name when present' do
|
|
119
|
+
logical_machine.runner.should == 'example.com'
|
|
120
|
+
end
|
|
50
121
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Machine.all.should be_a(Array)
|
|
55
|
-
Machine.all.should have(2).items
|
|
122
|
+
it 'return server_address when server_address is not present' do
|
|
123
|
+
physical_machine.server_name = nil
|
|
124
|
+
logical_machine.runner.should == '0.0.0.1'
|
|
56
125
|
end
|
|
57
126
|
end
|
|
127
|
+
|
|
58
128
|
end
|
|
59
129
|
|
|
60
130
|
end
|
|
@@ -52,5 +52,25 @@ module Naf
|
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
describe "#weight" do
|
|
56
|
+
let!(:weight_affinity_classification) { FactoryGirl.create(:affinity_classification,
|
|
57
|
+
affinity_classification_name: 'weight',
|
|
58
|
+
id: 4) }
|
|
59
|
+
|
|
60
|
+
it "return the weight affinity classification" do
|
|
61
|
+
::Naf::AffinityClassification.weight.should == weight_affinity_classification
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe "#machine" do
|
|
66
|
+
let!(:machine_affinity_classification) { FactoryGirl.create(:affinity_classification,
|
|
67
|
+
affinity_classification_name: 'machine',
|
|
68
|
+
id: 5) }
|
|
69
|
+
|
|
70
|
+
it "return the machine affinity classification" do
|
|
71
|
+
::Naf::AffinityClassification.machine.should == machine_affinity_classification
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
55
75
|
end
|
|
56
76
|
end
|
|
@@ -81,6 +81,27 @@ module Naf
|
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
describe '#validate_affinity_name' do
|
|
85
|
+
it 'return nil when classification is not present' do
|
|
86
|
+
normal.affinity_classification = nil
|
|
87
|
+
normal.validate_affinity_name.should be_nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
it 'return proper message when machine associated with affinity is not found' do
|
|
91
|
+
normal.affinity_classification.affinity_classification_name = 'machine'
|
|
92
|
+
normal.validate_affinity_name.should == "There isn't a machine with that id!"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'return proper message when pair value (affinity_classification_id, affinity_name) already exists' do
|
|
96
|
+
normal.affinity_name = FactoryGirl.create(:machine).id.to_s
|
|
97
|
+
normal.affinity_classification.affinity_classification_name = 'machine'
|
|
98
|
+
normal.save
|
|
99
|
+
normal.affinity_classification.save
|
|
100
|
+
|
|
101
|
+
normal.validate_affinity_name.should == 'An affinity with the pair value (affinity_classification_id, affinity_name) already exists!'
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
84
105
|
#----------------------
|
|
85
106
|
# *** Class Methods ***
|
|
86
107
|
#++++++++++++++++++++++
|
|
@@ -26,7 +26,6 @@ module Naf
|
|
|
26
26
|
:request_to_terminate,
|
|
27
27
|
:marked_dead_by_machine_id,
|
|
28
28
|
:log_level,
|
|
29
|
-
:tags,
|
|
30
29
|
:machine_runner_invocation_id].each do |a|
|
|
31
30
|
it { should allow_mass_assignment_of(a) }
|
|
32
31
|
end
|
|
@@ -47,6 +46,8 @@ module Naf
|
|
|
47
46
|
it { should belong_to(:application) }
|
|
48
47
|
it { should belong_to(:application_run_group_restriction) }
|
|
49
48
|
it { should belong_to(:machine_runner_invocation) }
|
|
49
|
+
it { should have_one(:running_job) }
|
|
50
|
+
it { should have_one(:queued_job) }
|
|
50
51
|
it { should have_many(:historical_job_prerequisites) }
|
|
51
52
|
it { should have_many(:prerequisites) }
|
|
52
53
|
it { should have_many(:historical_job_affinity_tabs) }
|
|
@@ -287,48 +288,5 @@ module Naf
|
|
|
287
288
|
end
|
|
288
289
|
end
|
|
289
290
|
|
|
290
|
-
describe "#add_tags" do
|
|
291
|
-
before do
|
|
292
|
-
historical_job.tags = "{$pre-work}"
|
|
293
|
-
end
|
|
294
|
-
|
|
295
|
-
it "insert unique tag" do
|
|
296
|
-
historical_job.add_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:work]])
|
|
297
|
-
historical_job.tags.should == "{$pre-work,$work}"
|
|
298
|
-
end
|
|
299
|
-
|
|
300
|
-
it "not insert non-unique tag" do
|
|
301
|
-
historical_job.add_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:pre_work]])
|
|
302
|
-
historical_job.tags.should == "{$pre-work}"
|
|
303
|
-
end
|
|
304
|
-
end
|
|
305
|
-
|
|
306
|
-
describe "#remove_tags" do
|
|
307
|
-
before do
|
|
308
|
-
historical_job.tags = "{$pre-work}"
|
|
309
|
-
end
|
|
310
|
-
|
|
311
|
-
it "remove existing tag" do
|
|
312
|
-
historical_job.remove_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:pre_work]])
|
|
313
|
-
historical_job.tags.should == "{}"
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
it "not update tags when removing non-existing tag" do
|
|
317
|
-
historical_job.remove_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:work]])
|
|
318
|
-
historical_job.tags.should == "{$pre-work}"
|
|
319
|
-
end
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
describe "#remove_all_tags" do
|
|
323
|
-
before do
|
|
324
|
-
historical_job.tags = "{$pre-work}"
|
|
325
|
-
end
|
|
326
|
-
|
|
327
|
-
it "remove any existing tags" do
|
|
328
|
-
historical_job.remove_all_tags
|
|
329
|
-
historical_job.tags.should == "{}"
|
|
330
|
-
end
|
|
331
|
-
end
|
|
332
|
-
|
|
333
291
|
end
|
|
334
292
|
end
|
|
@@ -10,7 +10,8 @@ module Naf
|
|
|
10
10
|
:commit_information,
|
|
11
11
|
:branch_name,
|
|
12
12
|
:repository_name,
|
|
13
|
-
:deployment_tag
|
|
13
|
+
:deployment_tag,
|
|
14
|
+
:uuid].each do |a|
|
|
14
15
|
it { should allow_mass_assignment_of(a) }
|
|
15
16
|
end
|
|
16
17
|
|
|
@@ -34,5 +35,20 @@ module Naf
|
|
|
34
35
|
it { should validate_presence_of(:machine_runner_id) }
|
|
35
36
|
it { should validate_presence_of(:pid) }
|
|
36
37
|
|
|
38
|
+
#----------------------
|
|
39
|
+
# *** Class Methods ***
|
|
40
|
+
#++++++++++++++++++++++
|
|
41
|
+
|
|
42
|
+
describe "#recently_marked_dead" do
|
|
43
|
+
let!(:invocation) { FactoryGirl.create(:machine_runner_invocation, dead_at: Time.zone.now - 1.hour) }
|
|
44
|
+
before do
|
|
45
|
+
FactoryGirl.create(:machine_runner_invocation, dead_at: Time.zone.now - 40.hours)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it "return the correct invocation" do
|
|
49
|
+
::Naf::MachineRunnerInvocation.recently_marked_dead(24.hours).should == [invocation]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
37
53
|
end
|
|
38
54
|
end
|
|
@@ -16,7 +16,8 @@ module Naf
|
|
|
16
16
|
:request_to_terminate,
|
|
17
17
|
:marked_dead_by_machine_id,
|
|
18
18
|
:log_level,
|
|
19
|
-
:started_at
|
|
19
|
+
:started_at,
|
|
20
|
+
:tags].each do |a|
|
|
20
21
|
it { should allow_mass_assignment_of(a) }
|
|
21
22
|
end
|
|
22
23
|
|
|
@@ -61,6 +62,22 @@ module Naf
|
|
|
61
62
|
end
|
|
62
63
|
end
|
|
63
64
|
|
|
65
|
+
describe "#started_on_invocation" do
|
|
66
|
+
let!(:invocation) { FactoryGirl.create(:machine_runner_invocation) }
|
|
67
|
+
before do
|
|
68
|
+
running_job.historical_job.machine_runner_invocation = invocation
|
|
69
|
+
running_job.historical_job.save!
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it "return the correct job record" do
|
|
73
|
+
::Naf::RunningJob.started_on_invocation(invocation.id).should == [running_job]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it "return nothing when no running jobs are associated invocation" do
|
|
77
|
+
::Naf::RunningJob.started_on_invocation(invocation.id + 1).should == []
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
64
81
|
describe "#in_run_group" do
|
|
65
82
|
it "return the correct job record" do
|
|
66
83
|
::Naf::RunningJob.should_receive(:where).and_return([running_job])
|
|
@@ -102,6 +119,52 @@ module Naf
|
|
|
102
119
|
end
|
|
103
120
|
end
|
|
104
121
|
|
|
122
|
+
#-------------------------
|
|
123
|
+
# *** Instance Methods ***
|
|
124
|
+
#+++++++++++++++++++++++++
|
|
125
|
+
|
|
126
|
+
describe "#add_tags" do
|
|
127
|
+
before do
|
|
128
|
+
running_job.tags = "{$pre-work}"
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
it "insert unique tag" do
|
|
132
|
+
running_job.add_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:work]])
|
|
133
|
+
running_job.tags.should == "{$pre-work,$work}"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
it "not insert non-unique tag" do
|
|
137
|
+
running_job.add_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:pre_work]])
|
|
138
|
+
running_job.tags.should == "{$pre-work}"
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
describe "#remove_tags" do
|
|
143
|
+
before do
|
|
144
|
+
running_job.tags = "{$pre-work}"
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
it "remove existing tag" do
|
|
148
|
+
running_job.remove_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:pre_work]])
|
|
149
|
+
running_job.tags.should == "{}"
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
it "not update tags when removing non-existing tag" do
|
|
153
|
+
running_job.remove_tags([::Naf::HistoricalJob::SYSTEM_TAGS[:work]])
|
|
154
|
+
running_job.tags.should == "{$pre-work}"
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
describe "#remove_all_tags" do
|
|
159
|
+
before do
|
|
160
|
+
running_job.tags = "{$pre-work}"
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
it "remove any existing tags" do
|
|
164
|
+
running_job.remove_all_tags
|
|
165
|
+
running_job.tags.should == "{}"
|
|
166
|
+
end
|
|
167
|
+
end
|
|
105
168
|
|
|
106
169
|
end
|
|
107
170
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: naf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2013-12-
|
|
15
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: rails
|
|
@@ -181,7 +181,8 @@ description: A cloud based distributed cron, application framework and operation
|
|
|
181
181
|
email:
|
|
182
182
|
- keith@fiksu.com
|
|
183
183
|
- lmeira@fiksu.com
|
|
184
|
-
executables:
|
|
184
|
+
executables:
|
|
185
|
+
- naf
|
|
185
186
|
extensions: []
|
|
186
187
|
extra_rdoc_files: []
|
|
187
188
|
files:
|
|
@@ -196,9 +197,9 @@ files:
|
|
|
196
197
|
- app/assets/images/clock.png
|
|
197
198
|
- app/assets/images/control_play_blue.png
|
|
198
199
|
- app/assets/images/down_arrow.gif
|
|
199
|
-
- app/assets/images/
|
|
200
|
-
- app/assets/images/
|
|
201
|
-
- app/assets/images/
|
|
200
|
+
- app/assets/images/job.png
|
|
201
|
+
- app/assets/images/machine.png
|
|
202
|
+
- app/assets/images/machine_runner.png
|
|
202
203
|
- app/assets/images/terminate.png
|
|
203
204
|
- app/assets/images/ui-bg_flat_0_aaaaaa_40x100.png
|
|
204
205
|
- app/assets/images/ui-bg_flat_0_ffffff_40x100.png
|
|
@@ -219,6 +220,7 @@ files:
|
|
|
219
220
|
- app/assets/images/ui-icons_888888_256x240.png
|
|
220
221
|
- app/assets/images/ui-icons_cd0a0a_256x240.png
|
|
221
222
|
- app/assets/images/up_arrow.gif
|
|
223
|
+
- app/assets/javascripts/col_reorder_with_resize.js
|
|
222
224
|
- app/assets/javascripts/dataTablesTemplates/applications.js
|
|
223
225
|
- app/assets/javascripts/dataTablesTemplates/jobs.js
|
|
224
226
|
- app/assets/javascripts/dataTablesTemplates/machine_runner_invocations.js
|
|
@@ -242,14 +244,17 @@ files:
|
|
|
242
244
|
- app/controllers/naf/historical_job_affinity_tabs_controller.rb
|
|
243
245
|
- app/controllers/naf/historical_jobs_controller.rb
|
|
244
246
|
- app/controllers/naf/janitorial_assignments_controller.rb
|
|
247
|
+
- app/controllers/naf/log_parsers_controller.rb
|
|
248
|
+
- app/controllers/naf/log_viewer_controller.rb
|
|
245
249
|
- app/controllers/naf/logger_names_controller.rb
|
|
246
250
|
- app/controllers/naf/logger_styles_controller.rb
|
|
247
251
|
- app/controllers/naf/machine_affinity_slots_controller.rb
|
|
248
252
|
- app/controllers/naf/machine_runner_invocations_controller.rb
|
|
249
253
|
- app/controllers/naf/machine_runners_controller.rb
|
|
250
254
|
- app/controllers/naf/machines_controller.rb
|
|
255
|
+
- app/controllers/naf/status_controller.rb
|
|
251
256
|
- app/helpers/naf/application_helper.rb
|
|
252
|
-
- app/
|
|
257
|
+
- app/helpers/naf/time_helper.rb
|
|
253
258
|
- app/models/logical/naf/application.rb
|
|
254
259
|
- app/models/logical/naf/construction_zone/ad_hoc_work_order.rb
|
|
255
260
|
- app/models/logical/naf/construction_zone/application_schedule_work_order.rb
|
|
@@ -269,6 +274,12 @@ files:
|
|
|
269
274
|
- app/models/logical/naf/job_statuses/running.rb
|
|
270
275
|
- app/models/logical/naf/job_statuses/terminated.rb
|
|
271
276
|
- app/models/logical/naf/job_statuses/waiting.rb
|
|
277
|
+
- app/models/logical/naf/log_file.rb
|
|
278
|
+
- app/models/logical/naf/log_parser/base.rb
|
|
279
|
+
- app/models/logical/naf/log_parser/job.rb
|
|
280
|
+
- app/models/logical/naf/log_parser/machine.rb
|
|
281
|
+
- app/models/logical/naf/log_parser/runner.rb
|
|
282
|
+
- app/models/logical/naf/log_reader.rb
|
|
272
283
|
- app/models/logical/naf/machine.rb
|
|
273
284
|
- app/models/logical/naf/machine_runner.rb
|
|
274
285
|
- app/models/logical/naf/machine_runner_invocation.rb
|
|
@@ -303,9 +314,11 @@ files:
|
|
|
303
314
|
- app/models/naf/running_job.rb
|
|
304
315
|
- app/models/process/naf/application.rb
|
|
305
316
|
- app/models/process/naf/janitor.rb
|
|
317
|
+
- app/models/process/naf/log_archiver.rb
|
|
306
318
|
- app/models/process/naf/machine_manager.rb
|
|
307
319
|
- app/models/process/naf/machine_upgrader.rb
|
|
308
320
|
- app/models/process/naf/runner.rb
|
|
321
|
+
- app/models/process/naf/runner_log.rb
|
|
309
322
|
- app/views/naf/affinities/_form.html.erb
|
|
310
323
|
- app/views/naf/affinities/edit.html.erb
|
|
311
324
|
- app/views/naf/affinities/index.html.erb
|
|
@@ -331,7 +344,6 @@ files:
|
|
|
331
344
|
- app/views/naf/historical_jobs/_form.html.erb
|
|
332
345
|
- app/views/naf/historical_jobs/_runners.html.erb
|
|
333
346
|
- app/views/naf/historical_jobs/_search_container.html.erb
|
|
334
|
-
- app/views/naf/historical_jobs/edit.html.erb
|
|
335
347
|
- app/views/naf/historical_jobs/index.html.erb
|
|
336
348
|
- app/views/naf/historical_jobs/index.json.erb
|
|
337
349
|
- app/views/naf/historical_jobs/new.html.erb
|
|
@@ -343,6 +355,14 @@ files:
|
|
|
343
355
|
- app/views/naf/janitorial_assignments/index.js.erb
|
|
344
356
|
- app/views/naf/janitorial_assignments/new.html.erb
|
|
345
357
|
- app/views/naf/layouts/jquery_datatables.json.erb
|
|
358
|
+
- app/views/naf/log_viewer/_job_logs.html.erb
|
|
359
|
+
- app/views/naf/log_viewer/_log_display.html.erb
|
|
360
|
+
- app/views/naf/log_viewer/_log_layout.html.erb
|
|
361
|
+
- app/views/naf/log_viewer/_machine_logs.html.erb
|
|
362
|
+
- app/views/naf/log_viewer/_runner_logs.html.erb
|
|
363
|
+
- app/views/naf/log_viewer/_search_options.html.erb
|
|
364
|
+
- app/views/naf/log_viewer/_update_page_title.html.erb
|
|
365
|
+
- app/views/naf/log_viewer/index.html.erb
|
|
346
366
|
- app/views/naf/logger_names/_form.html.erb
|
|
347
367
|
- app/views/naf/logger_names/edit.html.erb
|
|
348
368
|
- app/views/naf/logger_names/new.html.erb
|
|
@@ -364,7 +384,6 @@ files:
|
|
|
364
384
|
- app/views/naf/machine_runners/show.html.erb
|
|
365
385
|
- app/views/naf/machines/_filter.html.erb
|
|
366
386
|
- app/views/naf/machines/_form.html.erb
|
|
367
|
-
- app/views/naf/machines/_show.html.erb
|
|
368
387
|
- app/views/naf/machines/edit.html.erb
|
|
369
388
|
- app/views/naf/machines/index.html.erb
|
|
370
389
|
- app/views/naf/machines/index.json.erb
|
|
@@ -372,13 +391,19 @@ files:
|
|
|
372
391
|
- app/views/naf/machines/show.html.erb
|
|
373
392
|
- app/views/naf/record.html.erb
|
|
374
393
|
- app/views/naf/shared/_application.html.erb
|
|
394
|
+
- app/views/naf/shared/_auto_resize_width.html.erb
|
|
395
|
+
- app/views/naf/shared/_date_select.html.erb
|
|
375
396
|
- app/views/naf/shared/_information_container.html.erb
|
|
376
397
|
- app/views/naf/shared/_select_per_page.html.erb
|
|
398
|
+
- app/views/naf/status/index.html.erb
|
|
399
|
+
- bin/naf
|
|
377
400
|
- ci/test-build.sh
|
|
378
401
|
- ci/travis.sh
|
|
379
402
|
- config/initializers/naf.rb
|
|
380
403
|
- config/routes.rb
|
|
381
404
|
- db/migrate/20120820023848_naf_schema.rb
|
|
405
|
+
- db/migrate/20131106162436_add_uuid_column_to_machine_runner_invocations.rb
|
|
406
|
+
- db/migrate/20131121185222_move_tabs_column_from_historical_jobs_to_running_jobs.rb
|
|
382
407
|
- doc/README_FOR_APP
|
|
383
408
|
- lib/generators/naf_generator.rb
|
|
384
409
|
- lib/generators/templates/config/logging/af.yml
|
|
@@ -449,6 +474,9 @@ files:
|
|
|
449
474
|
- spec/models/logical/naf/job_creator_spec.rb
|
|
450
475
|
- spec/models/logical/naf/job_fetcher_spec.rb
|
|
451
476
|
- spec/models/logical/naf/job_spec.rb
|
|
477
|
+
- spec/models/logical/naf/log_file_spec.rb
|
|
478
|
+
- spec/models/logical/naf/machine_runner_invocation_spec.rb
|
|
479
|
+
- spec/models/logical/naf/machine_runner_spec.rb
|
|
452
480
|
- spec/models/logical/naf/machine_spec.rb
|
|
453
481
|
- spec/models/naf/affinity_classification_spec.rb
|
|
454
482
|
- spec/models/naf/affinity_spec.rb
|
|
@@ -560,6 +588,9 @@ test_files:
|
|
|
560
588
|
- spec/models/logical/naf/job_creator_spec.rb
|
|
561
589
|
- spec/models/logical/naf/job_fetcher_spec.rb
|
|
562
590
|
- spec/models/logical/naf/job_spec.rb
|
|
591
|
+
- spec/models/logical/naf/log_file_spec.rb
|
|
592
|
+
- spec/models/logical/naf/machine_runner_invocation_spec.rb
|
|
593
|
+
- spec/models/logical/naf/machine_runner_spec.rb
|
|
563
594
|
- spec/models/logical/naf/machine_spec.rb
|
|
564
595
|
- spec/models/naf/affinity_classification_spec.rb
|
|
565
596
|
- spec/models/naf/affinity_spec.rb
|