nickstenning / honcho

Honcho: a python clone of Foreman. For managing Procfile-based applications.
http://pypi.python.org/pypi/honcho
MIT License
1.6k stars 146 forks source link

Missing exports on clean install #161

Closed JensRantil closed 9 years ago

JensRantil commented 9 years ago

Hit this on a server I'm configuring. Managed to recreate the issue on a clean Vagrant box, too.

I'm somewhat surprised about this:

$ vagrant init ubuntu/precise64
$ vagrant up
$ vagrant ssh
$ sudo su
# apt-get update && apt-get install python-setuptools && easy_install pip && pip install honcho
# honcho export --help
usage: honcho export [-h] [-e ENV] [-d DIR] [-f FILE] [-v] [-a APP] [-l DIR]
                     [-p N] [-c process=num,process=num] [-u USER] [-s SHELL]
                     [-t DIR]
                     FORMAT LOCATION

positional arguments:
  FORMAT                format to export to; one of
  LOCATION              folder to export to

optional arguments:
  -h, --help            show this help message and exit
  -e ENV, --env ENV     environment file[,file] (default: .env)
  -d DIR, --app-root DIR
                        procfile directory (default: .)
  -f FILE, --procfile FILE
                        procfile path (default: Procfile)
  -v, --version         show program's version number and exit
  -a APP, --app APP     alternative app name
  -l DIR, --log DIR     directory to place process logs in
  -p N, --port N        starting port number (default: 5000)
  -c process=num,process=num, --concurrency process=num,process=num
                        number of each process type to run.
  -u USER, --user USER  user the application should run as
  -s SHELL, --shell SHELL
                        the shell that should run the application
  -t DIR, --template-dir DIR
                        directory to search for custom templates
# touch Procfile
# honcho export upstart myfile
usage: honcho export [-h] [-e ENV] [-d DIR] [-f FILE] [-v] [-a APP] [-l DIR]
                     [-p N] [-c process=num,process=num] [-u USER] [-s SHELL]
                     [-t DIR]
                     FORMAT LOCATION
honcho export: error: argument FORMAT: invalid choice: 'upstart' (choose from )
# honcho -v
honcho 0.6.6

Problem: The basic exporters listed in setup.py aren't accessible.

Expected: That exports are listed in --help and error message and that they are usable.

Additionals: Please let me know if I'm doing anything wrong to get these to work.

JensRantil commented 9 years ago

FYI, easy_install seem to install an older version (0.5) that works:

root@vagrant-ubuntu-precise-64:/home/vagrant# pip uninstall honcho
Uninstalling honcho-0.6.6:
  /usr/local/bin/honcho
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/DESCRIPTION.rst
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/METADATA
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/RECORD
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/RECORD.jws
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/WHEEL
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/entry_points.txt
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/metadata.json
  /usr/local/lib/python2.7/dist-packages/honcho-0.6.6.dist-info/top_level.txt
  /usr/local/lib/python2.7/dist-packages/honcho/__init__.py
  /usr/local/lib/python2.7/dist-packages/honcho/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/colour.py
  /usr/local/lib/python2.7/dist-packages/honcho/colour.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/command.py
  /usr/local/lib/python2.7/dist-packages/honcho/command.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/compat.py
  /usr/local/lib/python2.7/dist-packages/honcho/compat.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/environ.py
  /usr/local/lib/python2.7/dist-packages/honcho/environ.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/export/__init__.py
  /usr/local/lib/python2.7/dist-packages/honcho/export/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/export/base.py
  /usr/local/lib/python2.7/dist-packages/honcho/export/base.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/export/supervisord.py
  /usr/local/lib/python2.7/dist-packages/honcho/export/supervisord.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/export/templates/supervisord/supervisord.conf
  /usr/local/lib/python2.7/dist-packages/honcho/export/templates/upstart/master.conf
  /usr/local/lib/python2.7/dist-packages/honcho/export/templates/upstart/process.conf
  /usr/local/lib/python2.7/dist-packages/honcho/export/templates/upstart/process_master.conf
  /usr/local/lib/python2.7/dist-packages/honcho/export/upstart.py
  /usr/local/lib/python2.7/dist-packages/honcho/export/upstart.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/manager.py
  /usr/local/lib/python2.7/dist-packages/honcho/manager.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/printer.py
  /usr/local/lib/python2.7/dist-packages/honcho/printer.pyc
  /usr/local/lib/python2.7/dist-packages/honcho/process.py
  /usr/local/lib/python2.7/dist-packages/honcho/process.pyc
Proceed (y/n)? y
  Successfully uninstalled honcho-0.6.6
root@vagrant-ubuntu-precise-64:/home/vagrant# easy_install honcho
Searching for honcho
Reading http://pypi.python.org/simple/honcho/
Best match: honcho 0.5.0
Downloading https://pypi.python.org/packages/source/h/honcho/honcho-0.5.0.tar.gz#md5=b93651497472baf86c4ddf84bec1467b
Processing honcho-0.5.0.tar.gz
Running honcho-0.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Akukya/honcho-0.5.0/egg-dist-tmp-jSXbKN
zip_safe flag not set; analyzing archive contents...
honcho.command: module references __file__
Adding honcho 0.5.0 to easy-install.pth file
Installing honcho script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/honcho-0.5.0-py2.7.egg
Processing dependencies for honcho
Finished processing dependencies for honcho
root@vagrant-ubuntu-precise-64:/home/vagrant# honcho export upstart myfile
ERROR: No processes defined in Procfile
root@vagrant-ubuntu-precise-64:/home/vagrant# honcho export --help
usage: honcho export [-h] [-e ENV] [-d APP_ROOT] [-f PROCFILE] [-s SHELL]
                     [-u USER] [-c process=num,process=num] [-p N] [-l DIR]
                     [-a APP]
                     FORMAT LOCATION

positional arguments:
  FORMAT                What format to export to
  LOCATION              Folder to export to

optional arguments:
  -h, --help            show this help message and exit
  -s SHELL, --shell SHELL
                        Specify the shell that should run the application
                        (default: /bin/sh)
  -u USER, --user USER  Specify the user the application should run as
                        (default: None)
  -c process=num,process=num, --concurrency process=num,process=num
                        The number of each process type to run. (default:
                        None)
  -p N, --port N
  -l DIR, --log DIR     Specify the directory to place process logs in
                        (default: /var/log/APP)
  -a APP, --app APP     Alternative app name (default: vagrant)

common arguments:
  -e ENV, --env ENV     Environment file[,file] (default: .env)
  -d APP_ROOT, --app-root APP_ROOT
                        Procfile directory (default: .)
  -f PROCFILE, --procfile PROCFILE
                        Procfile path (default: Procfile)
root@vagrant-ubuntu-precise-64:/home/vagrant# honcho --help
usage: honcho [-h] [-v] [-e ENV] [-d APP_ROOT] [-f PROCFILE]
              {check,export,help,run,start} ...

Manage Procfile-based applications

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

common arguments:
  -e ENV, --env ENV     Environment file[,file] (default: .env)
  -d APP_ROOT, --app-root APP_ROOT
                        Procfile directory (default: .)
  -f PROCFILE, --procfile PROCFILE
                        Procfile path (default: Procfile)

tasks:
  {check,export,help,run,start}
    check               Validate your application's Procfile
    export              Export the application to another process management
                        format
    help                Describe available tasks or one specific task
    run                 Run a command using your application's environment
    start               Start the application (or a specific PROCESS)
root@vagrant-ubuntu-precise-64:/home/vagrant# honcho -v
honcho 0.5.0

That said, I'm not sure it uses entry points?

JensRantil commented 9 years ago

Allright, I reset the Vagrant image and installed pip using get-pip.py which seem to be best-pratices these days. Installing honcho using this later pip I am properly getting access to the exporters!

$ honcho export --help
usage: honcho export [-h] [-e ENV] [-d DIR] [-f FILE] [-v] [-a APP] [-l DIR]
                     [-p N] [-c process=num,process=num] [-u USER] [-s SHELL]
                     [-t DIR]
                     FORMAT LOCATION

positional arguments:
  FORMAT                format to export to; one of supervisord, upstart
  LOCATION              folder to export to

optional arguments:
  -h, --help            show this help message and exit
  -e ENV, --env ENV     environment file[,file] (default: .env)
  -d DIR, --app-root DIR
                        procfile directory (default: .)
  -f FILE, --procfile FILE
                        procfile path (default: Procfile)
  -v, --version         show program's version number and exit
  -a APP, --app APP     alternative app name
  -l DIR, --log DIR     directory to place process logs in
  -p N, --port N        starting port number (default: 5000)
  -c process=num,process=num, --concurrency process=num,process=num
                        number of each process type to run.
  -u USER, --user USER  user the application should run as
  -s SHELL, --shell SHELL
                        the shell that should run the application
  -t DIR, --template-dir DIR
                        directory to search for custom templates
$ honcho -v
honcho 0.6.6

Rethinking this, I realized that get-pip.py installs a later setuptools which was the issue here. Case closed.