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 file descriptors #74

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Conversation

snprajwal
Copy link
Member

@snprajwal snprajwal commented Jun 18, 2023

The file descriptors opened by the processes in the checkpoint can now be viewed with the --fds flag. This currently displays the file type, FD, and the path.

An example output for a checkpoint of httpd container (provided by @rst0git):

test
├── Image: docker.io/library/httpd:2.4
├── ID: 41ddbcab288ab3d2d119896aa96187b474bbe3084640b6559b0edc0a41f12277
├── Runtime: crun
├── Created: 2023-07-06T09:08:34+01:00
├── Engine: Podman
├── Checkpoint Size: 5.2 MiB
├── Root Fs Diff Size: 2.0 KiB
└── Process tree
    └── [1]  httpd
        ├── [3]  httpd
        │   ├── [REG 0]  /dev/null
        │   ├── [PIPE 1]  pipe[793149]
        │   ├── [PIPE 2]  pipe[793150]
        │   ├── [INETSK 3]  INETSK.36
        │   ├── [INETSK 4]  INETSK.37
        │   ├── [PIPE 5]  pipe[794937]
        │   ├── [PIPE 6]  pipe[794937]
        │   ├── [PIPE 7]  pipe[793149]
        │   ├── [EVENTPOLL 8]  EVENTPOLL.44
        │   ├── [PIPE 9]  pipe[796833]
        │   ├── [PIPE 10]  pipe[796833]
        │   ├── [cwd]  /usr/local/apache2
        │   └── [root]  /
        ├── [4]  httpd
        │   ├── [REG 0]  /dev/null
        │   ├── [PIPE 1]  pipe[793149]
        │   ├── [PIPE 2]  pipe[793150]
        │   ├── [INETSK 3]  INETSK.36
        │   ├── [INETSK 4]  INETSK.37
        │   ├── [PIPE 5]  pipe[794937]
        │   ├── [PIPE 6]  pipe[794937]
        │   ├── [PIPE 7]  pipe[793149]
        │   ├── [EVENTPOLL 8]  EVENTPOLL.49
        │   ├── [PIPE 9]  pipe[789308]
        │   ├── [PIPE 10]  pipe[789308]
        │   ├── [cwd]  /usr/local/apache2
        │   └── [root]  /
        ├── [5]  httpd
        │   ├── [REG 0]  /dev/null
        │   ├── [PIPE 1]  pipe[793149]
        │   ├── [PIPE 2]  pipe[793150]
        │   ├── [INETSK 3]  INETSK.36
        │   ├── [INETSK 4]  INETSK.37
        │   ├── [PIPE 5]  pipe[794937]
        │   ├── [PIPE 6]  pipe[794937]
        │   ├── [PIPE 7]  pipe[793149]
        │   ├── [EVENTPOLL 8]  EVENTPOLL.54
        │   ├── [PIPE 9]  pipe[792449]
        │   ├── [PIPE 10]  pipe[792449]
        │   ├── [cwd]  /usr/local/apache2
        │   └── [root]  /
        ├── [REG 0]  /dev/null
        ├── [PIPE 1]  pipe[793149]
        ├── [PIPE 2]  pipe[793150]
        ├── [INETSK 3]  INETSK.36
        ├── [INETSK 4]  INETSK.37
        ├── [PIPE 5]  pipe[794937]
        ├── [PIPE 6]  pipe[794937]
        ├── [PIPE 7]  pipe[793149]
        ├── [cwd]  /usr/local/apache2
        └── [root]  /

@codecov-commenter
Copy link

codecov-commenter commented Jun 18, 2023

Codecov Report

Patch coverage: 85.61% and project coverage change: +2.17 🎉

Comparison is base (69a4966) 80.00% compared to head (6a534c5) 82.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   80.00%   82.17%   +2.17%     
==========================================
  Files           3        4       +1     
  Lines         435      533      +98     
==========================================
+ Hits          348      438      +90     
- Misses         64       70       +6     
- Partials       23       25       +2     
Impacted Files Coverage Δ
container.go 76.19% <76.54%> (-4.04%) ⬇️
checkpointctl.go 90.44% <88.28%> (+3.49%) ⬆️
tree.go 90.32% <90.32%> (ø)

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

@github-actions
Copy link

github-actions bot commented Jun 18, 2023

Test Results

36 tests  +3   36 ✔️ +3   0s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ±0 

Results for commit 064f017. ± Comparison against base commit 5a00d39.

♻️ This comment has been updated with latest results.

checkpointctl.go Outdated Show resolved Hide resolved
@snprajwal snprajwal force-pushed the add-fds branch 4 times, most recently from c17e722 to fb813c2 Compare June 24, 2023 09:38
@snprajwal snprajwal marked this pull request as ready for review July 3, 2023 15:55
@snprajwal snprajwal requested a review from rst0git July 3, 2023 15:55
checkpointctl.go Outdated Show resolved Hide resolved
@snprajwal snprajwal force-pushed the add-fds branch 2 times, most recently from 53df1e2 to 970187f Compare July 6, 2023 07:01
checkpointctl.go Outdated Show resolved Hide resolved
test/checkpointctl.bats Outdated Show resolved Hide resolved
checkpointctl.go Outdated Show resolved Hide resolved
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

@adrianreber
Copy link
Member

The binary size check does not seem to work any more. I just see one run of it. No comparison.

Can you add an example of what this looks like in the PR description?

@snprajwal
Copy link
Member Author

The binary size workflow should be working now, I rebased this branch against main.

@snprajwal snprajwal force-pushed the add-fds branch 2 times, most recently from de4c12b to e94cd18 Compare July 10, 2023 10:01
@snprajwal snprajwal requested a review from rst0git July 10, 2023 10:03
@snprajwal
Copy link
Member Author

I forgot to do a nil pointer check while searching for the process node in the tree. Updated the commit with those changes now.

tree.go Outdated Show resolved Hide resolved
tree.go Outdated Show resolved Hide resolved
The file descriptors opened by the processes in the checkpoint can now
be viewed with the `--fds` flag.

Signed-off-by: Prajwal S N <[email protected]>
@rst0git rst0git merged commit dd4e7a9 into checkpoint-restore:main Jul 11, 2023
10 checks passed
@snprajwal snprajwal deleted the add-fds branch July 12, 2023 15:14
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