pampa 2.0.10 → 2.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pampa.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efa42c22ec0a02a9ae9e1ff633d6b034606a78f944f842cf782b13adeb59242e
|
4
|
+
data.tar.gz: 8efad57c243fc4de08f64d3fd6935d8393fb965cdfe2174749e466d2f571aa4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08d7f6166b24bcc2abd501bf62f6acae0d60aefe1283b14bbea5f079bd3a9a6b38307cb80d3dd626a49a5652093d9120793274d4816e9e7a4380c039f95a4ae8'
|
7
|
+
data.tar.gz: 6ec308ec2f54ca6e81c7e3b2089d60fc1fd2c88e36f97ad8dad8dab7231eaf2c2cb62a8d3ed6000d03615315ddbd2fe364b722edd725437b8652427fd5f8dd95
|
data/lib/pampa.rb
CHANGED
@@ -326,25 +326,25 @@ module BlackStack
|
|
326
326
|
l.done
|
327
327
|
# kill all ruby processes except this one
|
328
328
|
l.logs("Killing all Ruby processes except this one... ")
|
329
|
-
|
329
|
+
`ps ax | grep ruby | grep -v grep | grep -v #{Process.pid} | cut -b3-7 | xargs -t kill;`
|
330
330
|
l.done
|
331
331
|
# rename any existing folder ~/code/pampa to ~/code/pampa.<current timestamp>.
|
332
332
|
l.logs("Renaming old folder... ")
|
333
|
-
|
333
|
+
`mv ~/pampa ~/pampa.#{Time.now().to_i.to_s}`
|
334
334
|
l.done
|
335
335
|
# create a new folder ~/code. - ignore if it already exists.
|
336
336
|
l.logs("Creating new folder... ")
|
337
|
-
|
337
|
+
`mkdir ~/pampa`
|
338
338
|
l.done
|
339
339
|
# build the file ~/pampa/config.rb in the remote node. - Be sure the BlackStack::Pampa.to_hash.to_s don't have single-quotes (') in the string.
|
340
340
|
l.logs("Building config file... ")
|
341
341
|
s = "echo \"#{File.read(config_filename)}\" > ~/pampa/config.rb"
|
342
|
-
|
342
|
+
`#{s}`
|
343
343
|
l.done
|
344
344
|
# copy the file ~/pampa/worker.rb to the remote node. - Be sure the script don't have single-quotes (') in the string.
|
345
345
|
l.logs("Copying worker file... ")
|
346
346
|
s = "echo \"#{File.read(worker_filename)}\" > ~/pampa/worker.rb"
|
347
|
-
|
347
|
+
`#{s}`
|
348
348
|
l.done
|
349
349
|
# run the number of workers specified in the configuration of the Pampa module.
|
350
350
|
node.workers.each { |worker|
|
@@ -352,7 +352,7 @@ module BlackStack
|
|
352
352
|
# add these parameters for debug: debug=yes pampa=~/code/pampa/lib/pampa.rb
|
353
353
|
l.logs "Running worker #{worker.id}... "
|
354
354
|
s = "nohup ruby worker.rb id=#{worker.id} config=~/pampa/config.rb >/dev/null 2>&1 &"
|
355
|
-
|
355
|
+
`#{s}`
|
356
356
|
l.done
|
357
357
|
}
|
358
358
|
# disconnect the node
|
@@ -386,7 +386,7 @@ module BlackStack
|
|
386
386
|
l.done
|
387
387
|
# kill all ruby processes except this one
|
388
388
|
l.logs("Killing all Ruby processes except this one... ")
|
389
|
-
|
389
|
+
`ps ax | grep ruby | grep -v grep | grep -v #{Process.pid} | cut -b3-7 | xargs -t kill;`
|
390
390
|
l.done
|
391
391
|
# run the number of workers specified in the configuration of the Pampa module.
|
392
392
|
node.workers.each { |worker|
|
@@ -394,7 +394,7 @@ module BlackStack
|
|
394
394
|
# add these parameters for debug: debug=yes pampa=~/code/pampa/lib/pampa.rb
|
395
395
|
l.logs "Running worker #{worker.id}... "
|
396
396
|
s = "nohup ruby #{worker_filename} id=#{worker.id} config=#{config_filename} >/dev/null 2>&1 &"
|
397
|
-
|
397
|
+
`#{s}`
|
398
398
|
l.done
|
399
399
|
}
|
400
400
|
# disconnect the node
|
@@ -429,7 +429,7 @@ module BlackStack
|
|
429
429
|
l.done
|
430
430
|
# kill all ruby processes except this one
|
431
431
|
l.logs("Killing all Ruby processes except this one... ")
|
432
|
-
|
432
|
+
`ps ax | grep ruby | grep -v grep | grep -v #{Process.pid} | cut -b3-7 | xargs -t kill;`
|
433
433
|
l.done
|
434
434
|
# disconnect the node
|
435
435
|
l.logs("Disconnecting... ")
|