-
Notifications
You must be signed in to change notification settings - Fork 527
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
Adding docker-compose project display #191
Comments
Hello @bcicen, do you think it'd be interesting to add this feature ? |
I think that would be a useful feature. |
If container started from docker-compose then it will have a group of labels with "com.docker.compose." prefix. You can make docker inspect :
We can group containers if they have the same |
I'd pay a $50 bounty for someone to implement this (through GitTip/paypal/sponsors/whatever your platform of choice). It would vastly improve my ctop experience and I rely on ctop for about a minute ~50 times a year. I don't know how complex the ctop internals are so it may not be enough to entice anyone, but hey, it's more than nothing and open-source is real work that doesn't have a good compensation system right now, so donations/bounties are how I try to help 🤷. I'm imagining a UX like this for viewing docker-compose containers grouped by project in ctop (with aggregate totals for each project): $ cd /opt/mailu
$ docker-compose up -d
$ cd /opt/matomo
$ docker-compose up -d
...
$ ctop --compose ctop - 18:26:16 UTC 2 projects 15 containers
NAME CID CPU MEM NET RX/TX IO R/W PIDS
+ ◉ mailu /opt/mailu 2% 717M 3.5G / 2.2G 314M / 6.5G 71
✚ ◉ mailu_admin_1 567c6e40c9f4 0% 216M / 3.84G 622M / 847M 24M / 0B 6
✚ ◉ mailu_antispam_1 99c2490bd075 0% 71M / 3.84G 155M / 141M 28M / 54M 4
✚ ◉ mailu_database_1 b6531b18a9da 1% 29M / 3.84G 523M / 382M 183M / 1.59G 15
◉ mailu_fetchmail_1 fe26570a0690 0% 14M / 3.84G 910K / 877K 6M / 0B 1
✚ ◉ mailu_front_1 8b30aab48008 1% 16M / 3.84G 584M / 681M 24M / 36K 4
✚ ◉ mailu_imap_1 82b02542519f 0% 26M / 3.84G 2M / 4M 15M / 1M 7
◉ mailu_redis_1 d83e1fb2d8a4 0% 6M / 3.84G 220M / 70M 7M / 5.47G 5
✚ ◉ mailu_resolver_1 8de8dc0f89fc 0% 18M / 3.84G 362M / 167M 18M / 88K 1
✚ ◉ mailu_smtp_1 f926e3697ae1 0% 44M / 3.84G 116M / 145M 9M / 74M 18
✚ ◉ mailu_webdav_1 04a6fc7242ad 0% 216M / 3.84G 49K / 480B 9M / 0B 1
✚ ◉ mailu_webmail_1 a1e27e2af6ad 0% 61M / 3.84G 7M / 27M 32M / 12K 9
+ ◉ matomo /opt/matomo 1% 234M 1.9G / 1.5G 239M / 2.9G 25
◉ matomo_argo_1 d109f307c457 1% 14M / 512M 566M / 262M 524K / 0B 11
✚ ◉ matomo_mariadb_1 4b1d45531c84 0% 181M / 1.95G 186M / 338M 144M / 2.49G 8
◉ matomo_phpfpm_1 b5953347d1db 0% 37M / 1.95G 360M / 684M 90M / 460M 4
✚ ◉ matomo_nginx_1 fb472389be8b 0% 2M / 512M 566M / 262M 2M / 0B 2 |
@pirate if the project author is not interested then I'll try to implement this on Monday. Right now I have a spare week and I anyway wanted to try programming in Go |
Added "compose project", "compose service", "compose config", "compose workdir" fields. They are shown in container info view. Since the fields may be empty so added a condition to show them only if they have a value
Added "compose project", "compose service", "compose config", "compose workdir" fields. Now I would like to discuss how to properly design UI.
Pros: Or we may just add a prefix to name with compose
Pros: My proposition is to use a third simplest possible solution: keep almost everything as is ;) This is easy to implement and covers most basic needs. |
The tree view with aggregate totals for each project is important in my mind 😅, because I use 3-8 compose projects on each server, with about 6 servers running at any time. Seeing high total memory/CPU/IO being used is the main thing I'm looking for as a red flag to investigate high load or failure on a particular project. Why not sort by both? E.g. list the projects using the most aggregate memory from top -> bottom, then within each project, sort the leaf containers by memory use as well. |
…then by name In 99% of cases container name anyway contains its compose project name. For example we have a folder wp which has docker-compose.yaml with two services: db and wordpress. Then after docker-compose up container names will be: wp_wordpress_1 and wp_db_1. But in docker-compose.yaml for a specific service may be explicitly set `container_name` e.g. for wordpress service it may be just "blog". Or some other container that is not part of compose project may have a similar name like wp_admin. Then on sorting by name we'll see: blog <- part of wp compose project wp_admin <- NOT part of wp compose project wp_db <- part of wp compose project To keep container always together on name sorting we'll first sort by compose project and only then by container name inside of the project. Thus we'll always have: wp_admin blog wp_db In this case blog and wp_db was sorted separately.
I see, we just have different usage scenarios: for me as a developer the most important is to easily shutdown compose projects but for you as server admin is more important to see usages. |
Added "compose project", "compose service", "compose config", "compose workdir" fields. They are shown in container info view. Since the fields may be empty so added a condition to show them only if they have a value
Each container have a Project which may represent a Docker Compose project. The name of project is simply the name of folder from which `docker-compose up` executed. If container was started not from Compose then it anyway will be assigned to the noneProject with empty name. Each project will be rendered as a separate CompactRow widget. Currently to determine that this line is a project instead of status will be shown a down arrow ▼. TBD: use ident instead. All containers will be sorted by the project first and only then by name. On rendering in grid.go we know that containers from the same project are always together. Rendered result looks like: ▼ ◉ container1 ◉ container2 ▼ proj1 ◉ proj1_db ◉ proj1_serv ▼ proj2 ◉ proj2_db ◉ proj2_serv
We can't sort by id ot status as we did it for project's metrics. But at least inside of a project we can sort. I.e. we anyway sort by project name and only then by status or id
Hi @pirate please checkout and test my branch stokito:docker_compose |
Could you bump the grouping carets out 1 character to the left so that the hierarchy can be visually scanned a bit easier? other than that it looks great @stokito! |
At this moment we can't: down arrow is shown if status is empty which happens only for groups while empty health check column is almost always empty by itself.
|
Could maybe the caret be a separate new first column? That way it would be on a different vertical level. |
In 6b96656 I tried to make the stack triangle look better: I used a Small Triangle symbol because it looks better in Monospace (default font in Ubuntu's terminal). Also the symbol is from Unicode 1993 so probably it will supported much better then others newer. @pirate thank you, I just found a job so you can donate to some other project. |
I think adding something to display that some containers have been created from the same docker-compose project could be interesting.
Maybe something as htop tree view.
If you think it's worth it, what could be worth implementing in order to have a first interesting integration?
The text was updated successfully, but these errors were encountered: