Skip to content
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

Notification when deploy finishes #888

Closed
bmarini opened this issue Jun 21, 2016 · 6 comments
Closed

Notification when deploy finishes #888

bmarini opened this issue Jun 21, 2016 · 6 comments

Comments

@bmarini
Copy link
Contributor

bmarini commented Jun 21, 2016

After a deploy, I usually poll emp ps to know when the last release has been completely phased out.

Wouldn't it be nice to receive a notification instead.

@ejholmes
Copy link
Contributor

ejholmes commented Jun 21, 2016

I think this would be great if we could do it. Just to use this to record some ideas:

It would be nice if we had a done channel that we could listen on after a scheduler.Submit to know when the deployment fully completes (all of the ECS services have been updated with the new task definitions, and their running count matches their desired count) or when it's canceled (e.g. a new deployment supercedes the old one).

Within the Custom::ECSService we could return the id of the ECS deployment that the update creates, and set this as an output on the stack. Once the stack update completes, wait for all of the deployments to stabilize (move to ACTIVE state, or INACTIVE).

That would be relatively straightforward to do.

@ejholmes
Copy link
Contributor

It would also be nice if the done channel was just a channel of status updates, so we could put some useful information in the emp deploy stream, and then also update the status of a release in emp releases (e.g. this release is pending, inactive, active, etc).

@ejholmes
Copy link
Contributor

ejholmes commented Jun 22, 2016

I worked on a proposal for how I think we should do this, and put it in the wiki. I think fundamentally what we should do, is make the empire.Deploy method return when the new release is actually running on the cluster, rather than simply submitted to the backend.

@mwildehahn
Copy link
Contributor

Part one of this will be done with: #917

@mwildehahn
Copy link
Contributor

mwildehahn commented Jul 15, 2016

@ejholmes the last part of this i wanted to implement was always sending a notification when the release has stabilized, regardless of whether or not you specified streaming the status updates.

Right now, DeployEvent is either triggered after the release has stabilized if you've enabled the stream, or after it has been submitted if you haven't.

It feels weird that the empire event behaves differently depending on a small detail like whether or not the user wanted to stream updates on the cli.

I like how all events are published within https://github.com/remind101/empire/blob/master/empire.go, to maintain consistency with that, I think we should do something like:

mhahn started deploying remind101/acme-inc:1370b0390e4f4c572e521713d416248057b2932d to remind101/acme-inc dev (v99)

that way the events are always being published at the same time, regardless of whether streaming was specified and we also don't introduce publishing events in other parts of the stack.

the DeployEvent then means that the deploy has been released and the services have stabilized.

We can also setup a timeout within the Deploy function to fire a DeployTimeoutEvent when the deploy is taking longer than expected to alert people to issues.

Thoughts?

@ejholmes
Copy link
Contributor

With the recent changes that @mhahn did, I think we can go ahead and close this. When the -s flag is provided to emp deploy, the deployment will wait until all services are stable before returning. This is also the default behavior in the GitHub Deployments integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants