Comments (8)
No, that's exactly what honcho is meant to do, and it's exactly what foreman does too:
$ honcho start -f test/fixtures/Procfile.ports -c web=3,es=1,redis=1,worker=1 | grep PORT
21:41:02 web.1 | PORT=5000
21:41:02 web.2 | PORT=5001
21:41:02 web.3 | PORT=5002
21:41:02 worker.1 | PORT=5100
21:41:02 redis.1 | PORT=5200
21:41:02 es.1 | PORT=5300
$ foreman start -f test/fixtures/Procfile.ports -m web=3,es=1,redis=1,worker=1 | grep PORT
21:41:07 web.1 | PORT=5000
21:41:07 web.2 | PORT=5001
21:41:07 web.3 | PORT=5002
21:41:07 worker.1 | PORT=5100
21:41:07 redis.1 | PORT=5200
21:41:07 es.1 | PORT=5300
The Heroku stack has a native understanding of the Procfile format, and you shouldn't need to use either honcho or foreman directly. See the Heroku documentation for further information.
Closing.
from honcho.
This ticket saved me another hour of debugging.
For those interested: https://ddollar.github.io/foreman/#PROCFILE
The special environment variables $PORT and $PS are available within the Procfile. $PORT is the port selected for that process. $PS is the name of the process for the line.
The $PORT value starts as the base port as specified by -p, then increments by 100 for each new process line. Multiple instances of the same process are assigned $PORT values that increment by 1.
from honcho.
I'm working on this at https://github.com/alej0varas/honcho
from honcho.
I have a related problem, which is that there seem to be some automatic PORT incrementing going on (https://github.com/nickstenning/honcho/blob/master/honcho/command.py#L171), which makes honcho hard to use with heroku which kills processes that listens on any other port than the one specified in $PORT. Also, it's a behavior that is different from foreman.
from honcho.
Hi! I've now investigated this a little more, and of course found out that the port incrementing is done by both foreman as well. Sorry for the assumption that this was wrong.
However, I believe I've managed to find a difference with the $PORT between foreman and honcho. If i use -p 5000, Foreman seems to consistently set the $PORT variable for the first process of the first process type to 5000, while the process that gets assigned the 5000 port with honcho seems more random.
The following Procfile
p1: echo $PORT; sleep 1
p2: echo $PORT; sleep 1
p3: echo $PORT; sleep 1
Results in the following output with foreman:
§ foreman start -f TestProcfile -p 5000
10:08:56 p3.1 | started with pid 95661
10:08:56 p2.1 | started with pid 95660
10:08:56 p1.1 | started with pid 95659
10:08:56 p3.1 | 5200; sleep 1
10:08:56 p2.1 | 5100; sleep 1
10:08:56 p1.1 | 5000; sleep 1
10:08:56 p3.1 | process terminated
10:08:56 system | sending SIGTERM to all processes
10:08:56 system | sending SIGTERM to pid 95659
10:08:56 system | sending SIGTERM to pid 95660
10:08:56 p2.1 | process terminated
10:08:56 p1.1 | process terminated
And the following with honcho:
§ honcho start -f TestProcfile -p 5000
10:09:46 p2.1 | started with pid 95670
10:09:46 p3.1 | started with pid 95671
10:09:46 p1.1 | started with pid 95672
10:09:46 p2.1 | 5000
10:09:46 p3.1 | 6001
10:09:46 p1.1 | 7002
10:09:47 p2.1 | process terminated
10:09:47 system | sending SIGTERM to all processes
10:09:47 p3.1 | process terminated
10:09:47 p1.1 | process terminated
If you're running honcho/foreman on Heroku (and I know this is unorthodox, but there are scenarios where this can be beneficial) it's good to have a deterministic way that the $PORT gets assigned.
from honcho.
This issue is known and has been addressed in the master branch. See issue #13.
If you have additional problems, would you mind filing separate tickets rather than using this one as a forum for discussion? Thank you!
from honcho.
I believed the problem I saw was related to this issue, otherwise I wouldn't have posted here. I jumped to conclusions that was wrong, and I'm very sorry about that. I never meant to use this one as a forum, or to waste your time. Sorry =/.
from honcho.
No need to be sorry, and sorry if my last comment sounded curt. It was just composed on a train, that's all =).
You're not wasting my time, and not to worry about this ticket!
from honcho.
Related Issues (20)
- Running multiple workers in background? HOT 1
- Virutalenv on Windows + *nix HOT 2
- Multiple Printers to Honcho Manager? HOT 3
- Dashes in process types HOT 1
- Feature proposal: a honcho module API HOT 3
- Project Status of Honcho? HOT 1
- Stop honcho from Makefile HOT 5
- [bug] Subparsers override common common_args HOT 1
- Honcho buffers output to file HOT 2
- Prefix without timestamp
- Py3.8 RuntimeWarning: line buffering isn't supported in binary mode HOT 4
- PROCFILE envvar is respected only if provided on .env file HOT 1
- Why isn't there "stop" command? HOT 4
- New Release? HOT 4
- systemd exporter not working
- honcho run doesn't load .env variables HOT 2
- Prevent existing environment variables from being overriden?
- Thanks HOT 1
- Support color output by processes
- Why start_new_session=True ? (sorry not really an issue)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from honcho.