Repository navigation
Conversation
cvas22
force-pushed
the
feat/compose-stats
branch
from
October 30, 2026 14:17
f0c1dd6 to
d842d72
Compare
Contributor
Author
|
The failing jobs aren't failing in |
cvas22
force-pushed
the
feat/compose-stats
branch
from
November 4, 2026 02:13
d842d72 to
0ac74e5
Compare
Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
cvas22
force-pushed
the
feat/compose-stats
branch
from
November 4, 2026 07:52
0ac74e5 to
6e5c375
Compare
compose stats held the global compose lock until it exited. Without --no-stream it runs until interrupted, so it blocked every other compose command in the meantime. Release the lock before streaming, as compose logs does (containerd#3678). Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
cvas22
force-pushed
the
feat/compose-stats
branch
from
November 5, 2026 17:41
89d0132 to
4ee788c
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added
nerdctl compose stats, one of the Compose commands still listed as unimplemented in the command reference (tracked in #3867).It follows
docker compose stats:nerdctl compose stats [SERVICE...]shows the live resource usage of the project's containers, or only those of the given services.-a/--all,--format,--no-streamand--no-truncwork as innerdctl stats.--allincludes stopped ones.The command collects the project's container IDs and hands them to the existing
container.Stats, the same waycompose topreusescontainer.Top, so the output and formats are identical tonerdctl stats. When the project has no matching containers it returns right away, becausecontainer.Statswith no IDs would show every container on the host.Changes:
cmd/nerdctl/compose/compose_stats.go: the commandcmd/nerdctl/compose/compose_stats_linux_test.go: tests for all services, one service, and a stopped service skipped by defaultdocs/command-reference.md: documented the command and removed it from the unimplemented listNotes
I ran
TestComposeStatslocally as root in a privileged container, with containerd and buildkitd from theout-fullbuild andnerdctlbuilt from this branch:golangci-lint(the version pinned in the Makefile) reports 0 issues for./cmd/nerdctl/compose/, for both Linux and Windows. I haven't tried rootless mode.I also had a subtest for
--allwith a stopped service. It passed locally, where containerd v2 runs rootful, but in CI it timed out after 3 minutes on the containerd v1.7.36 and rootless jobs (stats --all --no-stream ... svc1never returned).compose statspasses the container IDs to the samecontainer.Statsthatnerdctl statsuses, and nothing testsnerdctl stats --no-streamon a stopped container, so I suspect the same hang withnerdctl stats --no-stream <stopped container>on those setups. I haven't confirmed that. I removed that subtest from this PR instead of guessing at a fix incontainer.Stats, and I'm happy to look into it separately if you'd like.