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

#191 Docker Compose support #209

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

stokito
Copy link
Contributor

@stokito stokito commented Oct 26, 2020

First few commits are kind of refactoring and preparation for the next commits with feature.
Please read comments with description.

To be done:

  1. I implemented the grouping for other connectors. But for runc connector currently will be shown only one empty group. I don't know if runc uses any kinds of groups.
  2. I don't know how to make it looks like a tree so I'll need your help here.

During debug it may happen that c.stream is already closed but we are trying to send a metric to the closed channel
Instead of setting all fields to -1 we can set them to zero.
Since zero is a default fields value then we can omit manual initialization.
This means that we don't need the whole New() method
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
# Conflicts:
#	connector/docker.go
Portainer uses term Stack for Docker Compose projects so to make terminology familiar let's rename in ctop
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.

None yet

1 participant