New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dokku ps #298
dokku ps #298
Conversation
echo "-----> Starting $NAME" | ||
ps_each start $APP $NAME $NUM | ||
echo " $NUM processes up and running" | ||
sleep 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to add a mandatory 5 seconds to all deploys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, that was left there from when I thought docker needed some time to give me a port.
This is great! It may take some time to review. Maybe we can even simplify it a bit. |
oldid=$(< "$DOKKU_ROOT/$APP/CONTAINER") | ||
docker kill $oldid > /dev/null | ||
fi | ||
dokku ps:deploy $APP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should figure out a way to make it so dokku
doesn't depend on a plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a bit of a specific hack but would it suffice to wrap the current code in an if?
if [[ ! -f "$APP_PATH/PS" ]]; then
# current kill / start code here
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't think I'd +1 this without a real solution to this.
On Thu, Nov 7, 2013 at 12:37 PM, Robert Sköld notifications@github.comwrote:
In dokku:
@@ -47,18 +47,17 @@ case "$1" in
APP="$2"; IMAGE="$3"
pluginhook pre-deploy $APP $IMAGE
kill the app when running
- if [[ -f "$DOKKU_ROOT/$APP/PORT" ]]; then
oldid=$(< "$DOKKU_ROOT/$APP/CONTAINER")
docker kill $oldid > /dev/null
- fi
- dokku ps:deploy $APP
I know it's a bit of a specific hack but would it suffice to wrap the
current code in an if?if [[ ! -f "$APP_PATH/PS" ]]; then
current kill / start code here
fi
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/298/files#r7509242
.
Jeff Lindsay
http://progrium.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of this other PR: #296, maybe it could provide a bit more flexible solution?
But, if I understood the current implementation of pluginhook correctly, it would still do multiple deploys which seems a bit wasteful but maybe a flag to pluginhook which makes it only execute the last hook? Or is there a case when multiple deploy scripts would be desirable?
It would be awesome to have this in dokku. Thank you @slaskis for the contribution! |
@slaskis Does your syslog plugin https://github.com/slaskis/dokku/tree/wip/logger-0.2/plugins/syslog already account for Thanks for making this! It would be awesome to have this in dokku. |
@AlJohri haha, yeah it's a pleasant side effect of using syslog. Log rotation is another one. And the possibility to send logs to a central place (like papertrail) is yet another one... |
That's awesome! @slaskis What's left to be done then in terms of merging this much awaited PR? :) |
@AlJohri I wrote about some issues I have still in this comment: #386 (comment). (copied it to here, since it's relevant to this issue)
|
But the main issue with getting this merged is that I haven't spent any time on it since like december. I've been busy with unrelated projects which take up all my time. |
@slaskis any chance you could write a note on what other "kinks" you found with this plugin? I can get it merged if I know what issues you've found :) |
@josegonzalez unfortunately I can't remember what they were anymore :( |
Are you still using dokku in prod? Any chance you have any other changes? |
@josegonzalez actually they are still alive and kicking but I haven't touched them for almost exactly a year (the campaign for which the servers were created for was just until christmas). There are some changes implemented for a syslog plugin in a logger branch which is being used in those too. But that's based on whatever docker version that was released a year ago (definitely pre-1.0). So I'm sure the logging and other stuff could be handled better now. |
I think we're not going to implement this as is, and instead provide a pluginhook. For instance, I can foresee a plugin that scales AWS instances with dokku containers, or one that modifies the number of procs running inside of a supervisor controlled container. If anyone has any comments on that, feel free to pile them on, but doing anything more inside of dokku feels a bit weird (because there are so many corner cases). |
We have an official |
dokku-ps
A process management plugin for dokku.
Modeled after the process/dyno management of heroku.
Written to solve these problems:
Restarting crashed containers.
Because sometimes the process exits because of something like a memory leak and, until we have it fixed, we just want it to keep going.
And the idea is to use upstart to handle the containers, as described in dockers host integration docs.
Being able to start up non
web
processes.Bonus problems to solve:
Monitor & notify.
I'm guessing since upstart is monitoring the respawning of containers it should be able to notify me by email, irc or something even cooler using some custom events.
Process scaling.
If we are able to add each process as a backend to the nginx config we should easily be able to load balance the requests over multiple processes. This PR seems like it would help a lot as we would only have to generate
$APP_ROOT/nginx.conf
with the processes defined in$APP_ROOT/PS
. Something like:Status
dokku ps:restart APP web
dokku ps:restart APP
dokku ps:scale APP web=4 worker=1
dokku ps:stop APP web
cat
multiple streams into one?)Thoughts?