naf 1.1.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/.gitignore +16 -0
- data/.rspec +1 -0
- data/.travis.yml +17 -0
- data/Gemfile +17 -0
- data/LICENSE +2 -0
- data/README.rdoc +22 -0
- data/RELEASE_NOTES.rdoc +18 -0
- data/Rakefile +43 -0
- data/app/assets/images/bg-grad.png +0 -0
- data/app/assets/images/clock.png +0 -0
- data/app/assets/images/control_play_blue.png +0 -0
- data/app/assets/images/down_arrow.gif +0 -0
- data/app/assets/images/papertrail_job.png +0 -0
- data/app/assets/images/papertrail_machine.png +0 -0
- data/app/assets/images/papertrail_machine_runner.png +0 -0
- data/app/assets/images/terminate.png +0 -0
- data/app/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/ui-bg_flat_0_ffffff_40x100.png +0 -0
- data/app/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/ui-bg_glass_0_f4f4f4_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_65_f4f4f4_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_75_f4f4f4_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/ui-bg_highlight-soft_0_f4f4f4_1x100.png +0 -0
- data/app/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/up_arrow.gif +0 -0
- data/app/assets/javascripts/dataTablesTemplates/applications.js +94 -0
- data/app/assets/javascripts/dataTablesTemplates/jobs.js +163 -0
- data/app/assets/javascripts/dataTablesTemplates/machine_runner_invocations.js +60 -0
- data/app/assets/javascripts/dataTablesTemplates/machine_runners.js +82 -0
- data/app/assets/javascripts/dataTablesTemplates/machines.js +93 -0
- data/app/assets/javascripts/date.js +104 -0
- data/app/assets/javascripts/iso8601.js +41 -0
- data/app/assets/javascripts/jquery.dataTables.custom.js +62 -0
- data/app/assets/javascripts/jquery.dataTables.js +6862 -0
- data/app/assets/javascripts/naf.js +30 -0
- data/app/assets/javascripts/underscore.js +713 -0
- data/app/assets/stylesheets/jquery_ui/jquery-ui-1.8.5.custom.css.erb +572 -0
- data/app/assets/stylesheets/min_naf.css +14 -0
- data/app/assets/stylesheets/min_naf/layout.css.scss +355 -0
- data/app/assets/stylesheets/naf.css +14 -0
- data/app/assets/stylesheets/naf/layout.css.scss +497 -0
- data/app/controllers/naf/affinities_controller.rb +61 -0
- data/app/controllers/naf/application_controller.rb +43 -0
- data/app/controllers/naf/application_schedule_affinity_tabs_controller.rb +75 -0
- data/app/controllers/naf/applications_controller.rb +153 -0
- data/app/controllers/naf/historical_job_affinity_tabs_controller.rb +65 -0
- data/app/controllers/naf/historical_jobs_controller.rb +159 -0
- data/app/controllers/naf/janitorial_assignments_controller.rb +77 -0
- data/app/controllers/naf/logger_names_controller.rb +58 -0
- data/app/controllers/naf/logger_styles_controller.rb +59 -0
- data/app/controllers/naf/machine_affinity_slots_controller.rb +69 -0
- data/app/controllers/naf/machine_runner_invocations_controller.rb +59 -0
- data/app/controllers/naf/machine_runners_controller.rb +26 -0
- data/app/controllers/naf/machines_controller.rb +95 -0
- data/app/helpers/naf/application_helper.rb +275 -0
- data/app/models/log4r/papertrail_outputter.rb +19 -0
- data/app/models/logical/naf/application.rb +183 -0
- data/app/models/logical/naf/construction_zone/ad_hoc_work_order.rb +22 -0
- data/app/models/logical/naf/construction_zone/application_schedule_work_order.rb +15 -0
- data/app/models/logical/naf/construction_zone/application_work_order.rb +25 -0
- data/app/models/logical/naf/construction_zone/boss.rb +123 -0
- data/app/models/logical/naf/construction_zone/foreman.rb +53 -0
- data/app/models/logical/naf/construction_zone/proletariat.rb +40 -0
- data/app/models/logical/naf/construction_zone/work_order.rb +100 -0
- data/app/models/logical/naf/create_infrastructure.rb +48 -0
- data/app/models/logical/naf/job.rb +357 -0
- data/app/models/logical/naf/job_creator.rb +155 -0
- data/app/models/logical/naf/job_fetcher.rb +167 -0
- data/app/models/logical/naf/job_statuses/errored.rb +27 -0
- data/app/models/logical/naf/job_statuses/finished.rb +26 -0
- data/app/models/logical/naf/job_statuses/finished_less_minute.rb +25 -0
- data/app/models/logical/naf/job_statuses/queued.rb +32 -0
- data/app/models/logical/naf/job_statuses/running.rb +34 -0
- data/app/models/logical/naf/job_statuses/terminated.rb +25 -0
- data/app/models/logical/naf/job_statuses/waiting.rb +43 -0
- data/app/models/logical/naf/machine.rb +85 -0
- data/app/models/logical/naf/machine_runner.rb +46 -0
- data/app/models/logical/naf/machine_runner_invocation.rb +50 -0
- data/app/models/logical/naf/pickler.rb +74 -0
- data/app/models/logical/naf/unpickler.rb +98 -0
- data/app/models/naf/affinity.rb +145 -0
- data/app/models/naf/affinity_classification.rb +44 -0
- data/app/models/naf/application.rb +100 -0
- data/app/models/naf/application_run_group_restriction.rb +39 -0
- data/app/models/naf/application_schedule.rb +181 -0
- data/app/models/naf/application_schedule_affinity_tab.rb +86 -0
- data/app/models/naf/application_schedule_prerequisite.rb +50 -0
- data/app/models/naf/application_type.rb +72 -0
- data/app/models/naf/by_historical_job_id.rb +86 -0
- data/app/models/naf/historical_job.rb +334 -0
- data/app/models/naf/historical_job_affinity_tab.rb +61 -0
- data/app/models/naf/historical_job_prerequisite.rb +19 -0
- data/app/models/naf/janitorial_archive_assignment.rb +36 -0
- data/app/models/naf/janitorial_assignment.rb +37 -0
- data/app/models/naf/janitorial_create_assignment.rb +36 -0
- data/app/models/naf/janitorial_drop_assignment.rb +36 -0
- data/app/models/naf/logger_level.rb +21 -0
- data/app/models/naf/logger_name.rb +23 -0
- data/app/models/naf/logger_style.rb +58 -0
- data/app/models/naf/logger_style_name.rb +28 -0
- data/app/models/naf/machine.rb +257 -0
- data/app/models/naf/machine_affinity_slot.rb +78 -0
- data/app/models/naf/machine_runner.rb +51 -0
- data/app/models/naf/machine_runner_invocation.rb +71 -0
- data/app/models/naf/naf_base.rb +9 -0
- data/app/models/naf/queued_job.rb +164 -0
- data/app/models/naf/running_job.rb +80 -0
- data/app/models/process/naf/application.rb +164 -0
- data/app/models/process/naf/janitor.rb +117 -0
- data/app/models/process/naf/machine_manager.rb +150 -0
- data/app/models/process/naf/machine_upgrader.rb +112 -0
- data/app/models/process/naf/runner.rb +539 -0
- data/app/views/naf/affinities/_form.html.erb +50 -0
- data/app/views/naf/affinities/edit.html.erb +11 -0
- data/app/views/naf/affinities/index.html.erb +57 -0
- data/app/views/naf/affinities/new.html.erb +15 -0
- data/app/views/naf/affinities/show.html.erb +48 -0
- data/app/views/naf/application_schedule_affinity_tabs/_form.html.erb +31 -0
- data/app/views/naf/application_schedule_affinity_tabs/edit.html.erb +12 -0
- data/app/views/naf/application_schedule_affinity_tabs/new.html.erb +11 -0
- data/app/views/naf/applications/_application_schedule.html.erb +80 -0
- data/app/views/naf/applications/_application_schedule_prerequisites.html.erb +14 -0
- data/app/views/naf/applications/_form.html.erb +109 -0
- data/app/views/naf/applications/_search_container.html.erb +94 -0
- data/app/views/naf/applications/_show.html.erb +34 -0
- data/app/views/naf/applications/edit.html.erb +11 -0
- data/app/views/naf/applications/index.html.erb +51 -0
- data/app/views/naf/applications/index.json.erb +11 -0
- data/app/views/naf/applications/new.html.erb +11 -0
- data/app/views/naf/applications/show.html.erb +203 -0
- data/app/views/naf/datatable.html.erb +49 -0
- data/app/views/naf/historical_job_affinity_tabs/_form.html.erb +36 -0
- data/app/views/naf/historical_job_affinity_tabs/edit.html.erb +11 -0
- data/app/views/naf/historical_job_affinity_tabs/new.html.erb +11 -0
- data/app/views/naf/historical_jobs/_form.html.erb +94 -0
- data/app/views/naf/historical_jobs/_runners.html.erb +22 -0
- data/app/views/naf/historical_jobs/_search_container.html.erb +140 -0
- data/app/views/naf/historical_jobs/edit.html.erb +11 -0
- data/app/views/naf/historical_jobs/index.html.erb +48 -0
- data/app/views/naf/historical_jobs/index.json.erb +26 -0
- data/app/views/naf/historical_jobs/new.html.erb +61 -0
- data/app/views/naf/historical_jobs/show.html.erb +201 -0
- data/app/views/naf/janitorial_assignments/_form.html.erb +38 -0
- data/app/views/naf/janitorial_assignments/_rows.html.erb +17 -0
- data/app/views/naf/janitorial_assignments/edit.html.erb +11 -0
- data/app/views/naf/janitorial_assignments/index.html.erb +56 -0
- data/app/views/naf/janitorial_assignments/index.js.erb +1 -0
- data/app/views/naf/janitorial_assignments/new.html.erb +11 -0
- data/app/views/naf/layouts/jquery_datatables.json.erb +6 -0
- data/app/views/naf/logger_names/_form.html.erb +18 -0
- data/app/views/naf/logger_names/edit.html.erb +11 -0
- data/app/views/naf/logger_names/new.html.erb +11 -0
- data/app/views/naf/logger_names/show.html.erb +44 -0
- data/app/views/naf/logger_styles/_form.html.erb +30 -0
- data/app/views/naf/logger_styles/_logger_style_names.html.erb +19 -0
- data/app/views/naf/logger_styles/edit.html.erb +11 -0
- data/app/views/naf/logger_styles/new.html.erb +11 -0
- data/app/views/naf/logger_styles/show.html.erb +48 -0
- data/app/views/naf/machine_affinity_slots/_form.html.erb +36 -0
- data/app/views/naf/machine_affinity_slots/edit.html.erb +11 -0
- data/app/views/naf/machine_affinity_slots/new.html.erb +11 -0
- data/app/views/naf/machine_runner_invocations/_filter.html.erb +21 -0
- data/app/views/naf/machine_runner_invocations/index.html.erb +36 -0
- data/app/views/naf/machine_runner_invocations/index.json.erb +16 -0
- data/app/views/naf/machine_runner_invocations/show.html.erb +91 -0
- data/app/views/naf/machine_runners/index.html.erb +82 -0
- data/app/views/naf/machine_runners/index.json.erb +16 -0
- data/app/views/naf/machine_runners/show.html.erb +113 -0
- data/app/views/naf/machines/_filter.html.erb +26 -0
- data/app/views/naf/machines/_form.html.erb +62 -0
- data/app/views/naf/machines/_show.html.erb +169 -0
- data/app/views/naf/machines/edit.html.erb +11 -0
- data/app/views/naf/machines/index.html.erb +51 -0
- data/app/views/naf/machines/index.json.erb +23 -0
- data/app/views/naf/machines/new.html.erb +11 -0
- data/app/views/naf/machines/show.html.erb +92 -0
- data/app/views/naf/record.html.erb +46 -0
- data/app/views/naf/shared/_application.html.erb +50 -0
- data/app/views/naf/shared/_information_container.html.erb +19 -0
- data/app/views/naf/shared/_select_per_page.html.erb +72 -0
- data/ci/test-build.sh +17 -0
- data/ci/travis.sh +26 -0
- data/config/initializers/naf.rb +3 -0
- data/config/routes.rb +38 -0
- data/db/migrate/20120820023848_naf_schema.rb +413 -0
- data/doc/README_FOR_APP +2 -0
- data/lib/generators/naf_generator.rb +45 -0
- data/lib/generators/templates/config/logging/af.yml +26 -0
- data/lib/generators/templates/config/logging/naf.yml +22 -0
- data/lib/generators/templates/config/logging/nafjob.yml +16 -0
- data/lib/generators/templates/config/logging/nafrunner.yml +17 -0
- data/lib/generators/templates/naf.rb +11 -0
- data/lib/generators/templates/naf_layout.html.erb +15 -0
- data/lib/naf.rb +48 -0
- data/lib/naf/configuration.rb +23 -0
- data/lib/naf/engine.rb +18 -0
- data/lib/naf/version.rb +3 -0
- data/lib/tasks/naf_tasks.rake +370 -0
- data/naf.gemspec +30 -0
- data/script/rails +10 -0
- data/spec/controllers/naf/affinities_controller_spec.rb +79 -0
- data/spec/controllers/naf/application_controller_spec.rb +10 -0
- data/spec/controllers/naf/application_schedule_affinity_tabs_controller_spec.rb +106 -0
- data/spec/controllers/naf/applications_controller_spec.rb +109 -0
- data/spec/controllers/naf/historical_job_affinity_tabs_controller_spec.rb +96 -0
- data/spec/controllers/naf/historical_jobs_controller_spec.rb +19 -0
- data/spec/controllers/naf/machine_affinity_slots_controller_spec.rb +109 -0
- data/spec/controllers/naf/machines_controller_spec.rb +74 -0
- data/spec/dummy/.gitignore +12 -0
- data/spec/dummy/README +19 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/stylesheets/application.css +14 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/my_script.rb +8 -0
- data/spec/dummy/app/models/other/base.rb.sample +10 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/naf_layout.html.erb +15 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +62 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database-non_primary.yml +20 -0
- data/spec/dummy/config/database-primary.yml +16 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/naf.rb.non_primary +4 -0
- data/spec/dummy/config/initializers/naf.rb.primary +3 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/logging/af.yml +26 -0
- data/spec/dummy/config/logging/naf.yml +22 -0
- data/spec/dummy/config/logging/nafjob.yml +16 -0
- data/spec/dummy/config/logging/nafrunner.yml +17 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/db/.gitignore +2 -0
- data/spec/dummy/lib/tasks/dummy.rake +60 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/naf.rb +433 -0
- data/spec/helpers/naf/application_helper_spec.rb +0 -0
- data/spec/models/logical/naf/application_spec.rb +69 -0
- data/spec/models/logical/naf/job_creator_spec.rb +32 -0
- data/spec/models/logical/naf/job_fetcher_spec.rb +140 -0
- data/spec/models/logical/naf/job_spec.rb +282 -0
- data/spec/models/logical/naf/machine_spec.rb +61 -0
- data/spec/models/naf/affinity_classification_spec.rb +56 -0
- data/spec/models/naf/affinity_spec.rb +100 -0
- data/spec/models/naf/application_run_group_restriction_spec.rb +57 -0
- data/spec/models/naf/application_schedule_affinity_tab_spec.rb +85 -0
- data/spec/models/naf/application_schedule_prerequisite_spec.rb +35 -0
- data/spec/models/naf/application_schedule_spec.rb +166 -0
- data/spec/models/naf/application_spec.rb +128 -0
- data/spec/models/naf/application_type_spec.rb +104 -0
- data/spec/models/naf/historical_job_affinity_tab_spec.rb +59 -0
- data/spec/models/naf/historical_job_prerequisite_spec.rb +25 -0
- data/spec/models/naf/historical_job_spec.rb +334 -0
- data/spec/models/naf/logger_level_spec.rb +34 -0
- data/spec/models/naf/logger_name_spec.rb +35 -0
- data/spec/models/naf/logger_style_name_spec.rb +39 -0
- data/spec/models/naf/logger_style_spec.rb +89 -0
- data/spec/models/naf/machine_affinity_slot_spec.rb +77 -0
- data/spec/models/naf/machine_runner_invocation_spec.rb +38 -0
- data/spec/models/naf/machine_runner_spec.rb +37 -0
- data/spec/models/naf/machine_spec.rb +425 -0
- data/spec/models/naf/naf_base_spec.rb +14 -0
- data/spec/models/naf/queued_job_spec.rb +171 -0
- data/spec/models/naf/running_job_spec.rb +107 -0
- data/spec/models/process/naf/application_spec.rb +8 -0
- data/spec/models/process/naf/janitor_spec.rb +10 -0
- data/spec/models/process/naf/runner_spec.rb +10 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/support/engine_routing.rb +27 -0
- data/spec/support/script_spec_helper.rb +58 -0
- metadata +590 -0
data/.gitignore
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
+
#
|
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
|
5
|
+
# git config --global core.excludesfile ~/.gitignore_global
|
|
6
|
+
|
|
7
|
+
# Ignore bundler config
|
|
8
|
+
/.bundle
|
|
9
|
+
|
|
10
|
+
# Ignore the default SQLite database.
|
|
11
|
+
/db/*.sqlite3
|
|
12
|
+
|
|
13
|
+
# Ignore all logfiles and tempfiles.
|
|
14
|
+
/log/*.log
|
|
15
|
+
/tmp
|
|
16
|
+
.idea/**
|
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
rvm:
|
|
3
|
+
- 1.9.3
|
|
4
|
+
script: ci/travis.sh
|
|
5
|
+
env:
|
|
6
|
+
- SPEC_GROUP=primary_database
|
|
7
|
+
branches:
|
|
8
|
+
only:
|
|
9
|
+
- master
|
|
10
|
+
notifications:
|
|
11
|
+
email:
|
|
12
|
+
- keith@fiksu.com
|
|
13
|
+
- nlim@fiksu.com
|
|
14
|
+
- adembskiy@fiksu.com
|
|
15
|
+
- lmeira@fiksu.com
|
|
16
|
+
webhooks:
|
|
17
|
+
- https://zapier.com/hooks/WebHookAPI/?sid=43534
|
data/Gemfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gemspec
|
|
4
|
+
|
|
5
|
+
group :assets do
|
|
6
|
+
gem 'sass-rails', '~> 3.2.3'
|
|
7
|
+
gem 'coffee-rails', '~> 3.2.1'
|
|
8
|
+
gem 'uglifier', '>= 1.0.3'
|
|
9
|
+
end
|
|
10
|
+
gem 'jquery-ui-rails'
|
|
11
|
+
gem 'awesome_print'
|
|
12
|
+
gem 'will_paginate'
|
|
13
|
+
gem 'facter'
|
|
14
|
+
gem 'shoulda-matchers', '2.0.0'
|
|
15
|
+
gem "timecop", '0.4.5'
|
|
16
|
+
|
|
17
|
+
gem 'fiksu-af'
|
data/LICENSE
ADDED
data/README.rdoc
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
= Network Application Framework (Naf)
|
|
2
|
+
|
|
3
|
+
Distributed Rails-based fault tolerant script scheduling framework, providing:
|
|
4
|
+
|
|
5
|
+
* Quick prototyping
|
|
6
|
+
* Logging
|
|
7
|
+
* Scheduling
|
|
8
|
+
* Queuing
|
|
9
|
+
* Process Management
|
|
10
|
+
* Alarming
|
|
11
|
+
|
|
12
|
+
With a management console, providing:
|
|
13
|
+
|
|
14
|
+
* Machine Management
|
|
15
|
+
* Live Queue Management
|
|
16
|
+
* Process Management
|
|
17
|
+
* Script Management
|
|
18
|
+
* Schedule Management
|
|
19
|
+
|
|
20
|
+
=== Please find up-to-date information on Naf here: {Naf Wiki}[http://www.github.com/fiksu/naf/wiki]
|
|
21
|
+
|
|
22
|
+
=== Instructions on updgrading Naf to Version 1.0.3: {Instructions}[http://www.github.com/fiksu/naf/wiki/Upgrading]
|
data/RELEASE_NOTES.rdoc
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
= Release Notes
|
|
2
|
+
|
|
3
|
+
=== Version 1.0.0
|
|
4
|
+
|
|
5
|
+
Features/Changes:
|
|
6
|
+
* Three table queue (Historical, Running, Queued)
|
|
7
|
+
* Job tags (system, custom visible/invisible)
|
|
8
|
+
* Papertrail logging for Jobs and Machines
|
|
9
|
+
* CPU/Memory control of Jobs
|
|
10
|
+
* Environment specific log configuration
|
|
11
|
+
* Enqueue switch for application_schedules
|
|
12
|
+
* Machine runner management
|
|
13
|
+
* Killed jobs marked as terminating/terminated
|
|
14
|
+
* Updated display of timestamps (Started At, Finished At, Run Time) for Jobs
|
|
15
|
+
* Fixed buttons to add Jobs to the Queue
|
|
16
|
+
* Jobs index page is automatically refreshed
|
|
17
|
+
|
|
18
|
+
=== Please find up-to-date information on Naf here: {Naf Wiki}[http://www.github.com/fiksu/naf/wiki]
|
data/Rakefile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
|
|
3
|
+
begin
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
rescue LoadError
|
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
7
|
+
end
|
|
8
|
+
begin
|
|
9
|
+
require 'rdoc/task'
|
|
10
|
+
rescue LoadError
|
|
11
|
+
require 'rdoc/rdoc'
|
|
12
|
+
require 'rake/rdoctask'
|
|
13
|
+
RDoc::Task = Rake::RDocTask
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
17
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
18
|
+
rdoc.title = 'Naf'
|
|
19
|
+
rdoc.options << '--line-numbers'
|
|
20
|
+
rdoc.rdoc_files.include('README')
|
|
21
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Eventually we will want a test application to use this Engine
|
|
25
|
+
# to see if it works!
|
|
26
|
+
|
|
27
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
28
|
+
|
|
29
|
+
load 'rails/tasks/engine.rake'
|
|
30
|
+
|
|
31
|
+
Bundler::GemHelper.install_tasks
|
|
32
|
+
|
|
33
|
+
require 'rake'
|
|
34
|
+
require 'rspec/core'
|
|
35
|
+
require 'rspec/core/rake_task'
|
|
36
|
+
|
|
37
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
38
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
desc 'Default: Run all specs.'
|
|
42
|
+
task default: :spec
|
|
43
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// When document is ready
|
|
2
|
+
jQuery(document).ready(function() {
|
|
3
|
+
|
|
4
|
+
// Prepare for setup the datatable.
|
|
5
|
+
var dataTableOptions = {
|
|
6
|
+
"sAjaxSource": sAjaxSource,
|
|
7
|
+
"fnInitComplete" : function() {
|
|
8
|
+
initPageSelect();
|
|
9
|
+
},
|
|
10
|
+
"bAutoWidth": false,
|
|
11
|
+
"aoColumnDefs": [
|
|
12
|
+
{ "bVisible": false, "aTargets": [ 14, 15 ] }, // turn off visibility
|
|
13
|
+
{ "sClass": "center", "aTargets": [ 6, 7, 8, 9, 12, 13 ] }
|
|
14
|
+
],
|
|
15
|
+
"aoColumns": [
|
|
16
|
+
{ "sWidth": "2%"}, // Id
|
|
17
|
+
{ "sWidth": "12%"}, // Title
|
|
18
|
+
{ "sWidth": "7%"}, // Short Name
|
|
19
|
+
{ "sWidth": "6%"}, // Script Type Name
|
|
20
|
+
null, // Application Run Group Name
|
|
21
|
+
{ "sWidth": "9%"}, // Application Run Group Restriction Name
|
|
22
|
+
{ "sWidth": "7%"}, // Application Run Group Limit
|
|
23
|
+
{ "sWidth": "4%"}, // Enabled
|
|
24
|
+
{ "sWidth": "4%"}, // Enqueue Backlogs
|
|
25
|
+
{ "sWidth": "8%"}, // Run Time
|
|
26
|
+
{ "sWidth": "10%"}, // Last Queued At
|
|
27
|
+
{ "sWidth": "8%"}, // Affinities
|
|
28
|
+
{ "sWidth": "8%"}, // Prerequisites
|
|
29
|
+
{ "sWidth": "4%"}, // Actions
|
|
30
|
+
null,
|
|
31
|
+
null
|
|
32
|
+
],
|
|
33
|
+
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
|
34
|
+
_.each(jQuery('.datatable_variable').serializeArray(), function(dv) { aoData.push(dv); });
|
|
35
|
+
jQuery.getJSON( sSource, aoData, function (json) {
|
|
36
|
+
fnCallback(json);
|
|
37
|
+
initPaging();
|
|
38
|
+
addTitles();
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
|
42
|
+
addLinkToApplication(nRow, aData);
|
|
43
|
+
colorizationDeletedOrHidden(nRow, aData);
|
|
44
|
+
checkTimeFormat(nRow, aData);
|
|
45
|
+
return nRow;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Setup the datatable
|
|
50
|
+
jQuery('#datatable').addDataTable(dataTableOptions);
|
|
51
|
+
|
|
52
|
+
jQuery(document).delegate('.enqueue', "click", function(){
|
|
53
|
+
var answer = confirm("Adding application as a job on the queue?");
|
|
54
|
+
if (!answer) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
jQuery.post(postSource, { "historical_job[application_id]": jQuery(this).attr('id') }, function(data) {
|
|
58
|
+
if (data.success) {
|
|
59
|
+
jQuery("<p id='notice'>Congratulations, a Job " + data.title + " was added!</p>").
|
|
60
|
+
appendTo('#flash_message').slideDown().delay(5000).slideUp();
|
|
61
|
+
jQuery('#datatable').dataTable().fnDraw();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
jQuery("<div class='error'>Sorry, \'" + data.title + "\' cannot add a Job to the queue right now!</div>").
|
|
65
|
+
appendTo('#flash_message').slideDown().delay(5000).slideUp();
|
|
66
|
+
jQuery('#datatable').dataTable().fnDraw();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function addLinkToApplication(nRow, aData) {
|
|
73
|
+
var id = aData[0];
|
|
74
|
+
var row = jQuery('<a href="/job_system/applications/' + id + '">' + id + '</a>' );
|
|
75
|
+
jQuery('td:nth-child(1)', nRow).empty().append(row);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function colorizationDeletedOrHidden(nRow, aData) {
|
|
79
|
+
if (aData[11] == 'true' || aData[12] == 'false' || aData[13] == '') {
|
|
80
|
+
jQuery(nRow).addClass('deleted_or_hidden');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function checkTimeFormat(nRow, aData) {
|
|
85
|
+
var l_q_a_array = jQuery(aData[10]).text().split(',');
|
|
86
|
+
var last_queued_at;
|
|
87
|
+
if(jQuery('#time_format').val() == 'lexically') {
|
|
88
|
+
last_queued_at = l_q_a_array[0];
|
|
89
|
+
} else {
|
|
90
|
+
last_queued_at = l_q_a_array[1];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
jQuery('td:nth-child(11)', nRow).empty().append(jQuery(aData[10]).text(last_queued_at));
|
|
94
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// When document is ready
|
|
2
|
+
jQuery(document).ready(function() {
|
|
3
|
+
// Prepare for setup the datatable.
|
|
4
|
+
var dataTableOptions = {
|
|
5
|
+
"sAjaxSource": sAjaxSource,
|
|
6
|
+
"bSort": true,
|
|
7
|
+
"aaSorting": [[10, 'desc']],
|
|
8
|
+
"aoColumnDefs": [
|
|
9
|
+
{ "bSortable": false, "aTargets": [1, 4, 7, 8, 9, 11, 12] }, // turn off sorting
|
|
10
|
+
{ "bVisible": false, "aTargets": [11] }, // turn off visibility
|
|
11
|
+
{ "sClass": "center", "aTargets": [12] }
|
|
12
|
+
],
|
|
13
|
+
"bAutoWidth": false,
|
|
14
|
+
"aoColumns": [
|
|
15
|
+
{ "sWidth": "3%"}, // Id
|
|
16
|
+
{ "sWidth": "7%"}, // Server
|
|
17
|
+
{ "sWidth": "4%"}, // Pid
|
|
18
|
+
{ "sWidth": "12%"}, // Queued Time
|
|
19
|
+
{ "sWidth": "25%"}, // Title
|
|
20
|
+
{ "sWidth": "11%"}, // Started At
|
|
21
|
+
{ "sWidth": "11%"}, // Finished At
|
|
22
|
+
{ "sWidth": "7%"}, // Run Time
|
|
23
|
+
{ "sWidth": "12%"}, // Affinities
|
|
24
|
+
{ "sWidth": "8%"}, // Tags
|
|
25
|
+
{ "asSorting": [ "desc" ], "sWidth": "6%" }, // Status
|
|
26
|
+
null, // Application URL
|
|
27
|
+
{ "sWidth": "6%"} // Actions
|
|
28
|
+
],
|
|
29
|
+
"fnInitComplete" : function() {
|
|
30
|
+
initPageSelect();
|
|
31
|
+
setPageOrder();
|
|
32
|
+
},
|
|
33
|
+
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
|
34
|
+
_.each(jQuery('.datatable_variable').serializeArray(), function(dv) { aoData.push(dv); });
|
|
35
|
+
jQuery.getJSON( sSource, aoData, function (json) {
|
|
36
|
+
fnCallback(json);
|
|
37
|
+
initPaging();
|
|
38
|
+
addTitles();
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
|
42
|
+
addLinkToJob(nRow, aData);
|
|
43
|
+
addLinkToTitle(nRow, aData);
|
|
44
|
+
alignmentButtons(nRow, aData);
|
|
45
|
+
colorizationStatus(nRow, aData);
|
|
46
|
+
checkTimeFormat(nRow, aData);
|
|
47
|
+
return nRow;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Setup the datatable.
|
|
52
|
+
jQuery('#datatable').addDataTable(dataTableOptions);
|
|
53
|
+
|
|
54
|
+
// Action: Terminate Job
|
|
55
|
+
jQuery(document).delegate('.terminate', "click", function(){
|
|
56
|
+
var answer = confirm("You are terminating this job. Are you sure you want to do this?");
|
|
57
|
+
if (!answer) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
var id = jQuery(this).attr('id');
|
|
61
|
+
var url = '/job_system/historical_jobs/' + id;
|
|
62
|
+
jQuery.ajax({
|
|
63
|
+
url: url,
|
|
64
|
+
type: 'POST',
|
|
65
|
+
dataType: 'json',
|
|
66
|
+
data: { "historical_job[request_to_terminate]": 1, "historical_job_id": id, "_method": "put" },
|
|
67
|
+
success:function (data) {
|
|
68
|
+
if (data.success) {
|
|
69
|
+
var title = data.title ? data.title : data.command
|
|
70
|
+
jQuery("<p id='notice'>A Job " + title + " was terminated!</p>").
|
|
71
|
+
appendTo('#flash_message').slideDown().delay(5000).slideUp();
|
|
72
|
+
jQuery('#datatable').dataTable().fnDraw();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
function addLinkToJob(nRow, aData) {
|
|
80
|
+
var id = aData[0];
|
|
81
|
+
var row = jQuery('<a href="/job_system/historical_jobs/' + id + '">' + id + '</a>' );
|
|
82
|
+
jQuery('td:nth-child(1)', nRow).empty().append(row);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function addLinkToTitle(nRow, aData) {
|
|
86
|
+
var link = aData[11];
|
|
87
|
+
var title = aData[4];
|
|
88
|
+
if ( link != "" ) {
|
|
89
|
+
var row = jQuery('<a href="' + link + '">' + title + '</a>' );
|
|
90
|
+
jQuery('td:nth-child(5)', nRow).empty().append(row);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function checkTimeFormat(nRow, aData) {
|
|
95
|
+
var start_array = aData[5].split(',');
|
|
96
|
+
var finish_array = aData[6].split(',');
|
|
97
|
+
var run_time_array = aData[7].split(',');
|
|
98
|
+
var started_at;
|
|
99
|
+
var finished_at;
|
|
100
|
+
var run_time;
|
|
101
|
+
if(jQuery('#time_format').val() == 'lexically') {
|
|
102
|
+
started_at = start_array[0];
|
|
103
|
+
finished_at = finish_array[0];
|
|
104
|
+
run_time = run_time_array[0];
|
|
105
|
+
} else {
|
|
106
|
+
started_at = start_array[1];
|
|
107
|
+
finished_at = finish_array[1];
|
|
108
|
+
run_time = run_time_array[1];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
jQuery('td:nth-child(6)', nRow).empty().append(started_at);
|
|
112
|
+
jQuery('td:nth-child(7)', nRow).empty().append(finished_at);
|
|
113
|
+
jQuery('td:nth-child(8)', nRow).empty().append(run_time);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function alignmentButtons(nRow, aData) {
|
|
117
|
+
// Action buttons
|
|
118
|
+
var data = aData[12];
|
|
119
|
+
var row;
|
|
120
|
+
if (aData[10] != "Canceled") {
|
|
121
|
+
row = "<div style='text-align:left;width:50px;display: inline;'>" + data + "</div>";
|
|
122
|
+
} else {
|
|
123
|
+
row = "<div style='text-align:left;width:50px;display: inline;padding-right: 16px;'>" + data + "</div>";
|
|
124
|
+
}
|
|
125
|
+
jQuery('td:nth-child(12)', nRow).empty().append(row);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Function that changes the color of the job status
|
|
129
|
+
function colorizationStatus(nRow, aData) {
|
|
130
|
+
jQuery('td:nth-child(11)', nRow).wrapInner('<div class="">');
|
|
131
|
+
switch(aData[10]) {
|
|
132
|
+
case 'Running':
|
|
133
|
+
jQuery('td:nth-child(11) div', nRow).addClass('script-running');
|
|
134
|
+
break;
|
|
135
|
+
case 'Queued':
|
|
136
|
+
jQuery('td:nth-child(11) div', nRow).addClass('script-queued');
|
|
137
|
+
break;
|
|
138
|
+
case 'Waiting':
|
|
139
|
+
jQuery('td:nth-child(11) div', nRow).addClass('script-queued');
|
|
140
|
+
break;
|
|
141
|
+
case 'Canceled':
|
|
142
|
+
break;
|
|
143
|
+
case 'Finished':
|
|
144
|
+
jQuery('td:nth-child(11) div', nRow).addClass('script-finished');
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
jQuery('td:nth-child(11) div', nRow).addClass('script-error');
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function setPageOrder(){
|
|
153
|
+
var status = jQuery("#search_status").val();
|
|
154
|
+
if (status == 'finished' || status == 'errored') {
|
|
155
|
+
jQuery('#datatable').dataTableSettings[0].aoColumns[10].bSortable = false;
|
|
156
|
+
jQuery('#datatable thead tr th:nth-child(11) div span').css("display", "none");
|
|
157
|
+
jQuery('#datatable').dataTable().fnSort([ [6,'desc'] ]);
|
|
158
|
+
} else {
|
|
159
|
+
jQuery('#datatable').dataTableSettings[0].aoColumns[10].bSortable = true;
|
|
160
|
+
jQuery('#datatable').dataTable().fnSort([ [10,'desc'] ]);
|
|
161
|
+
jQuery('#datatable thead tr th:nth-child(11) div span').css("display", "block");
|
|
162
|
+
}
|
|
163
|
+
}
|