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

Show host the task is running on in emp ps #983

Merged
merged 5 commits into from
Aug 26, 2016
Merged

Conversation

Nosajool
Copy link
Contributor

@Nosajool Nosajool commented Aug 23, 2016

Closes #976

$ EMPIRE_API_URL=http://$(docker-machine ip default):8080 ./build/emp ps -a acme-inc
v2.web.1a1a11a1-aaa1-1aaa-a11a-aaa111a1aa1a  1b1b11b1-bbb1-1bbb-b11b-bbb111b1bb1b  1c1c11c1-ccc1-1ccc-c11c-ccc111c1cc1c  i-1111a111  1X  RUNNING   6m  "acme-inc server"

Opening this since I'd like some feedback, however I don't think this is the right approach since it requires a request to DescribeContainerInstances for each process which will quickly rate limit us. Looking into if it is possible to just make one batch request for all of the containers. If not, might need to cache like in #902.

Also, the output is getting pretty wide so I was wondering if maybe this stuff should be only shown if you pass the -v flag to emp ps. Then we could add other information here like @sanjayprabhu's "commit message" request. https://remind.slack.com/archives/empire/p1471910137001348

New output

v2.web.1a1a11a1-aaa1-1aaa-a11a-aaa111a1aa1a  i-aa111aa1  1X  RUNNING  89m  "acme-inc server"

@ejholmes ejholmes self-assigned this Aug 25, 2016
@@ -58,6 +58,9 @@ func listDynos(w io.Writer) {
func listDyno(w io.Writer, d *heroku.Dyno) {
listRec(w,
d.Name,
d.Id,
d.ContainerInstanceID,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the container instance id isn't very useful, and it's easy to correlate in AWS if we have the EC2 instance id. I think we should leave this off for the first version.

@ejholmes
Copy link
Contributor

Also, the output is getting pretty wide so I was wondering if maybe this stuff should be only shown if you pass the -v flag to emp ps.

I think if we just start with showing the ec2 instance id, then it won't add too many bytes and we can just show it.

@ejholmes
Copy link
Contributor

Other than those comments, this is awesome. This will be really useful!

Nosajool added a commit that referenced this pull request Aug 25, 2016
They have the same implementation

From the comment:
#983 (comment)
return nil, err
}
for _, f := range resp.Failures {
return nil, fmt.Errorf("error describing container instance Arn=%s err=%s", aws.StringValue(f.Arn), aws.StringValue(f.Reason))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, can we make this error:

fmt.Errorf("error describing container instance %s: %s", aws.StringValue(f.Arn), aws.StringValue(f.Reason))

@ejholmes
Copy link
Contributor

Just a couple small nits, but overall this looks good to go. Just needs a rebase since #985 was merged.

Closes #976

Add mocks for cloudformation tests

fix cli tests
Also make container instance request based on cluster

Fix cloudformation tests

Fix cli tests
@@ -24,6 +24,7 @@
* The Scheduler now has a `Restart` method which will trigger a restart of all the processes within an app. Previously, a "Restart" just re-released the app. Now schedulers like the cloudformation backend can optimize how the restart is handled. [#697](https://github.com/remind101/empire/issues/697)
* `emp run` now publishes an event when it is ran. [#954](https://github.com/remind101/empire/pull/954)
* `emp rollback` requires confirmation if rolling back more than 9 versions. [#975](https://github.com/remind101/empire/pull/975)
* `emp ps` now displays the task's host. [#983](https://github.com/remind101/empire/pull/983)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, this should get added to ## HEAD since 0.11.0 was already released.

Also update the Fake scheduler to return instances with fake host ids.
@ejholmes ejholmes merged commit 506e801 into master Aug 26, 2016
@ejholmes ejholmes deleted the jl-show-task-host branch August 26, 2016 00:58
@ejholmes ejholmes mentioned this pull request Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants