iron_worker_ng 1.3.0 → 1.4.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 +4 -4
- data/README.md +26 -0
- data/bin/iron_worker +5 -2
- data/lib/iron_worker_ng/api_client.rb +4 -0
- data/lib/iron_worker_ng/cli.rb +6 -0
- data/lib/iron_worker_ng/client.rb +5 -0
- data/lib/iron_worker_ng/code/base.rb +9 -2
- data/lib/iron_worker_ng/code/runtime/binary.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/go.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/java.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/mono.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/node.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/perl.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/php.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/python.rb +2 -2
- data/lib/iron_worker_ng/code/runtime/ruby.rb +2 -2
- data/lib/iron_worker_ng/version.rb +1 -1
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85db46574b1c476ce867a7ca7a911fc82214e8a5
|
4
|
+
data.tar.gz: 51df9666082d05c5c52792661002ee1989e9cf03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e4fa53b7adb5072f254a7d0ed107cfc91ac9ebae29180bec6d9d9ec8474115d30760dcaea1a596492c853e5ea14c3f586c793a5b6b4118f7b34c362378a5294
|
7
|
+
data.tar.gz: db9e43bf9d46b5c482f0b671b162747c49d198ae195c943f04f3383acb79468ed022277d816e357559b9d953670af4037d4ea1c4767f3549c56fd83ddd66da3b
|
data/README.md
CHANGED
@@ -411,6 +411,32 @@ for as many tasks as you want.
|
|
411
411
|
client.tasks.create('MyWorker', {:client => 'Joe'})
|
412
412
|
```
|
413
413
|
|
414
|
+
# Stacks
|
415
|
+
Stack is a docker image based on ubuntu + some custom software(ruby/python/mono/java...)
|
416
|
+
You can use different stacks to launch your tasks.
|
417
|
+
To get list of available stacks you could do:
|
418
|
+
|
419
|
+
```ruby
|
420
|
+
client.stacks_list
|
421
|
+
```
|
422
|
+
|
423
|
+
or using cli
|
424
|
+
|
425
|
+
```sh
|
426
|
+
iron_worker stacks
|
427
|
+
```
|
428
|
+
|
429
|
+
And to specify stack add following line in your .worker file
|
430
|
+
|
431
|
+
```ruby
|
432
|
+
# define the runtime language, this can be ruby, java, node, php, go, etc.
|
433
|
+
runtime 'binary'
|
434
|
+
stack 'java-1.7'
|
435
|
+
exec 'java.sh'
|
436
|
+
```
|
437
|
+
|
438
|
+
|
439
|
+
|
414
440
|
# The Rest of the IronWorker API
|
415
441
|
|
416
442
|
## IronWorker::Client
|
data/bin/iron_worker
CHANGED
@@ -41,7 +41,7 @@ if $*.size == 1 && ($*[0] == '-v' || $*[0] == '--version')
|
|
41
41
|
exit 0
|
42
42
|
end
|
43
43
|
|
44
|
-
commands = ['upload', 'patch', 'queue', 'retry', 'schedule', 'log', 'run', 'install', 'webhook', 'info']
|
44
|
+
commands = ['upload', 'patch', 'queue', 'retry', 'schedule', 'log', 'run', 'install', 'webhook', 'info', 'stacks']
|
45
45
|
|
46
46
|
if $*.size == 0 || (not commands.include?($*[0]))
|
47
47
|
puts 'usage: iron_worker COMMAND [OPTIONS]'
|
@@ -445,4 +445,7 @@ elsif command == 'info'
|
|
445
445
|
|
446
446
|
@cli.info_schedule($*[0], params, options)
|
447
447
|
end
|
448
|
-
|
448
|
+
|
449
|
+
elsif command == 'stacks'
|
450
|
+
@cli.stacks_list
|
451
|
+
end
|
data/lib/iron_worker_ng/cli.rb
CHANGED
@@ -24,6 +24,7 @@ module IronWorkerNG
|
|
24
24
|
attr_accessor :zip_package
|
25
25
|
|
26
26
|
attr_accessor :use_local_iron_worker_ng
|
27
|
+
attr_accessor :fix_params
|
27
28
|
|
28
29
|
undef exec
|
29
30
|
undef gem
|
@@ -216,7 +217,7 @@ module IronWorkerNG
|
|
216
217
|
def runtime_bundle(container, local = false)
|
217
218
|
end
|
218
219
|
|
219
|
-
def runtime_run_code(local
|
220
|
+
def runtime_run_code(local, params)
|
220
221
|
''
|
221
222
|
end
|
222
223
|
|
@@ -226,6 +227,12 @@ module IronWorkerNG
|
|
226
227
|
end
|
227
228
|
|
228
229
|
if local || ((not remote_build_command) && (not full_remote_build))
|
230
|
+
params = "\"$@\""
|
231
|
+
|
232
|
+
if @fix_params
|
233
|
+
params="-`echo \"$@\" | sed \"s/ -/ --/g\"`"
|
234
|
+
end
|
235
|
+
|
229
236
|
container.get_output_stream(@dest_dir + '__runner__.sh') do |runner|
|
230
237
|
runner.write <<RUNNER
|
231
238
|
#!/bin/sh
|
@@ -252,7 +259,7 @@ export PATH
|
|
252
259
|
|
253
260
|
#{container.runner_additions}
|
254
261
|
|
255
|
-
#{runtime_run_code(local)}
|
262
|
+
#{runtime_run_code(local, params)}
|
256
263
|
RUNNER
|
257
264
|
end
|
258
265
|
|
@@ -4,11 +4,11 @@ module IronWorkerNG
|
|
4
4
|
module Binary
|
5
5
|
include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods
|
6
6
|
|
7
|
-
def runtime_run_code(local
|
7
|
+
def runtime_run_code(local, params)
|
8
8
|
<<RUN_CODE
|
9
9
|
chmod +x #{File.basename(@exec.path)}
|
10
10
|
|
11
|
-
#{File.basename(@exec.path)}
|
11
|
+
#{File.basename(@exec.path)} #{params}
|
12
12
|
RUN_CODE
|
13
13
|
end
|
14
14
|
end
|
@@ -4,9 +4,9 @@ module IronWorkerNG
|
|
4
4
|
module Go
|
5
5
|
include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods
|
6
6
|
|
7
|
-
def runtime_run_code(local
|
7
|
+
def runtime_run_code(local, params)
|
8
8
|
<<RUN_CODE
|
9
|
-
go run #{File.basename(@exec.path)}
|
9
|
+
go run #{File.basename(@exec.path)} #{params}
|
10
10
|
RUN_CODE
|
11
11
|
end
|
12
12
|
end
|
@@ -7,7 +7,7 @@ module IronWorkerNG
|
|
7
7
|
include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods
|
8
8
|
include IronWorkerNG::Feature::Java::MergeJar::InstanceMethods
|
9
9
|
|
10
|
-
def runtime_run_code(local
|
10
|
+
def runtime_run_code(local, params)
|
11
11
|
classpath_array = []
|
12
12
|
|
13
13
|
classpath_array << @exec.path
|
@@ -23,7 +23,7 @@ module IronWorkerNG
|
|
23
23
|
IronCore::Logger.info 'IronWorkerNG', "Collected '#{classpath}' classpath"
|
24
24
|
|
25
25
|
<<RUN_CODE
|
26
|
-
java -cp #{classpath} #{@exec.arg(:class, 0).nil? ? "-jar #{File.basename(@exec.path)}" : @exec.arg(:class, 0)}
|
26
|
+
java -cp #{classpath} #{@exec.arg(:class, 0).nil? ? "-jar #{File.basename(@exec.path)}" : @exec.arg(:class, 0)} #{params}
|
27
27
|
RUN_CODE
|
28
28
|
end
|
29
29
|
end
|
@@ -4,9 +4,9 @@ module IronWorkerNG
|
|
4
4
|
module Mono
|
5
5
|
include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods
|
6
6
|
|
7
|
-
def runtime_run_code(local
|
7
|
+
def runtime_run_code(local, params)
|
8
8
|
<<RUN_CODE
|
9
|
-
mono #{File.basename(@exec.path)}
|
9
|
+
mono #{File.basename(@exec.path)} #{params}
|
10
10
|
RUN_CODE
|
11
11
|
end
|
12
12
|
end
|
@@ -4,9 +4,9 @@ module IronWorkerNG
|
|
4
4
|
module Perl
|
5
5
|
include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods
|
6
6
|
|
7
|
-
def runtime_run_code(local
|
7
|
+
def runtime_run_code(local, params)
|
8
8
|
<<RUN_CODE
|
9
|
-
perl #{File.basename(@exec.path)}
|
9
|
+
perl #{File.basename(@exec.path)} #{params}
|
10
10
|
RUN_CODE
|
11
11
|
end
|
12
12
|
end
|
@@ -8,9 +8,9 @@ module IronWorkerNG
|
|
8
8
|
include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods
|
9
9
|
include IronWorkerNG::Feature::Python::MergePipDependency::InstanceMethods
|
10
10
|
|
11
|
-
def runtime_run_code(local
|
11
|
+
def runtime_run_code(local, params)
|
12
12
|
<<RUN_CODE
|
13
|
-
PATH=`pwd`/__pips__/__bin__:$PATH PYTHONPATH=`pwd`/__pips__ python -u #{File.basename(@exec.path)}
|
13
|
+
PATH=`pwd`/__pips__/__bin__:$PATH PYTHONPATH=`pwd`/__pips__ python -u #{File.basename(@exec.path)} #{params}
|
14
14
|
RUN_CODE
|
15
15
|
end
|
16
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_worker_ng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kirilenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: iron_core
|
@@ -175,48 +175,48 @@ extra_rdoc_files: []
|
|
175
175
|
files:
|
176
176
|
- lib/3rdparty/hashie/indifferent_access.rb
|
177
177
|
- lib/3rdparty/hashie/merge_initializer.rb
|
178
|
-
- lib/iron_worker_ng/
|
179
|
-
- lib/iron_worker_ng/
|
178
|
+
- lib/iron_worker_ng/api_client.rb
|
179
|
+
- lib/iron_worker_ng/cli.rb
|
180
180
|
- lib/iron_worker_ng/client.rb
|
181
|
-
- lib/iron_worker_ng/version.rb
|
182
|
-
- lib/iron_worker_ng/code/python.rb
|
183
|
-
- lib/iron_worker_ng/code/ruby.rb
|
184
|
-
- lib/iron_worker_ng/code/mono.rb
|
185
|
-
- lib/iron_worker_ng/code/node.rb
|
186
181
|
- lib/iron_worker_ng/code/base.rb
|
182
|
+
- lib/iron_worker_ng/code/binary.rb
|
183
|
+
- lib/iron_worker_ng/code/builder.rb
|
184
|
+
- lib/iron_worker_ng/code/container/base.rb
|
185
|
+
- lib/iron_worker_ng/code/container/dir.rb
|
186
|
+
- lib/iron_worker_ng/code/container/zip.rb
|
187
|
+
- lib/iron_worker_ng/code/go.rb
|
187
188
|
- lib/iron_worker_ng/code/java.rb
|
188
|
-
- lib/iron_worker_ng/code/
|
189
|
-
- lib/iron_worker_ng/code/
|
189
|
+
- lib/iron_worker_ng/code/mono.rb
|
190
|
+
- lib/iron_worker_ng/code/node.rb
|
191
|
+
- lib/iron_worker_ng/code/perl.rb
|
192
|
+
- lib/iron_worker_ng/code/php.rb
|
193
|
+
- lib/iron_worker_ng/code/python.rb
|
194
|
+
- lib/iron_worker_ng/code/ruby.rb
|
195
|
+
- lib/iron_worker_ng/code/runtime/binary.rb
|
196
|
+
- lib/iron_worker_ng/code/runtime/go.rb
|
197
|
+
- lib/iron_worker_ng/code/runtime/java.rb
|
190
198
|
- lib/iron_worker_ng/code/runtime/mono.rb
|
191
199
|
- lib/iron_worker_ng/code/runtime/node.rb
|
192
|
-
- lib/iron_worker_ng/code/runtime/java.rb
|
193
200
|
- lib/iron_worker_ng/code/runtime/perl.rb
|
194
|
-
- lib/iron_worker_ng/code/runtime/binary.rb
|
195
201
|
- lib/iron_worker_ng/code/runtime/php.rb
|
196
|
-
- lib/iron_worker_ng/code/runtime/
|
197
|
-
- lib/iron_worker_ng/code/
|
198
|
-
- lib/iron_worker_ng/
|
199
|
-
- lib/iron_worker_ng/code/binary.rb
|
200
|
-
- lib/iron_worker_ng/code/container/zip.rb
|
201
|
-
- lib/iron_worker_ng/code/container/dir.rb
|
202
|
-
- lib/iron_worker_ng/code/container/base.rb
|
203
|
-
- lib/iron_worker_ng/code/php.rb
|
204
|
-
- lib/iron_worker_ng/code/go.rb
|
202
|
+
- lib/iron_worker_ng/code/runtime/python.rb
|
203
|
+
- lib/iron_worker_ng/code/runtime/ruby.rb
|
204
|
+
- lib/iron_worker_ng/compat.rb
|
205
205
|
- lib/iron_worker_ng/feature/base.rb
|
206
|
+
- lib/iron_worker_ng/feature/common/merge_deb.rb
|
207
|
+
- lib/iron_worker_ng/feature/common/merge_dir.rb
|
208
|
+
- lib/iron_worker_ng/feature/common/merge_exec.rb
|
209
|
+
- lib/iron_worker_ng/feature/common/merge_file.rb
|
210
|
+
- lib/iron_worker_ng/feature/common/merge_zip.rb
|
211
|
+
- lib/iron_worker_ng/feature/common/set_env.rb
|
212
|
+
- lib/iron_worker_ng/feature/java/merge_jar.rb
|
206
213
|
- lib/iron_worker_ng/feature/python/merge_pip.rb
|
207
214
|
- lib/iron_worker_ng/feature/python/merge_pip_dependency.rb
|
208
|
-
- lib/iron_worker_ng/feature/java/merge_jar.rb
|
209
|
-
- lib/iron_worker_ng/feature/ruby/merge_gem_dependency.rb
|
210
215
|
- lib/iron_worker_ng/feature/ruby/merge_gem.rb
|
216
|
+
- lib/iron_worker_ng/feature/ruby/merge_gem_dependency.rb
|
211
217
|
- lib/iron_worker_ng/feature/ruby/merge_gemfile.rb
|
212
|
-
- lib/iron_worker_ng/
|
213
|
-
- lib/iron_worker_ng/
|
214
|
-
- lib/iron_worker_ng/feature/common/merge_zip.rb
|
215
|
-
- lib/iron_worker_ng/feature/common/merge_deb.rb
|
216
|
-
- lib/iron_worker_ng/feature/common/merge_dir.rb
|
217
|
-
- lib/iron_worker_ng/feature/common/merge_exec.rb
|
218
|
-
- lib/iron_worker_ng/cli.rb
|
219
|
-
- lib/iron_worker_ng/api_client.rb
|
218
|
+
- lib/iron_worker_ng/fetcher.rb
|
219
|
+
- lib/iron_worker_ng/version.rb
|
220
220
|
- lib/iron_worker_ng.rb
|
221
221
|
- README.md
|
222
222
|
- LICENSE
|