checkpoint-restore / checkpointctl

A tool for in-depth analysis of container checkpoints
Apache License 2.0
95 stars 15 forks source link

feat: display process tree with environment variables #90

Closed behouba closed 1 year ago

behouba commented 1 year ago

This commit introduces a new flag, --ps-tree-env, which enables the display of process environment variables in the process tree output.

Example output:

$ checkpointctl inspect --ps-tree-cmd /path/to/checkpoint.tar.gz 

Displaying container checkpoint tree view from /home/behouba/checkpoints/httpd.tar.gz

httpd
├── Image: docker.io/library/httpd:2.4
├── ID: 4f6831a7e8e641e75578704cb90bcbd987b6d9655404b58f5cbf954d042f3212
├── Runtime: crun
├── Created: 2023-07-22T13:14:49+03:00
├── Engine: Podman
├── Checkpoint size: 5.2 MiB
├── Root FS diff size: 2.0 KiB
└── Process tree
    └── [1]  httpd
        ├── HTTPD_VERSION=2.4.57
        ├── HOSTNAME=4f6831a7e8e6
        ├── HOME=/root
        ├── HTTPD_PATCHES=rewrite-windows-testchar-h.patch 1d5620574fa03b483262dc5b9a66a6906553389952ab5d3070a02f887cc20193
        ├── container=podman
        ├── TERM=xterm
        ├── PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        ├── HTTPD_SHA256=dbccb84aee95e095edfbb81e5eb926ccd24e6ada55dcd83caecb262e5cf94d2a
        ├── HTTPD_PREFIX=/usr/local/apache2
        ├── PWD=/usr/local/apache2
        ├── [4]  httpd
        │   ├── HTTPD_VERSION=2.4.57
        │   ├── HOSTNAME=4f6831a7e8e6
        │   ├── HOME=/root
        │   ├── HTTPD_PATCHES=rewrite-windows-testchar-h.patch 1d5620574fa03b483262dc5b9a66a6906553389952ab5d3070a02f887cc20193
        │   ├── container=podman
        │   ├── TERM=xterm
        │   ├── PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        │   ├── HTTPD_SHA256=dbccb84aee95e095edfbb81e5eb926ccd24e6ada55dcd83caecb262e5cf94d2a
        │   ├── HTTPD_PREFIX=/usr/local/apache2
        │   └── PWD=/usr/local/apache2
github-actions[bot] commented 1 year ago

Test Results

42 tests  +2   42 :heavy_check_mark: +2   1s :stopwatch: ±0s   1 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit 2105caa1. ± Comparison against base commit ca6d9efe.

:recycle: This comment has been updated with latest results.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 23.07% and project coverage change: -3.95 :warning:

Comparison is base (b88a99f) 82.43% compared to head (21a22b7) 78.48%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #90 +/- ## ========================================== - Coverage 82.43% 78.48% -3.95% ========================================== Files 4 4 Lines 558 595 +37 ========================================== + Hits 460 467 +7 - Misses 72 100 +28 - Partials 26 28 +2 ``` | [Impacted Files](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/90?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [container.go](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/90?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29udGFpbmVyLmdv) | `71.42% <0.00%> (-4.77%)` | :arrow_down: | | [tree.go](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/90?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-dHJlZS5nbw==) | `83.06% <33.33%> (-4.12%)` | :arrow_down: | | [checkpointctl.go](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/90?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y2hlY2twb2ludGN0bC5nbw==) | `87.69% <37.50%> (-4.49%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.