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

feat: display process tree with environment variables #90

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

behouba
Copy link
Collaborator

@behouba behouba commented Jul 19, 2023

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
Copy link

github-actions bot commented Jul 19, 2023

Test Results

42 tests  +2   42 ✔️ +2   1s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ±0 

Results for commit 2105caa. ± Comparison against base commit ca6d9ef.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2023

Codecov Report

Patch coverage: 23.07% and project coverage change: -3.95 ⚠️

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

Additional details and impacted files
@@            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 Coverage Δ
container.go 71.42% <0.00%> (-4.77%) ⬇️
tree.go 83.06% <33.33%> (-4.12%) ⬇️
checkpointctl.go 87.69% <37.50%> (-4.49%) ⬇️

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

checkpointctl.go Outdated Show resolved Hide resolved
checkpointctl.go Outdated Show resolved Hide resolved
@behouba behouba force-pushed the ps-tree-env branch 4 times, most recently from 8a354e0 to 7ca1003 Compare July 24, 2023 15:07
@behouba behouba marked this pull request as ready for review July 24, 2023 18:34
Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Signed-off-by: Kouame Behouba Manasse <[email protected]>
@rst0git rst0git merged commit 8e4f577 into checkpoint-restore:main Jul 26, 2023
10 checks passed
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.

4 participants