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

Support multiple service IDs on "docker service ps" #25234

Merged
merged 1 commit into from Jan 3, 2017

Conversation

Projects
None yet
8 participants
@yongtang
Member

yongtang commented Jul 29, 2016

- What I did

This fix tries to address the issue raised in #25228 to support multiple service IDs on docker service ps.

- How I did it

Multiple IDs are allowed with docker service ps ..., and related documentation has been updated.

- How to verify it

A test has been added to cover the changes.

- Description for the changelog

Support multiple service IDs on "docker service ps"

- A picture of a cute animal (not mandatory but encouraged)

This fix fixes #25228.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Aug 1, 2016

Member

functionally, it makes sense to have an option to show tasks for multiple services; I'm a bit in doubt what the best approach is. For example, docker ps by default shows everything, but requires a --filter to just show a single (container).

I realize docker service ps is slightly different, hence my doubt

ping @stevvooe @aluzzardi @tiborvass

Member

thaJeztah commented Aug 1, 2016

functionally, it makes sense to have an option to show tasks for multiple services; I'm a bit in doubt what the best approach is. For example, docker ps by default shows everything, but requires a --filter to just show a single (container).

I realize docker service ps is slightly different, hence my doubt

ping @stevvooe @aluzzardi @tiborvass

@ezrasilvera

This comment has been minimized.

Show comment
Hide comment
@ezrasilvera

ezrasilvera Aug 1, 2016

Contributor

@thaJeztah I'm not sure I would compare it to docker ps (on single engine). Maybe it is closer indeed to "ps" on the previous swarm where you got all containers and indeed used filter if needed.
In general I would love to see a more "old swarm" related options where one can see all the resources and filer out.
BTW, specific for "docker service" it's not reasonable to allow multiple IDs for "inspect" but not for other subcommands

Contributor

ezrasilvera commented Aug 1, 2016

@thaJeztah I'm not sure I would compare it to docker ps (on single engine). Maybe it is closer indeed to "ps" on the previous swarm where you got all containers and indeed used filter if needed.
In general I would love to see a more "old swarm" related options where one can see all the resources and filer out.
BTW, specific for "docker service" it's not reasonable to allow multiple IDs for "inspect" but not for other subcommands

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Aug 1, 2016

Member

Yes, perhaps this is the best approach; I was thinking out loud, and thought I'd better write it up on GitHub, before I forget to do so

Member

thaJeztah commented Aug 1, 2016

Yes, perhaps this is the best approach; I was thinking out loud, and thought I'd better write it up on GitHub, before I forget to do so

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Aug 1, 2016

Contributor

multiple ID's on service ps is a bit strange, tbh. I'm not sure the UX holds up to it.

Contributor

cpuguy83 commented Aug 1, 2016

multiple ID's on service ps is a bit strange, tbh. I'm not sure the UX holds up to it.

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Aug 1, 2016

Contributor

Maybe with multiple it can change format so tasks are nested underneath a service... but docker service ls pretty much shows this same information, just without the individual task details.

Contributor

cpuguy83 commented Aug 1, 2016

Maybe with multiple it can change format so tasks are nested underneath a service... but docker service ls pretty much shows this same information, just without the individual task details.

@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Aug 1, 2016

Member

@cpuguy83 Maybe we could add an option (e.g., --detail or --tasks) to docker service ls, so that it will shown individual task details together with the services?

Member

yongtang commented Aug 1, 2016

@cpuguy83 Maybe we could add an option (e.g., --detail or --tasks) to docker service ls, so that it will shown individual task details together with the services?

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Aug 18, 2016

Member

We discussed this, and since there's no other option to show multiple services on multiple nodes, this is probably the best solution after all, so moving to code review

Member

thaJeztah commented Aug 18, 2016

We discussed this, and since there's no other option to show multiple services on multiple nodes, this is probably the best solution after all, so moving to code review

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Aug 18, 2016

Contributor

p.s.... I think this might be nice: docker service ps $(docker serivce ls -q --filter ...)

Contributor

cpuguy83 commented Aug 18, 2016

p.s.... I think this might be nice: docker service ps $(docker serivce ls -q --filter ...)

Show outdated Hide outdated api/client/service/ps.go Outdated
Show outdated Hide outdated api/client/service/ps.go Outdated
@stevvooe

This comment has been minimized.

Show comment
Hide comment
@stevvooe

stevvooe Aug 18, 2016

Contributor

This should really support name or id for service lookup.

Contributor

stevvooe commented Aug 18, 2016

This should really support name or id for service lookup.

@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Aug 20, 2016

Member

Thanks @thaJeztah @stevvooe @cpuguy83. I have updated the pull request and now with both name prefix and ID searched for services.

One thing I am not sure is the return code when some (or all of the) terms searched does not found service with matched ID or matched name prefix. The currently PR will return empty result (but no error). Should we return error on it? Would like to hear suggestions on this scenario.

Member

yongtang commented Aug 20, 2016

Thanks @thaJeztah @stevvooe @cpuguy83. I have updated the pull request and now with both name prefix and ID searched for services.

One thing I am not sure is the return code when some (or all of the) terms searched does not found service with matched ID or matched name prefix. The currently PR will return empty result (but no error). Should we return error on it? Would like to hear suggestions on this scenario.

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Aug 25, 2016

Contributor

@yongtang Probably best to look at docker inspect output in this scenario.

Contributor

cpuguy83 commented Aug 25, 2016

@yongtang Probably best to look at docker inspect output in this scenario.

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Aug 25, 2016

Contributor

Name prefix is a bit wierd, particularly when you have services with similar names, e.g. test and test2

Contributor

cpuguy83 commented Aug 25, 2016

Name prefix is a bit wierd, particularly when you have services with similar names, e.g. test and test2

@stevvooe

This comment has been minimized.

Show comment
Hide comment
@stevvooe

stevvooe Aug 27, 2016

Contributor

@cpuguy83

Name prefix is a bit wierd, particularly when you have services with similar names, e.g. test and test2

Yes, but we've specified an algorithm that should work in most cases.

It must be modified here, since ambiguous lookups are no longer an error but a merge.

Contributor

stevvooe commented Aug 27, 2016

@cpuguy83

Name prefix is a bit wierd, particularly when you have services with similar names, e.g. test and test2

Yes, but we've specified an algorithm that should work in most cases.

It must be modified here, since ambiguous lookups are no longer an error but a merge.

@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Aug 29, 2016

Member

Thanks @cpuguy83 @stevvooe. The pull request has been updated. Now service ps will return error in case any one of the name/ID can not be found, similar to docker inspect. Please let me know if there are any issues.

Member

yongtang commented Aug 29, 2016

Thanks @cpuguy83 @stevvooe. The pull request has been updated. Now service ps will return error in case any one of the name/ID can not be found, similar to docker inspect. Please let me know if there are any issues.

Show outdated Hide outdated api/client/service/ps.go Outdated
@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah
Member

thaJeztah commented Sep 21, 2016

@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Oct 5, 2016

Member

@stevvooe the PR has been updated. Please take a look and let me know if there are any issues.

Member

yongtang commented Oct 5, 2016

@stevvooe the PR has been updated. Please take a look and let me know if there are any issues.

@stevvooe

This comment has been minimized.

Show comment
Hide comment
@stevvooe

stevvooe Oct 14, 2016

Contributor

LGTM

Contributor

stevvooe commented Oct 14, 2016

LGTM

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Oct 21, 2016

Member

@yongtang could you do another rebase? I'll try to get this moving again

docs LGTM

Member

thaJeztah commented Oct 21, 2016

@yongtang could you do another rebase? I'll try to get this moving again

docs LGTM

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Oct 21, 2016

Member

ping @dnephin could you give this a review?

Member

thaJeztah commented Oct 21, 2016

ping @dnephin could you give this a review?

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Oct 21, 2016

Member

also /cc @albers @sdurrheimer as this need changes to the completion scripts

Member

thaJeztah commented Oct 21, 2016

also /cc @albers @sdurrheimer as this need changes to the completion scripts

Show outdated Hide outdated cli/command/service/ps.go Outdated
@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Dec 1, 2016

Member

@dnephin I updated the PR and now there are only 2 service calls instead of n * 2 service calls. Please take a look and see if it fit the requirement.

Member

yongtang commented Dec 1, 2016

@dnephin I updated the PR and now there are only 2 service calls instead of n * 2 service calls. Please take a look and see if it fit the requirement.

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Dec 2, 2016

Member

Thanks, this design works for me

Member

dnephin commented Dec 2, 2016

Thanks, this design works for me

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Dec 22, 2016

Member

ping @yongtang looks like this needs a rebase

Member

thaJeztah commented Dec 22, 2016

ping @yongtang looks like this needs a rebase

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Dec 22, 2016

Member

ping @dnephin LGTY? If so we're ready to merge I think

Member

thaJeztah commented Dec 22, 2016

ping @dnephin LGTY? If so we're ready to merge I think

Support multiple service IDs on "docker service ps"
This fix tries to address issue raised in 25228 to support
multiple service IDs on `docker service ps`.

Multiple IDs are allowed with `docker service ps ...`, and
related documentation has been updated.

A test has been added to cover the changes.

This fix fixes 25228.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang

This comment has been minimized.

Show comment
Hide comment
@yongtang

yongtang Dec 22, 2016

Member

@thaJeztah @dnephin The PR has been rebased. Thanks.

Member

yongtang commented Dec 22, 2016

@thaJeztah @dnephin The PR has been rebased. Thanks.

@dnephin

LGTM

@thaJeztah thaJeztah added this to the 1.14.0 milestone Jan 2, 2017

@vdemeester vdemeester merged commit 1826559 into moby:master Jan 3, 2017

4 checks passed

dco-signed All commits are signed
experimental Jenkins build Docker-PRs-experimental 28693 has succeeded
Details
janky Jenkins build Docker-PRs 37284 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 8716 has succeeded
Details

@yongtang yongtang deleted the yongtang:25228-service-ps-multiple-ID branch Jan 3, 2017

dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017

Merge pull request moby#25234 from yongtang/25228-service-ps-multiple-ID
Support multiple service IDs on "docker service ps"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment