scout-gear 10.7.3 → 10.7.5

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -4
  3. data/.vimproject +3 -14
  4. data/Rakefile +1 -4
  5. data/VERSION +1 -1
  6. data/bin/scout +15 -2
  7. data/lib/scout/association/index.rb +1 -1
  8. data/lib/scout/association.rb +5 -2
  9. data/lib/scout/entity/identifiers.rb +5 -2
  10. data/lib/scout/entity/property.rb +2 -3
  11. data/lib/scout/knowledge_base/entity.rb +12 -3
  12. data/lib/scout/knowledge_base/registry.rb +3 -1
  13. data/lib/scout/persist/engine/tokyocabinet.rb +85 -77
  14. data/lib/scout/persist/tsv/adapter/base.rb +8 -22
  15. data/lib/scout/tsv/change_id/translate.rb +8 -2
  16. data/lib/scout/tsv/open.rb +2 -0
  17. data/lib/scout/tsv/parser.rb +10 -0
  18. data/lib/scout/tsv/transformer.rb +12 -0
  19. data/lib/scout/tsv/util/process.rb +2 -2
  20. data/lib/scout/workflow/definition.rb +6 -2
  21. data/lib/scout/workflow/deployment/trace.rb +1 -1
  22. data/lib/scout/workflow/entity.rb +99 -0
  23. data/lib/scout/workflow/export.rb +66 -0
  24. data/lib/scout/workflow/step/dependencies.rb +3 -6
  25. data/lib/scout/workflow/step/file.rb +3 -3
  26. data/lib/scout/workflow/step/info.rb +12 -2
  27. data/lib/scout/workflow/step/provenance.rb +1 -2
  28. data/lib/scout/workflow/step/status.rb +1 -0
  29. data/lib/scout/workflow/step.rb +5 -3
  30. data/lib/scout/workflow/task/info.rb +99 -0
  31. data/lib/scout/workflow/task/inputs.rb +2 -1
  32. data/lib/scout/workflow/task.rb +1 -0
  33. data/lib/scout/workflow.rb +4 -2
  34. data/lib/scout-gear.rb +5 -1
  35. data/scout-gear.gemspec +10 -19
  36. data/scout_commands/doc +3 -3
  37. data/scout_commands/workflow/task +7 -2
  38. data/test/scout/knowledge_base/test_list.rb +4 -4
  39. data/test/scout/knowledge_base/test_registry.rb +19 -0
  40. data/test/scout/persist/test_tsv.rb +1 -0
  41. data/test/scout/test_association.rb +15 -0
  42. data/test/scout/test_tsv.rb +15 -0
  43. data/test/scout/tsv/test_parser.rb +4 -0
  44. data/test/scout/tsv/test_transformer.rb +13 -0
  45. data/test/scout/workflow/step/test_info.rb +11 -0
  46. data/test/scout/workflow/task/test_dependencies.rb +7 -7
  47. data/test/scout/workflow/task/test_info.rb +22 -0
  48. data/test/scout/workflow/test_definition.rb +2 -2
  49. data/test/scout/workflow/test_entity.rb +58 -0
  50. data/test/scout/workflow/test_step.rb +1 -1
  51. metadata +10 -61
  52. data/lib/scout/offsite/exceptions.rb +0 -9
  53. data/lib/scout/offsite/ssh.rb +0 -175
  54. data/lib/scout/offsite/step.rb +0 -100
  55. data/lib/scout/offsite/sync.rb +0 -55
  56. data/lib/scout/offsite.rb +0 -3
  57. data/scout_commands/offsite +0 -30
  58. data/test/scout/offsite/test_ssh.rb +0 -15
  59. data/test/scout/offsite/test_step.rb +0 -32
  60. data/test/scout/offsite/test_sync.rb +0 -36
  61. data/test/scout/offsite/test_task.rb +0 -0
  62. data/test/scout/test_offsite.rb +0 -0
@@ -1,55 +0,0 @@
1
- class SSHLine
2
- def self.locate(server, paths, map: :user)
3
- SSHLine.scout server, <<-EOF
4
- map = :#{map}
5
- paths = [#{paths.collect{|p| "'" + p + "'" } * ", " }]
6
- located = paths.collect{|p| Path.setup(p).find(map) }
7
- identified = paths.collect{|p| Resource.identify(p) }
8
- [located, identified]
9
- EOF
10
- end
11
-
12
- def self.rsync(source_path, target_path, directory: false, source: nil, target: nil, dry_run: false, hard_link: false)
13
- rsync_args = "-avztHP --copy-unsafe-links --omit-dir-times "
14
-
15
- rsync_args << "--link-dest '#{source_path}' " if hard_link && ! source
16
-
17
- source_path = source_path + "/" if directory && ! source_path.end_with?("/")
18
- target_path = target_path + "/" if directory && ! target_path.end_with?("/")
19
- if target
20
- SSHLine.mkdir target, File.dirname(target_path)
21
- else
22
- Open.mkdir(File.dirname(target_path))
23
- end
24
-
25
- cmd = 'rsync '
26
- cmd << rsync_args
27
- cmd << '-nv ' if dry_run
28
- cmd << (source ? [source, source_path] * ":" : source_path) << " "
29
- cmd << (target ? [target, target_path] * ":" : target_path) << " "
30
-
31
- CMD.cmd_log(cmd, :log => Log::HIGH)
32
- end
33
-
34
- def self.sync(paths, source: nil, target: nil, map: :user, **kwargs)
35
- source = nil if source == 'localhost'
36
- target = nil if target == 'localhost'
37
-
38
- if source
39
- source_paths, identified_paths = SSHLine.locate(source, paths)
40
- else
41
- source_paths = paths.collect{|p| Path === p ? p.find : p }
42
- identified_paths = paths.collect{|p| Resource.identify(p) }
43
- end
44
-
45
- if target
46
- target_paths = SSHLine.locate(target, identified_paths, map: map)
47
- else
48
- target_paths = identified_paths.collect{|p| p.find(map) }
49
- end
50
-
51
- source_paths.zip(target_paths).each do |source_path,target_path|
52
- rsync(source_path, target_path, source: source, target: target, **kwargs)
53
- end
54
- end
55
- end
data/lib/scout/offsite.rb DELETED
@@ -1,3 +0,0 @@
1
- require_relative 'offsite/ssh'
2
- require_relative 'offsite/step'
3
- require_relative 'offsite/sync'
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'scout'
4
- require 'scout/offsite'
5
-
6
- $0 = "scout #{$previous_commands.any? ? $previous_commands*" " + " " : "" }#{ File.basename(__FILE__) }" if $previous_commands
7
-
8
- options = SOPT.setup <<EOF
9
-
10
- Description of the tool
11
-
12
- $ #{$0} [<options>] <where> <command> ... -- [<protected options>]
13
-
14
- Run a command offsite. Use -- to make sure options reach the offsite
15
-
16
- -h--help Print this help
17
- EOF
18
- if options[:help]
19
- if defined? scout_usage
20
- scout_usage
21
- else
22
- puts SOPT.doc
23
- end
24
- exit 0
25
- end
26
-
27
- where = ARGV.shift
28
- command = ARGV.shift
29
-
30
- puts SSHLine.command(where, command, ARGV)
@@ -1,15 +0,0 @@
1
- require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
- require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
-
4
- class TestSSH < Test::Unit::TestCase
5
- def test_marshal
6
- return unless SSHLine.reach?
7
-
8
- assert TrueClass === SSHLine.scout(:default, 'true')
9
- end
10
-
11
- def test_localhost
12
- assert SSHLine.scout('localhost', 'true')
13
- end
14
- end
15
-
@@ -1,32 +0,0 @@
1
- require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
- require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
-
4
- class TestOffsiteStep < Test::Unit::TestCase
5
- def test_offsite_task
6
- workflow_code =<<-EOF
7
- module TestWF
8
- extend Workflow
9
-
10
- input :string, :string, "String", "string"
11
- task :string => :string do |string| string end
12
- end
13
-
14
- TestWF.directory = Path.setup("#{tmpdir.offsite.TestWF}")
15
- EOF
16
-
17
- TmpFile.with_file workflow_code, :extension => 'rb' do |wffile|
18
- wf = Workflow.require_workflow wffile
19
-
20
- job = wf.job(:string)
21
-
22
- off = OffsiteStep.setup job, server: 'localhost', workflow_name: wffile
23
-
24
- refute off.done?
25
- assert_equal 'string', off.run
26
-
27
- assert off.done?
28
- assert_equal 'string', off.run
29
- end
30
- end
31
- end
32
-
@@ -1,36 +0,0 @@
1
- require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
2
- require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
3
-
4
- class TestSync < Test::Unit::TestCase
5
- def test_sync
6
- TmpFile.with_path do |tmpdir|
7
- tmpdir = Scout.tmp.tmpdir_sync
8
- tmpdir.dir1.foo.write("FOO")
9
- tmpdir.dir1.bar.write("BAR")
10
-
11
- TmpFile.with_path do |tmpdir2|
12
- Misc.in_dir tmpdir2 do
13
- SSHLine.sync([tmpdir.dir1], map: :current)
14
-
15
- assert tmpdir2.glob("**/*").select{|f| f.include?('foo') }.any?
16
- end
17
- end
18
- end
19
- end
20
-
21
- def test_sync_dir_map
22
- TmpFile.with_path do |tmpdir|
23
- tmpdir = Scout.tmp.tmpdir_sync
24
- tmpdir.dir1.foo.write("FOO")
25
- tmpdir.dir1.bar.write("BAR")
26
-
27
- TmpFile.with_path do |tmpdir2|
28
- SSHLine.sync([tmpdir.dir1], map: tmpdir2)
29
- Misc.in_dir tmpdir2 do
30
- assert tmpdir2.glob("**/*").select{|f| f.include?('foo') }.any?
31
- end
32
- end
33
- end
34
- end
35
- end
36
-
File without changes
File without changes