robot_sweatshop 0.4.13 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08cbf83ffc230f92b481c9bd3e050e30c8b2a771
4
- data.tar.gz: 3945c41f5f694828ad9651c18e6e8d33e761f0b8
3
+ metadata.gz: 8e497e652596a13ab375886a0c9adfdbd6e5c33f
4
+ data.tar.gz: f6b1e12c4b42f20cdb391ee838600b537404244c
5
5
  SHA512:
6
- metadata.gz: b0c61a1c671dd53bf48c3aa723cc78b41266817492bc49312d2bdc1cb216491c2f2b597e83659e1ee9479519af92de3d3c207a60f536cd5f8dcebdaf04899195
7
- data.tar.gz: 10fa29c67fc744705d541c7846bda2882529c7cf79279838e6c3028ba6795f6cecba7633d5d390efda31483a7db5dcaa5b16515bb18319a331575f871027b27b
6
+ metadata.gz: c3e21f54d698b659bf86d0f07a699d2213d9b65450b101b5c4e1827483c4319e4f5b572f420ccd76897fe6d0e165a3549816143e9b262462153ed75248f335f0
7
+ data.tar.gz: 21556cc53d23695339f8d67d7dc7188a0ee2ce5848f9e4c9237d1e3161202c5b4089d1234bdb899744a2934408f19a3e2dea80a6270f6f58533ad5af0e8644da
data/CHANGELOG.md CHANGED
@@ -1,11 +1,22 @@
1
1
  # Change Log
2
- All notable changes to this project will be documented in this file.
3
- This project adheres to [Semantic Versioning](http://semver.org/).
2
+ All notable changes to this project will be documented in this file as specified by [http://keepachangelog.com/](http://keepachangelog.com/). This project adheres to [Semantic Versioning](http://semver.org/).
4
3
 
5
- ## [Unreleased][unreleased]
4
+ ## [Unreleased] - unreleased
5
+
6
+ ## [1.0.0] - 2015-08-10
6
7
  ### Added
7
8
  - Multiple worker support
8
9
 
10
+ ### Changed
11
+ - `sweatshop configure` takes a `--user` flag instead of looking for string arguments
12
+ - `sweatshop config` renamed `sweatshop configure`
13
+ - `sweatshop job` renamed `sweatshop plan`
14
+
15
+ ## [0.4.13] - 2015-07-31
16
+ ### Added
17
+ - Logging over ZMQ
18
+ - The Logger process to write files and reflect messages
19
+
9
20
  ## [0.4.12] - 2015-07-14
10
21
  ### Fixed
11
22
  - Config erroring out if you don't have a home path
data/FUTURE.md ADDED
@@ -0,0 +1,6 @@
1
+ - Mascot/logo
2
+ - Use something appropriate than TCP for ZMQ connections
3
+ - Jenkins-to-Sweatshop job converting script
4
+ - Take a look at beefcake for data versioning/serialization
5
+ - CLI configuration via chomp and/or flags
6
+ - Use [eye-http](https://github.com/kostya/eye-http) somewhere?
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- robot_sweatshop (0.4.12)
4
+ robot_sweatshop (0.4.13)
5
5
  commander
6
6
  configatron
7
7
  contracts
data/README.md CHANGED
@@ -11,7 +11,7 @@ Robot Sweatshop is a single-purpose CI server that runs collections of arbitrary
11
11
  - install [ZMQ as described in the EZMQ gem](https://github.com/colstrom/ezmq#operating-system-notes)
12
12
  - `gem install robot_sweatshop`
13
13
  - `sweatshop start`
14
- - `sweatshop job example --auto`
14
+ - `sweatshop plan example --auto`
15
15
  - `curl -d '' localhost:10555/run/example`
16
16
  - `cat .robot_sweatshop/log/worker.log`
17
17
 
@@ -43,24 +43,3 @@ By default, Robot Sweatshop looks in your current working path to configure and
43
43
  ## Security
44
44
 
45
45
  You probably don't want to run Robot Sweatshop as a sudo user. Create a testing user and group and run `sweatshop start` as them.
46
-
47
- ## Roadmap
48
-
49
- 1.0
50
-
51
- - Mascot/logo
52
-
53
- 1.1
54
-
55
- - Use something appropriate than TCP for ZMQ connections
56
- - Easier way to run multiple workers
57
- - Push/pull out node that worker streams output to
58
- - Add worker tags to output so it can all go to one file
59
-
60
- Beyond
61
-
62
- - Jenkins-to-Sweatshop job converting script
63
- - Take a look at beefcake for data versioning/serialization
64
- - Better logging for the processes
65
- - CLI configuration via chomp and/or flags
66
- - Use [eye-http](https://github.com/kostya/eye-http) for the '/' route?
data/bin/sweatshop CHANGED
@@ -7,12 +7,12 @@ require 'robot_sweatshop/config'
7
7
  require 'robot_sweatshop/create-config-directories'
8
8
 
9
9
  program :name, 'Robot Sweatshop'
10
- program :version, '0.4.13'
10
+ program :version, '1.0.0'
11
11
  program :description, 'A lightweight, nonopinionated CI server'
12
12
  program :help, 'Author', 'Justin Scott <jvscott@gmail.com>'
13
13
 
14
- command :job do |c|
15
- c.syntax = 'sweatshop job <name>'
14
+ command :plan do |c|
15
+ c.syntax = 'sweatshop plan <name>'
16
16
  c.description = 'Creates and edits jobs.'
17
17
  c.option '--auto', 'Create the file without opening the editor.'
18
18
  c.action do |args, options|
@@ -24,22 +24,15 @@ command :job do |c|
24
24
  end
25
25
  end
26
26
 
27
- command :'job-list' do |c|
28
- c.syntax = 'sweatshop job-list'
29
- c.description = 'Lists available job configurations.'
30
- c.action do
31
- CLI::Job.list
32
- end
33
- end
34
-
35
- command :config do |c|
36
- c.syntax = 'sweatshop config [options]'
37
- c.description = 'Creates and edits the user configuration file.'
27
+ command :configure do |c|
28
+ c.syntax = 'sweatshop configure [options]'
29
+ c.description = 'Creates and edits the configuration file.'
38
30
  c.option '--auto', 'Create the file without opening the editor.'
31
+ c.option '--user', 'Create the file in the user\'s home directory instead of in the local path.'
39
32
  c.action do |args, options|
40
33
  options.default auto: false
41
- for_scope = args.first || 'local'
42
- config_file = CLI::Config.path for_scope
34
+ options.default user: false
35
+ config_file = CLI::Config.path for_user: options.user
43
36
  CLI.create config_file, with_contents: CLI::Config.default
44
37
  CLI.edit config_file unless options.auto
45
38
  end
data/config.defaults.yaml CHANGED
@@ -17,3 +17,4 @@ logger_port: 10560
17
17
  reflector_port: 10561
18
18
  api_url: http://localhost:10555
19
19
  job_timeout_length: 300 # 5 minutes
20
+ worker_count: 1
data/docs/README.md CHANGED
@@ -72,6 +72,19 @@ PUSH {
72
72
  }
73
73
  ```
74
74
 
75
+ ## logger
76
+
77
+ ```
78
+ PUB {
79
+ text String
80
+ process String
81
+ user String
82
+ host String
83
+ }
84
+ ```
85
+
75
86
  # Notes
76
87
 
77
88
  Context is passed around with string keys because it's user provided. Everything else is passed with symbol keys
89
+
90
+ Anything published to the logger will be republished to the reflector port
@@ -1,5 +1,5 @@
1
1
  digraph architecture {
2
- label="Robot Sweatshop process interaction"
2
+ label="Robot Sweatshop process interaction\n(Logger not shown)\n "
3
3
  labelloc="top"
4
4
 
5
5
  overseer [label="Overseer",shape=box]
Binary file
@@ -8,8 +8,8 @@ module CLI
8
8
  File.read "#{__dir__}/../../../config.defaults.yaml"
9
9
  end
10
10
 
11
- def self.path(scope)
12
- if scope == 'user'
11
+ def self.path(for_user: false)
12
+ if for_user
13
13
  '~/.robot_sweatshop/config.yaml'
14
14
  else
15
15
  '.robot_sweatshop/config.yaml'
@@ -1,6 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
- # TODO: per-user temp file
4
3
  CONFIG_PATH = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
5
4
  CONFIG = YAML.load_file CONFIG_PATH
6
5
  PID_PATH = CONFIG[:pidfile_path]
@@ -17,44 +16,49 @@ Eye.application :robot_sweatshop do
17
16
  group 'services' do
18
17
  process :job_dictionary do
19
18
  pid_file "#{PID_PATH}/job-dictionary.pid"
20
- start_command "#{__dir__}/bin/sweatshop-job-dictionary"
19
+ start_command "sweatshop-job-dictionary"
21
20
  daemonize true
22
21
  end
23
22
  process :payload_parser do
24
23
  pid_file "#{PID_PATH}/payload-parser.pid"
25
- start_command "#{__dir__}/bin/sweatshop-payload-parser"
24
+ start_command "sweatshop-payload-parser"
26
25
  daemonize true
27
26
  end
28
27
  process :conveyor do
29
28
  pid_file "#{PID_PATH}/conveyor.pid"
30
- start_command "#{__dir__}/bin/sweatshop-conveyor"
29
+ start_command "sweatshop-conveyor"
31
30
  daemonize true
32
31
  end
33
32
  end
34
33
 
34
+ group 'workers' do
35
+ <% worker_count.times do |index| %>
36
+ process :worker_<%= index+1 %> do
37
+ pid_file "#{PID_PATH}/worker_<%= index+1 %>.pid"
38
+ start_command "sweatshop-worker <%= index+1 %>"
39
+ daemonize true
40
+ end
41
+ <% end %>
42
+ end
43
+
35
44
  process :overseer do
36
45
  pid_file "#{PID_PATH}/overseer.pid"
37
- start_command "#{__dir__}/bin/sweatshop-overseer"
46
+ start_command "sweatshop-overseer"
38
47
  daemonize true
39
48
  end
40
49
  process :api do
41
50
  pid_file "#{PID_PATH}/api.pid"
42
- start_command "#{__dir__}/bin/sweatshop-api"
51
+ start_command "sweatshop-api"
43
52
  daemonize true
44
53
  end
45
54
  process :assembler do
46
55
  pid_file "#{PID_PATH}/assembler.pid"
47
- start_command "#{__dir__}/bin/sweatshop-assembler"
48
- daemonize true
49
- end
50
- process :worker do
51
- pid_file "#{PID_PATH}/worker.pid"
52
- start_command "#{__dir__}/bin/sweatshop-worker"
56
+ start_command "sweatshop-assembler"
53
57
  daemonize true
54
58
  end
55
59
  process :logger do
56
60
  pid_file "#{PID_PATH}/logger.pid"
57
- start_command "#{__dir__}/bin/sweatshop-logger"
61
+ start_command "sweatshop-logger"
58
62
  daemonize true
59
63
  end
60
64
  end
@@ -1,18 +1,34 @@
1
1
  require 'yaml'
2
2
  require 'terminal-announce'
3
3
  require 'robot_sweatshop/config'
4
+ require 'erubis'
4
5
 
5
6
  module CLI
6
7
  # Methods for starting Robot Sweatshop
7
8
  module Start
8
9
  def self.sweatshop
10
+ Announce.info `eye stop robot_sweatshop:workers`
11
+ load_eye_config
12
+ Announce.info `eye restart robot_sweatshop`
13
+ end
14
+
15
+ def self.load_eye_config
9
16
  Config.compile_to_file
10
- eye_config = File.expand_path "#{__dir__}/../../../robot_sweatshop.eye"
11
- output = `eye load #{eye_config}`
17
+ output = `eye load #{generate_eye_config}`
12
18
  fail output if $?.exitstatus != 0
13
19
  Announce.success "Robot Sweatshop loaded"
14
- Announce.info `eye restart robot_sweatshop`
15
20
  Announce.info 'Run \'eye --help\' for more info on debugging'
16
21
  end
22
+
23
+ def self.generate_eye_config
24
+ template = File.read "#{__dir__}/robot_sweatshop.eye.erb"
25
+ eruby = Erubis::Eruby.new template
26
+ compiled_config = eruby.result worker_count: configatron.worker_count
27
+ compiled_config_file = File.expand_path '~/.robot_sweatshop/robot_sweatshop.eye'
28
+ File.open compiled_config_file, 'w' do |file|
29
+ file.write compiled_config
30
+ file.path
31
+ end
32
+ end
17
33
  end
18
34
  end
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'robot_sweatshop'
3
- gem.version = '0.4.13'
3
+ gem.version = '1.0.0'
4
4
  gem.licenses = 'MIT'
5
5
  gem.authors = ['Justin Scott']
6
6
  gem.email = 'jvscott@gmail.com'
7
- gem.homepage = 'http://www.github.com/jscott/robot_sweatshop/'
7
+ gem.homepage = 'http://robotsweat.com'
8
8
  gem.summary = 'Robot Sweatshop'
9
9
  gem.description = 'A lightweight, nonopinionated CI server.'
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot_sweatshop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.13
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Scott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-01 00:00:00.000000000 Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faker
@@ -280,6 +280,7 @@ files:
280
280
  - ".gitignore"
281
281
  - ".rubocop.yml"
282
282
  - CHANGELOG.md
283
+ - FUTURE.md
283
284
  - Gemfile
284
285
  - Gemfile.lock
285
286
  - LICENSE
@@ -303,6 +304,7 @@ files:
303
304
  - lib/robot_sweatshop/cli/common.rb
304
305
  - lib/robot_sweatshop/cli/config.rb
305
306
  - lib/robot_sweatshop/cli/job.rb
307
+ - lib/robot_sweatshop/cli/robot_sweatshop.eye.erb
306
308
  - lib/robot_sweatshop/cli/start.rb
307
309
  - lib/robot_sweatshop/config.rb
308
310
  - lib/robot_sweatshop/connections.rb
@@ -316,7 +318,6 @@ files:
316
318
  - lib/robot_sweatshop/templates/default_job.yaml
317
319
  - lib/robot_sweatshop/templates/index.html.eruby
318
320
  - lib/robot_sweatshop/templates/log.html.eruby
319
- - robot_sweatshop.eye
320
321
  - robot_sweatshop.gemspec
321
322
  - test/README.md
322
323
  - test/all.rb
@@ -343,7 +344,7 @@ files:
343
344
  - test/shared/scaffolding.rb
344
345
  - test/shared/stub.rb
345
346
  - test/worker_spec.rb
346
- homepage: http://www.github.com/jscott/robot_sweatshop/
347
+ homepage: http://robotsweat.com
347
348
  licenses:
348
349
  - MIT
349
350
  metadata: {}