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

refactor(storage): adjust storage structure to add backend api #430

Conversation

artek-koltun
Copy link
Collaborator

@artek-koltun artek-koltun commented Jan 18, 2024

Sort out storage files to corresponding dirs since the number of file is growing, and it is getting harder to comprehend their structure. It was decided to stick to existing storage API separation for frontend/middlend/backend.
The directory structure in cmd mirrors the structure in the root storage libaray package to make it easier to match the related code.
Added frontend cmdline option in a separate commit to prepare to adding backend nvme part.

The inventory, ipsec, evpn code from cmd will be moved to corresponding dirs in the follow-up PRs.

Exemplary cmd set

ss0=$(/dpu storage create frontend nvme subsystem --nqn nqn.2019-06.io.spdk:opicli0 --hostnqn nqn.2019-06.io.spdk:opi-host0 --id subsys0)
ss1=$(/dpu storage create frontend nvme subsystem --nqn nqn.2019-06.io.spdk:opicli1 --id subsys1)
ns0=$(/dpu storage create frontend nvme namespace --subsystem "$ss0" --volume "$vol0" --id namespace0)
tcp0=$(/dpu storage create frontend nvme controller tcp --subsystem "$ss0" --ip "127.0.0.1" --port 4420 --id nvmetcp0)
pcie0=$(/dpu storage create frontend  nvme controller pcie --subsystem "$ss1" --port 0 --pf 0 --vf 0 --id pcie0)
blk0=$(/dpu storage create frontend virtio blk --volume Malloc1 --pf 0 --vf 0  --id blk0)

sleep 10

/dpu storage delete frontend virtio blk --name "$blk0"
/dpu storage delete frontend nvme controller --name "$pcie0"
/dpu storage delete frontend nvme controller --name "$tcp0"
/dpu storage delete frontend nvme namespace --name "$ns0"
/dpu storage delete frontend nvme subsystem --name "$ss1"
/dpu storage delete frontend nvme subsystem --name "$ss0"

Waiting for opiproject/opi-spdk-bridge#837 to pass CI

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6bfed82) 36.84% compared to head (ba85295) 66.43%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #430       +/-   ##
===========================================
+ Coverage   36.84%   66.43%   +29.58%     
===========================================
  Files          19       15        -4     
  Lines        2299     1275     -1024     
===========================================
  Hits          847      847               
+ Misses       1419      395     -1024     
  Partials       33       33               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@artek-koltun artek-koltun changed the title refactor(storage): adjust storage cmdline structure to add backend api refactor(storage): adjust storage structure to add backend api Jan 18, 2024
@artek-koltun artek-koltun marked this pull request as ready for review January 18, 2024 09:26
@artek-koltun artek-koltun requested a review from a team as a code owner January 18, 2024 09:26

// NewStorageCommand tests the storage functionality
func NewStorageCommand() *cobra.Command {
// NewCreateCommand creates a new command to delete frontend resources

Choose a reason for hiding this comment

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

to create

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch. Fixed!

Copy link

@intelfisz intelfisz left a comment

Choose a reason for hiding this comment

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

lgtm, found just one typo

Copy link
Contributor

@sandersms sandersms left a comment

Choose a reason for hiding this comment

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

LGTM - one failing check to resolve

@artek-koltun artek-koltun force-pushed the refactor-storage-move-existing-cmdline-to-frontend branch from d102264 to ba85295 Compare January 19, 2024 07:10
@artek-koltun artek-koltun merged commit 742ee44 into opiproject:main Jan 19, 2024
18 checks passed
Align with API structure and prepare to introducing backend Nvme

Signed-off-by: Artsiom Koltun <[email protected]>
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.

3 participants