dragonflyoss / nydus

Nydus - the Dragonfly image service, providing fast, secure and easy access to container images.
https://nydus.dev/
Apache License 2.0
1.23k stars 205 forks source link

nydus-image: refactor unpack/compact cli interface #1606

Closed SToPire closed 2 months ago

SToPire commented 3 months ago

Since unpack and compact subcommands does not need the entire nydusd configuration file, let's refactor their cli interface and directly take backend configuration file.

Specifically, we introduce --backend-type, --backend-config and --backend-config-file options to specify the backend type and remove --config option.

Fixes: #1602

Relevant Issue (if applicable)

1602

Details

Introduce --backend-type, --backend-config and --backend-config-file options for unpack and compact subcommands in nydus-image.

Types of changes

Checklist

SToPire commented 3 months ago

As it may break the existing usage of nydus-image unpack, I hope to take more advices for this PR. Then I will add the corresponding tests and update the doc.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 157 lines in your changes missing coverage. Please review.

Project coverage is 61.28%. Comparing base (3eb5c7b) to head (4ad1e46). Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/bin/nydus-image/main.rs 0.00% 110 Missing :warning:
storage/src/factory.rs 0.00% 47 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/dragonflyoss/nydus/pull/1606/graphs/tree.svg?width=650&height=150&src=pr&token=OBUY0LM4EN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)](https://app.codecov.io/gh/dragonflyoss/nydus/pull/1606?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) ```diff @@ Coverage Diff @@ ## master #1606 +/- ## ========================================== - Coverage 61.42% 61.28% -0.14% ========================================== Files 146 146 Lines 48040 48143 +103 Branches 46007 46110 +103 ========================================== - Hits 29510 29506 -4 - Misses 16971 17075 +104 - Partials 1559 1562 +3 ``` | [Files with missing lines](https://app.codecov.io/gh/dragonflyoss/nydus/pull/1606?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [storage/src/factory.rs](https://app.codecov.io/gh/dragonflyoss/nydus/pull/1606?src=pr&el=tree&filepath=storage%2Fsrc%2Ffactory.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-c3RvcmFnZS9zcmMvZmFjdG9yeS5ycw==) | `37.94% <0.00%> (-12.06%)` | :arrow_down: | | [src/bin/nydus-image/main.rs](https://app.codecov.io/gh/dragonflyoss/nydus/pull/1606?src=pr&el=tree&filepath=src%2Fbin%2Fnydus-image%2Fmain.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-c3JjL2Jpbi9ueWR1cy1pbWFnZS9tYWluLnJz) | `0.63% <0.00%> (-0.03%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/dragonflyoss/nydus/pull/1606/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)