naf 2.0.0 → 2.0.1

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/README.rdoc CHANGED
@@ -19,4 +19,5 @@ With a management console, providing:
19
19
 
20
20
  === Please find up-to-date information on Naf here: {Naf Wiki}[http://www.github.com/fiksu/naf/wiki]
21
21
 
22
- === Instructions on updgrading Naf to the latest Version: {Instructions}[http://www.github.com/fiksu/naf/wiki/Upgrading]
22
+ === Instructions on upgrading to Naf v1.1.4: {Instructions}[https://github.com/fiksu/naf/wiki/Upgrading-to-Naf-v1.1.4]
23
+ === Instructions on upgrading to Naf v2.0.0: {Instructions}[https://github.com/fiksu/naf/wiki/Upgrading-to-Naf-v2.0]
data/RELEASE_NOTES.rdoc CHANGED
@@ -1,5 +1,14 @@
1
1
  = Release Notes
2
2
 
3
+ === Version 2.0.0
4
+
5
+ Featurs/Changes:
6
+ * New logging system
7
+ * Removed compatibility with Papertrail
8
+ * UI changes
9
+ * Resizable table columns
10
+ * Script handles runner commands
11
+
3
12
  === Version 1.0.0
4
13
 
5
14
  Features/Changes:
@@ -35,7 +35,19 @@ module Logical::Naf
35
35
  end
36
36
 
37
37
  def retrieve_log_files_from_s3
38
- s3_log_reader.runner_log_files(record_id)
38
+ uuids = ::Naf::MachineRunner.
39
+ joins(:machine_runner_invocations).
40
+ where("#{Naf.schema_name}.machine_runners.id = ?", record_id).
41
+ pluck("#{Naf.schema_name}.machine_runner_invocations.uuid")
42
+
43
+ files = []
44
+ s3_log_reader.runner_log_files.each do |file|
45
+ if uuids.include?(file.scan(UUID_REGEX).first)
46
+ files << file
47
+ end
48
+ end
49
+
50
+ files
39
51
  end
40
52
 
41
53
  def get_invocation_id(uuid)
@@ -50,7 +62,7 @@ module Logical::Naf
50
62
  if log_type == 'old' && read_from_s3 == 'true'
51
63
  get_s3_files do
52
64
  @s3_log_reader = ::Logical::Naf::LogReader.new
53
- return s3_log_reader.runner_log_files(record_id)
65
+ return retrieve_log_files_from_s3
54
66
  end
55
67
  else
56
68
  files = Dir["#{::Naf::PREFIX_PATH}/#{::Naf.schema_name}/runners/*/*"]
@@ -20,9 +20,8 @@ module Logical
20
20
  return sort_files(files)
21
21
  end
22
22
 
23
- def runner_log_files(runner_id)
24
- @runner_id = runner_id
25
- tree = bucket.objects.with_prefix(prefix).as_tree
23
+ def runner_log_files
24
+ tree = bucket.objects.with_prefix(prefix(true)).as_tree
26
25
  directories = tree.children.select(&:branch?).collect(&:prefix).uniq
27
26
 
28
27
  files = []
@@ -58,11 +57,11 @@ module Logical
58
57
  @bucket ||= s3.buckets[NAF_BUCKET]
59
58
  end
60
59
 
61
- def prefix
62
- if @runner_id.present?
63
- "naf/#{project_name}/#{Rails.env}/#{creation_time}/#{::Naf::NAF_DATABASE_HOSTNAME}/#{::Naf::NAF_DATABASE}/#{::Naf.schema_name}/runners/#{@runner_id}/invocations/"
60
+ def prefix(runner_logs = false)
61
+ if runner_logs
62
+ "#{NAF_LOG_PATH}/#{creation_time}/#{::Naf::NAF_DATABASE_HOSTNAME}/#{::Naf::NAF_DATABASE}/#{::Naf.schema_name}/runners/"
64
63
  else
65
- "naf/#{project_name}/#{Rails.env}/#{creation_time}/#{::Naf::NAF_DATABASE_HOSTNAME}/#{::Naf::NAF_DATABASE}/#{::Naf.schema_name}/jobs/"
64
+ "#{NAF_LOG_PATH}/#{creation_time}/#{::Naf::NAF_DATABASE_HOSTNAME}/#{::Naf::NAF_DATABASE}/#{::Naf.schema_name}/jobs/"
66
65
  end
67
66
  end
68
67
 
@@ -21,7 +21,7 @@ module Process::Naf
21
21
  logger.info 'Starting to save files to s3...'
22
22
  files.each do |file|
23
23
  # Write file if not existent
24
- object = bucket.objects["naf/#{project_name}/#{Rails.env}/#{creation_time}" + file[12..-1]]
24
+ object = bucket.objects["#{NAF_LOG_PATH}/#{creation_time}" + file[12..-1]]
25
25
  if !object.exists?
26
26
  # Write file to S3
27
27
  result = object.write(File.open(file).read)
data/lib/naf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Naf
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
data/naf.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.name = "naf"
9
9
  s.version = Naf::VERSION
10
10
  s.license = 'New BSD License'
11
- s.date = '2013-12-19'
11
+ s.date = '2014-01-03'
12
12
  s.summary = "Creates infrastructure for a customizable and robust Postgres-backed script scheduling/running"
13
13
  s.description = "A cloud based distributed cron, application framework and operations console. Naf works as a distributed script running " +
14
14
  "system that provides scheduling, logging, alarming, machine redundancy, and the ability to set constraint during script execution"
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: 2.0.0
4
+ version: 2.0.1
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-19 00:00:00.000000000 Z
15
+ date: 2014-01-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails