Git Product home page Git Product logo

invoker's Introduction

Invoker is a gem for managing processes in development environment.

Build Status Code Climate Coverage Status

Usage

First we need to install invoker gem to get command line utility called invoker, we can do that via:

gem install invoker

Currently it only works with Ruby 2.0, 2.1, 2.2, and 2.3.

Manual

Information about configuring and using Invoker can be found on - Invoker Website

Invoker documentation is maintained via Jekyll and hosted on github. If you would like to fix an error or update something - please submit a pull request against gh-pages branch of Invoker.

Bug reports and Feature requests

Please use Github Issue Tracker for feature requests or bug reports.

invoker's People

Contributors

ami7ava avatar andriusm avatar codemancers-bot avatar diskshima avatar dwbutler avatar evilfaeton avatar gnufied avatar goromlagche avatar iffyuva avatar jbrodie avatar johnhamelink avatar karlfreeman avatar kgrz avatar koenpunt avatar larrylv avatar manuraj17 avatar michaelglass avatar moinatcodemancers avatar moinuddinatgrit avatar mtylty avatar nisanthchunduru avatar olegsmelov avatar pragtob avatar progm avatar rmm5t avatar sagmor avatar smudge avatar swrobel avatar tomayoola avatar tyabe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

invoker's Issues

Allow processes that are `inactive` by default

It would be nice to allow processes to be added to the ini file that don't load automatically when you call invoker start my.ini.

You could then call invoker start processname to make the process load when you actually need it.

Alternatively @gnufied suggested it might be possible to make it load automatically when it's called by the URL. So calling http://processname.dev would force a start for an inactive process.

Thoughts?

add a command for verifying invoker setup for .dev support

right now, once i do sudo invoker setup, there is no way to know whether my .dev support is working properly or not. i would request to add another command, say invoker setup check, or something which checks output of ipfw list or its pfctl equivalent, and verify that setup is indeed done.

Per-project Usage?

Perhaps I don't understand the purpose of the project entirely, but, here's my scenario:

  • Multiple node apps running (with port conflicts today).
  • Communication between node apps when developing.
  • Currently, npm start on production, gulp or grunt on development.

So, my questions are:

  • Why is it that invoker can't be ran within each project (invoker start Procfile)
  • Obviously, a Procfile is for production usage, so I'm assuming it's best to have invoker.ini for local development, and save the Procfile for production?

How to use with chruby

Is it possible to update the docs for installation with chruby, and running via chruby?

In my case to run the setup I had to use

sudo -E chruby-exec ruby-2.1.2 -- invoker setup

Invoker should honour the present working directory.

It seem insane not to automatically (or by some special value for directory=) to specify the "current directory that the ini file lives in".

Without this, I can't check my invoker file into the working repository, as I keep my code in ~/Projects/, and my colleagues use /code and ~/code/ with a fairly even split.

Was invoker intended to be used in this way, or had you intended to have an ~/.invoker directory where one can invoke myproject, and alias that to invoker start ~/.invoker/myproject.ini?

Invoker does not work on Linux

home/gnufied/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/parsers/config.rb:102:in `check_directory': Invalid directory "/home/gnufied/brightbox/honcho" (Invoker::Errors::InvalidConfig)
        from /home/gnufied/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/parsers/config.rb:47:in `block in process_ini'
        from /home/gnufied/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/iniparse-1.3.2/lib/iniparse/line_collection.rb:62:in `block in each'

Add an `invoker tail [process]` command

This would let you tail a specific process or all of them within a different window.

For example if you had an app, worker and redis running you could have two terminals. One running invoker tail app and one running invoker tail worker to see the two logs you were interested in within different windows.

With the ability to start in the background (#41) this would allow you to skip seeing the logs for things like redis if you desired.

Error running setup on fresh machine

Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/config.rb:55:in `initialize': Permission denied @ rb_sysopen - /Users/gnufied/.invoker/config (Errno::EACCES)
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/config.rb:55:in `open'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/config.rb:55:in `save'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/config.rb:20:in `create'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/setup.rb:65:in `create_config_file'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/setup.rb:37:in `setup_invoker'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/power/setup.rb:14:in `install'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/cli.rb:18:in `setup'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/lib/invoker/cli.rb:13:in `start'
        from /Users/gnufied/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/invoker-1.1.0/bin/invoker:7:in `<top (required)>'
        from /Users/gnufied/.rbenv/versions/2.1.1/bin/invoker:23:in `load'
        from /Users/gnufied/.rbenv/versions/2.1.1/bin/invoker:23:in `<main>'

Support HTTPS

I want to be able to serve HTTPS for development purposes using self-signed certs.

It would be great if invoker could do an SSL-terminating port forwarder on 443.

Invoker not working correctly with rbenv

Here's the command given in the documentation that doesn't seem to be working:

command = RBENV_VERSION=2.0.0-p0 zsh -c "bundle exec rails s"

Here's my invoker ini file:

[rails4example]
directory = /Users/tchapin/Documents/dev/rails4example
port = 3001
command = RBENV_VERSION=2.0.0-p0 zsh -c "bundle exec rails s"

Here's what happens when I try to run invoker:

rails4example : Gemfile syntax error:
rails4example : /Users/tchapin/Documents/dev/rails4example/Gemfile:48: syntax error, unexpected ':', expecting kEND
rails4example :   gem 'sdoc', require: false
rails4example :

When I alter my invoker ini to run this command instead:

command = RBENV_VERSION=2.0.0-p0 zsh -c "ruby --version"

I get this result:

rails4example : ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

It appears that invoker is launching the zsh instance in some sort of manner that is skipping all of the initialization and path settings in my ~/.zshrc file, and as a result, everything is being executed as if I don't even have rbenv installed and it's just trying to use the default ruby that's installed on OSX by default.

Any idea how to make this work correctly?

does not proxy port on linux

I'm using Ubuntu 13.10 as a development machine with Ruby on Rails. I ran the invoker setup and appear to have everything setup correctly.

Example config file:
[qlp]
directory = /home/mark/dev/qlp
command = bundle exec rails s -p $PORT

I can start the process and verify it works. However, it will ONLY respond if I explicitly add the port to the url. (must do http://qlp.dev:9001). It does not respond without the port being added.

I checked the /etc/rinetd.conf file and it looks like it should be proxying the port.

slop instance is emitted when invoker -v is run

issue might be from here:

      def self.create_default_command(args, opts)
        if args.first && File.exists?(args.first) && File.file?(args.first)
          port = opts.to_hash[:port] || 9000
          OpenStruct.new(:command => "start", :file => args.first, :port => port)
        else
          Invoker::Logger.puts opts.inspect
          false
        end
      end

default cmd is thinking that there is no file being passed, and so emitting opts which is an instance of Slop

`invoker start` raise a TypeError if no config file is present

Not really a deal breaker but this could use a better message. Invoker version 1.0.3

/home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/parsers/config.rb:120:in `extname': no implicit conversion of nil into String (TypeError)
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/parsers/config.rb:120:in `is_ini?'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/parsers/config.rb:33:in `load_config'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/parsers/config.rb:13:in `initialize'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/runner.rb:51:in `new'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/runner.rb:51:in `start_server'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/runner.rb:24:in `run_command'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/lib/invoker/runner.rb:10:in `run'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/gems/invoker-1.0.3/bin/invoker:11:in `<top (required)>'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/bin/invoker:23:in `load'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/bin/invoker:23:in `<main>'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'

Ruby version: ruby-2.0.0-p247

RubyDNS 1.0.0 release, can you please test.

We are preparing for 1.0.0 release of RubyDNS. Changes are mostly performance and bug fixing, tidy up code base.

socketry/rubydns#28

If possible can you please test with latest 0.8.x and report back. We aim to do 1.0.0 release of RubyDNS by the end of this month. Thanks for your help!

Auto detect default configuration file

Thanks for building this. I've been looking for a better alternative to Foreman.

Similar to how foreman start works, it would be nice if running invoker start would automatically detect either a invoker.ini or Procfile.

If this sounds like a reasonable feature, I can attempt a pull request.

Using Invoker with Guard

Hi all -

I'm trying to start a "guard" process with invoker - and it exits right away with no error. Any ideas why?

It works fine when I run it directly from the command line. I've tried using with a "bundle exec" prefix and without...

Error on "invoker list"

Hi,
I am getting the following error when I try to list the processes using invoker list

/Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/gems/invoker-0.1.1/lib/invoker/process_printer.rb:35:in `print_table': undefined method `display_compact_table' for Formatador:Class (NoMethodError)
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/gems/invoker-0.1.1/lib/invoker/runner.rb:66:in `block in list_commands'
    from /Users/avinashashastry/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/socket.rb:693:in `unix'
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/gems/invoker-0.1.1/lib/invoker/runner.rb:63:in `list_commands'
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/gems/invoker-0.1.1/lib/invoker/runner.rb:24:in `run_command'
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/gems/invoker-0.1.1/lib/invoker/runner.rb:10:in `run'
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/gems/invoker-0.1.1/bin/invoker:11:in `<top (required)>'
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/bin/invoker:23:in `load'
    from /Users/avinashashastry/.rvm/gems/ruby-1.9.3-p194/bin/invoker:23:in `<main>'

Conflicting gem versions?
I am using invoker (0.1.1)

Load .env files for each directory

Currently a single .env file is loaded for a single directory. This works great if your working on a simple app. However, invoker allows you to specify a different directory for each process, and you could be starting 2-3 different apps, all with different requirements.

It would be great if the .env file for each of those directories could be loaded and passed to each command individually. Then each app could maintain it's own .env file within the app directory.

Reload command does not wok on linux

Got this error from the reload command while invoker was running as daemon

/home/ubuntu/invoker/lib/invoker/reactor/reader.rb:26:in `rescue in process_read': undefined method `pipe_end' for nil:NilClass (NoMethodError)
        from /home/ubuntu/invoker/lib/invoker/reactor/reader.rb:22:in `process_read'
        from /home/ubuntu/invoker/lib/invoker/reactor/reader.rb:15:in `block in handle_read_event'
        from /home/ubuntu/invoker/lib/invoker/reactor/reader.rb:15:in `each'
        from /home/ubuntu/invoker/lib/invoker/reactor/reader.rb:15:in `handle_read_event'
        from /home/ubuntu/invoker/lib/invoker/reactor.rb:25:in `monitor_for_fd_events'
        from /home/ubuntu/invoker/lib/invoker/commander.rb:68:in `block in start_event_loop'
        from /home/ubuntu/invoker/lib/invoker/commander.rb:67:in `loop'
        from /home/ubuntu/invoker/lib/invoker/commander.rb:67:in `start_event_loop'
        from /home/ubuntu/invoker/lib/invoker/commander.rb:42:in `start_manager'
        from /home/ubuntu/invoker/lib/invoker/cli.rb:45:in `start'
        from /home/ubuntu/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/ubuntu/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/ubuntu/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/ubuntu/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/ubuntu/invoker/lib/invoker/cli.rb:12:in `start'
        from bin/invoker:7:in `<main>'

Allow running invoker in the background

It would be great if the following commands were available.

invoker run - the same as the current invoker start, showing stdout for each process
invoker start - starts invoker and runs it in the background
invoker stop - stops the currently running invoker

That way you can startup everything in the background without it occupying a terminal window with everything you're running in the output.

ng-app="app" header removed

I just tried to run an angular rails app using the project.dev proxy but sadly the proxy removes somehow changes the header from:

<!DOCTYPE html><html ng-app="app">

to

<!DOCTYPE html><html>

I don't understand what is happening here and why it is removes. When I access the same app using the port it is running on, it is sill there.

Add proper reload support.

Reload support is already there, but it is kind of disabled right now because reloading can cause race conditions. This has to be added carefully.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.