pitluga / subcontractor Goto Github PK
View Code? Open in Web Editor NEWrvm aware process launcher for foreman
rvm aware process launcher for foreman
Hello,
I'm using the Slanger gem which spawns a thin process.
push: subcontract --rvm ruby-1.9.3-p0@push --chdir ../push --signal INT -- bundle exec slanger --app_key xxx --secret xxx
However when I hit CTRL+C all the other processes defined in the Procfile quits but this one. I also tried to send the default TERM or leaving out the parameter, but it makes no difference.
I haven't checked the code yet but it appears foreman is killing subcontract while leaving the subprocess alive.
any chance to get this working with rbenv and bundler.
Trying to run two rails apps and one is not using the Gemfile as its complaining about undefined methods/classes, which isn't an issue when running normally.
I created a new gemset in Ruby 1.9.3p194 using RVM. Ran gem install subcontractor
and then tried the command subcontract --help
and it has many dependency issues. I get the following output on a clean gemset
/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/spec_set.rb:90:in
`block in materialize': Could not find i18n-0.6.1 in any of the sources (Bundler::GemNotFound)
I installed the rails gem and I get the same error but with the missing gem builder-3.0.3
Shouldn't all these dependencies be installed when the subcontractor gem is installed?
When using the slanger example, this is happening with slanger 0.3.4
14:07:26 slanger.1 | /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:39:in ``': deadlock; recursive locking (ThreadError)
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:39:in `find_child_pids'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:32:in `find_pids_to_kill'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:14:in `block (2 levels) in run'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:39:in `call'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:39:in ``'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:39:in `find_child_pids'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:32:in `find_pids_to_kill'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:17:in `block (2 levels) in run'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:19:in `call'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:19:in `eof?'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:19:in `block in run'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:12:in `spawn'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/lib/subcontractor/cli.rb:12:in `run'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/gems/subcontractor-0.4.1/bin/subcontract:5:in `<top (required)>'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/bin/subcontract:19:in `load'
14:07:26 slanger.1 | from /Users/tonyp/.rvm/gems/ruby-1.9.3-p125@test_shit/bin/subcontract:19:in `<main>'
The version containing the chruby flag is unreleased, although it is in the readme. Would it be possible to get a 0.8.1 tag?
I updated rvm and subcontractor stopped working. Foreman fails
I've got 2 rails apps.
App A and app B.
The both work just fine when started manually from the console.
When I try to start app B with foreman + subcontractor from app A I get
accounts/config/initializers/active_admin.rb:1:in `<top (required)>': uninitialized constant ActiveAdmin (NameError)
This is my procfile:
mondodb: ~/mongodb/bin/mongod
accounts: subcontract --rvm 1.9.2 --chdir ../accounts -- bundle exec rails s -p 3001
web: ./script/start.sh
I've tried
accounts: subcontract --rvm "--with-rubies rvmrc" --chdir ../accounts -- bundle exec rails s -p 3001
and
new_rvm_app: accounts: subcontract --rvm --with-rubies default-with-rvmrc do --chdir ../accounts --signal INT -- bundle exec rails s -p 3001
They don't work either (the 2nd one has a different error though)
I'm using subcontractor 0.6.0
When you're using --chdir you often want to load the .env file in the chdir directory, not the directory foreman is run from.
I might take a stab at this.
What is the license for this Gem? Is it MIT/BSD etc?
Foreman is dead. Child process is dead. subcontract
is alive and doesn't die on kill with term or int. I am kill -9
ing it. I'd prefer not to do that. Any advice? I have tried --signal INT
and --signal TERM
. The way I start forman is by nohup and &
it into the background, piping the log into a file. The way I am killing foreman is to kill
it. Other processes seem to be behaving fine.
Hello,
this is my Procfile that resides in my main project dir:
web: bundle exec rainbows -p $PORT -c ./config/unicorn.rb
node: subcontract --chdir ../node --signal INT -- coffee application.coffee --environment development --uploader --streamer
push: subcontract --rvm "--with-rubies rvmrc" --chdir ../push --signal INT -- bundle exec slanger --app_key xxx --secret xxx --redis_address redis://127.0.0.1:6379/0
Now, ../push does use a .rvmrc like this:
rvm use --create --install ruby-1.9.2-p290@push
if ! command -v bundle ; then
gem install bundler --no-rdoc --no-ri
fi
if ! command -v foreman ; then
gem install foreman --no-rdoc --no-ri
fi
The issue here is that everytime I run foreman start
with this Procfile
the system will attempt to download bundler and foreman gems for the push project, sometimes only foreman, like in the example below:
18:31:13 push.1 | started with pid 26375
18:31:25 push.1 |
18:31:25 push.1 | RVM is not a function, selecting rubies with 'rvm use ...' will not work.
18:31:25 push.1 | /Users/kain/.rvm/bin/bundle
Fetching: foreman-0.34.1.gem (100%)man-0.34.1.gem
18:31:25 push.1 | Successfully installed foreman-0.34.1
18:31:25 push.1 | 1 gem installed
18:31:25 push.1 | Unrecognized command line argument: 'bundle' ( see: 'rvm usage' )
Any idea? Thanks.
.bash_profile
[[ -s "/Users/kain/.rvm/scripts/rvm" ]] && source "/Users/kain/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
I'm getting an error when launching 2 rails instances in different directories using rbenv and bundler. I've looked at the other outstanding issue with rbenv and the suggestion to add the path to the Gemfile but that didn't work for me. This exact setup works with rvm using --rvm. I'm trying to switch my projects to rbenv. Both rails project run fine individually too using 'bundle exec rails server'.
Error is:
23:01:04 customerservice.1 | started with pid 28887
23:01:04 onevueapi.1 | started with pid 28888
23:01:05 onevueapi.1 | rbenv: no local version configured for this directory
23:01:05 onevueapi.1 | /home/andrew/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'bundler' (>= 0) among 8 total gem(s) (Gem::LoadError)
23:01:05 onevueapi.1 | from /home/andrew/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
23:01:05 onevueapi.1 | from /home/andrew/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
23:01:05 onevueapi.1 | from /home/andrew/.rbenv/versions/2.1.1/gemsets/onevueapi-gemset/bin/bundle:22:in `<main>'
23:01:05 onevueapi.1 | exited with code 0
23:01:05 system | sending SIGTERM to all processes
23:01:05 customerservice.1 | terminated by SIGTERM
My Procfile is:
customerservice: bundle exec rails s -p 3005
onevueapi: bundle exec subcontract --rbenv . --chdir ../onevueapi --signal INT -- bundle exec rails s -p 3000
The directory ~/src/onevueapi exists and I'm executing like:
~/src/customerservice> bundle exec foreman start
From the following:
subcontract --chdir ../contacts -- bundle exec unicorn -p 3002 -c ./config/unicorn.rb
I get this error
subcontractor-0.4.1/lib/subcontractor/cli.rb:19:in `eof?': Input/output error - /dev/pts/2 (Errno::EIO)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.