right_chimp 2.1.13 → 2.1.14

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: 1a1bf8d5dec859eb24d0fad4003af83381f78339
4
- data.tar.gz: fdabc1c04d9aa7593bf6ca56966c31958e593361
3
+ metadata.gz: cac365e612655681144bf8e6364069c1738cc2d5
4
+ data.tar.gz: 534d04f219972cf4fe2158ec61cda670bef698b0
5
5
  SHA512:
6
- metadata.gz: 30a3fab9da5cac9f3a8401719cc1d04a9a266c262d0f7fd16fec33ce69b789ac9c4812f73bca4002da74156d7f9d0670f231a06a1a9d163b4f94bba3b14b1f5d
7
- data.tar.gz: cba737a819c688bf0a68f7c6c7ba1d9c0a7c6b62e6496ab4d46d6b3ba933770bd7454c85b7c4d8859e02faf7e84a1ed75ada587071b055b41d0ff6b07eaf5f2e
6
+ metadata.gz: df533cc2e7da178112555fcbccdf19d51a6e51333dd712909a0f3930cb8930cb815712f28895a492a3b83f4cbf8de0b6dac384643f8d58c2561515ed6c22bf3a
7
+ data.tar.gz: d77763bc9930a973c8cc5985b36bf048e284a48472040ccb72374618300b984ec729ba96f6d1fbc7c91071b6583c2138385184591ee9d0bd0b355a138f0f76cb
data/docker/Dockerfile ADDED
@@ -0,0 +1,23 @@
1
+ # Runs right_chimp (https://rubygems.org/gems/right_chimp) ruby gem from a container
2
+ ###
3
+ # Arbitrary chimp commands executed in container -or- defaults to running execution daemon ('chimpd')
4
+ # * Requires volume share with creds to /root/
5
+ # - ex1 - Execute arbitrary chimp command:
6
+ # => docker run -it -p -v ~/.rest_connection:/root/.rest_connection:ro mastamark/right_chimp:latest chimp --tag="some:tag=true" --script="MyScript"
7
+ # - ex2 - Start right_chimp daemon with docker host port 9055 bound to same container port:
8
+ # => docker run -d -p 9055:9055 -v ~/.rest_connection:/root/.rest_connection:ro mastamark/right_chimp:latest
9
+ # Send your dockerized chimp queries to your dockerized chimpd by adding flag "--chimpd=172.17.0.1:9055" (assuming this is your docker host ip) to chimp queries.
10
+ ###
11
+ # Built via: docker build -t mastamark/right_chimp:latest .
12
+ ###
13
+
14
+ FROM rightscale/ops_ruby22x_build
15
+ MAINTAINER mastamark+github@gmail.com
16
+ WORKDIR /srv
17
+ ADD right_chimp.sh /srv/
18
+
19
+ RUN gem install right_chimp --no-ri --no-rdoc
20
+
21
+ ENTRYPOINT ["/srv/right_chimp.sh"]
22
+ CMD ["chimpd"]
23
+ EXPOSE 9055
@@ -0,0 +1,22 @@
1
+ #!/bin/bash
2
+ # Entrypoint script for dockerized right_chimp
3
+
4
+ first_arg=$1
5
+ operation=$*
6
+
7
+ case "$first_arg" in
8
+ chimpd)
9
+ chimp_operation="$operation --bind-address=0.0.0.0"
10
+ echo "Executing chimpd operation: '$chimp_operation'"
11
+ $chimp_operation
12
+ ;;
13
+ chimp)
14
+ chimp_operation="$operation"
15
+ echo "Executing chimp operation: '$chimp_operation'"
16
+ $chimp_operation
17
+ ;;
18
+ *)
19
+ echo "Error: Requested operation '$operation' does not appear to be a 'chimp' or 'chimpd' operation"
20
+ exit 1
21
+ ;;
22
+ esac
@@ -414,7 +414,14 @@ module Chimp
414
414
  exit 0
415
415
  when '--chimpd'
416
416
  @use_chimpd = true
417
- @chimpd_port = arg.to_i unless arg.empty?
417
+ unless arg.empty?
418
+ if arg =~ /[\d]+\.[\d]+\.[\d]+\.[\d]+:[\d]+/
419
+ @chimpd_host, @chimpd_port = arg.split(':')
420
+ @chimpd_port = @chimpd_port.to_i
421
+ else
422
+ @chimpd_port = arg.to_i
423
+ end
424
+ end
418
425
  when '--chimpd-wait-until-done'
419
426
  @use_chimpd = true
420
427
  @chimpd_wait_until_done = true
@@ -8,7 +8,8 @@ module Chimp
8
8
  class ChimpDaemon
9
9
 
10
10
  attr_accessor :verbose, :debug, :port, :concurrency, :delay, :retry_count,
11
- :dry_run, :logfile, :chimp_queue, :proc_counter, :semaphore
11
+ :dry_run, :logfile, :chimp_queue, :proc_counter, :semaphore,
12
+ :bind_address
12
13
  attr_reader :queue, :running
13
14
 
14
15
  include Singleton
@@ -17,6 +18,7 @@ module Chimp
17
18
  @verbose = false
18
19
  @debug = false
19
20
  @port = 9055
21
+ @bind_address = "localhost"
20
22
  @concurrency = 50
21
23
  @delay = 0
22
24
  @retry_count = 0
@@ -60,6 +62,7 @@ module Chimp
60
62
  [ '--delay', '-d', GetoptLong::REQUIRED_ARGUMENT ],
61
63
  [ '--retry', '-y', GetoptLong::REQUIRED_ARGUMENT ],
62
64
  [ '--port', '-p', GetoptLong::REQUIRED_ARGUMENT ],
65
+ [ '--bind-address', '-b', GetoptLong::REQUIRED_ARGUMENT ],
63
66
  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
64
67
  [ '--exit', '-x', GetoptLong::NO_ARGUMENT ]
65
68
  )
@@ -81,6 +84,8 @@ module Chimp
81
84
  @quiet = true
82
85
  when '--port', '-p'
83
86
  @port = arg
87
+ when '--bind-address', '-b'
88
+ @bind_address = arg.to_s
84
89
  when '--help', '-h'
85
90
  help
86
91
  when '--exit', '-x'
@@ -90,7 +95,7 @@ module Chimp
90
95
  end
91
96
  end
92
97
  rescue GetoptLong::InvalidOption => ex
93
- puts "Syntax: chimpd [--logfile=<name>] [--concurrency=<c>] [--delay=<d>] [--retry=<r>] [--port=<p>] [--verbose]"
98
+ puts "Syntax: chimpd [--logfile=<name>] [--concurrency=<c>] [--delay=<d>] [--retry=<r>] [--port=<p>] [--bind-address=<addr> ] [--verbose]"
94
99
  exit 1
95
100
  end
96
101
 
@@ -119,7 +124,7 @@ module Chimp
119
124
  puts
120
125
  puts "chimpd -- a RightScale Platform command-line tool"
121
126
  puts
122
- puts "Syntax: chimpd [--logfile=<name>] [--concurrency=<c>] [--delay=<d>] [--retry=<r>] [--port=<p>] [--verbose]"
127
+ puts "Syntax: chimpd [--logfile=<name>] [--concurrency=<c>] [--delay=<d>] [--retry=<r>] [--port=<p>] [--bind-address=<addr> ] [--verbose]"
123
128
  puts
124
129
  puts "Options:"
125
130
  puts
@@ -132,6 +137,7 @@ module Chimp
132
137
  puts " --quiet Supress non-essential output"
133
138
  puts
134
139
  puts " --port=<port> Specify the port number for chimpd to listen on (default: 9055)"
140
+ puts " --bind-address=<addr> Specify an interface address for chimpd to bind to. 0.0.0.0 allows all, default is 'localhost'"
135
141
  puts
136
142
  puts " --help Displays this menu"
137
143
  puts
@@ -154,7 +160,7 @@ module Chimp
154
160
  #
155
161
  def spawn_webserver
156
162
  opts = {
157
- :BindAddress => "localhost",
163
+ :BindAddress => @bind_address,
158
164
  :Port => @port,
159
165
  :MaxClients => 500,
160
166
  :RequestTimeout => 120,
@@ -1,3 +1,3 @@
1
1
  module Chimp
2
- VERSION = "2.1.13"
2
+ VERSION = "2.1.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_chimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.13
4
+ version: 2.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - RightScale Operations
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2016-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -142,6 +142,8 @@ files:
142
142
  - bin/chimp
143
143
  - bin/chimpd
144
144
  - chimp.gemspec
145
+ - docker/Dockerfile
146
+ - docker/right_chimp.sh
145
147
  - lib/right_chimp.rb
146
148
  - lib/right_chimp/Chimp.rb
147
149
  - lib/right_chimp/IDManager.rb