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(storage/backend): opi-api added TcpController and FabricsPath #305

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ services:
./rpc.py nvmf_subsystem_add_host nqn.2016-06.io.spdk:cnode1 nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c && \
./rpc_http_proxy.py 0.0.0.0 9009 spdkuser spdkpass'
healthcheck:
test: ["CMD-SHELL", "python3 /usr/libexec/spdk/scripts/rpc.py spdk_get_version || exit 1"]
test:
[
"CMD-SHELL",
"python3 /usr/libexec/spdk/scripts/rpc.py spdk_get_version || exit 1"
]
interval: 6s
retries: 5
start_period: 20s
Expand All @@ -53,7 +57,7 @@ services:
depends_on:
spdk:
condition: service_healthy
command: /opi-spdk-bridge -port=50051 -spdk_addr=/var/tmp/spdk.sock
command: /opi-spdk-bridge -grpc_port=50051 -http_port=8082 -spdk_addr=/var/tmp/spdk.sock
healthcheck:
test: grpcurl -plaintext localhost:50051 list || exit 1

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/lithammer/fuzzysearch v1.1.8
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
github.com/opiproject/opi-api v0.0.0-20230918073146-388467d72071
github.com/opiproject/opi-api v0.0.0-20230919105335-6a20f2a254ac
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.15.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ github.com/opiproject/opi-api v0.0.0-20230908135156-02d38276b0f2 h1:ye6T8WPpLHuk
github.com/opiproject/opi-api v0.0.0-20230908135156-02d38276b0f2/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY=
github.com/opiproject/opi-api v0.0.0-20230918073146-388467d72071 h1:PMWBd94I5QEtwt4t+GzHI+qMeSDwgLOeuawiwsz/kx8=
github.com/opiproject/opi-api v0.0.0-20230918073146-388467d72071/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY=
github.com/opiproject/opi-api v0.0.0-20230919105335-6a20f2a254ac h1:L4OT2ftfG2YhKdBNVLICUzRUmrVS0O054KkJj+0ERcU=
github.com/opiproject/opi-api v0.0.0-20230919105335-6a20f2a254ac/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down
34 changes: 21 additions & 13 deletions storage/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
NvmeRemoteControllerId: resourceID,
NvmeRemoteController: &pb.NvmeRemoteController{
Multipath: pb.NvmeMultipath_NVME_MULTIPATH_MULTIPATH,
Hdgst: false,
Ddgst: false,
Tcp: &pb.TcpController{
Hdgst: false,
Ddgst: false,
},

Check warning on line 62 in storage/backend.go

View check run for this annotation

Codecov / codecov/patch

storage/backend.go#L59-L62

Added lines #L59 - L62 were not covered by tests
}})
if err != nil {
return err
Expand Down Expand Up @@ -131,9 +133,11 @@
NvmeRemoteControllerId: ctrlrResourceID,
NvmeRemoteController: &pb.NvmeRemoteController{
Multipath: pb.NvmeMultipath_NVME_MULTIPATH_MULTIPATH,
Hdgst: false,
Ddgst: false,
Psk: psk,
Tcp: &pb.TcpController{
Hdgst: false,
Ddgst: false,
Psk: psk,
},

Check warning on line 140 in storage/backend.go

View check run for this annotation

Codecov / codecov/patch

storage/backend.go#L136-L140

Added lines #L136 - L140 were not covered by tests
}})
if err != nil {
return err
Expand All @@ -145,12 +149,14 @@
NvmePathId: resourceID,
NvmePath: &pb.NvmePath{
Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP,
Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4,
Traddr: addr[0].String(),
Trsvcid: int64(port),
Subnqn: "nqn.2016-06.io.spdk:cnode1",
Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c",
ControllerNameRef: rr0.Name,
Fabrics: &pb.FabricsPath{
Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4,
Trsvcid: int64(port),
Subnqn: "nqn.2016-06.io.spdk:cnode1",
Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c",
},

Check warning on line 159 in storage/backend.go

View check run for this annotation

Codecov / codecov/patch

storage/backend.go#L154-L159

Added lines #L154 - L159 were not covered by tests
}})
if err != nil {
return err
Expand All @@ -175,12 +181,14 @@
NvmePath: &pb.NvmePath{
Name: np0.Name,
Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP,
Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4,
Traddr: addr[0].String(),
Trsvcid: int64(port),
Subnqn: "nqn.2016-06.io.spdk:cnode1",
Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c",
ControllerNameRef: rr0.Name,
Fabrics: &pb.FabricsPath{
Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4,
Trsvcid: int64(port),
Subnqn: "nqn.2016-06.io.spdk:cnode1",
Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c",
},

Check warning on line 191 in storage/backend.go

View check run for this annotation

Codecov / codecov/patch

storage/backend.go#L186-L191

Added lines #L186 - L191 were not covered by tests
}})
if err != nil {
return err
Expand Down
10 changes: 6 additions & 4 deletions storage/goopicsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@
NvmePath: &pb.NvmePath{
ControllerNameRef: response.Name,
Traddr: trAddr,
Subnqn: subnqn,
Trsvcid: trSvcID,
Hostnqn: hostnqn,
Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP,
Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4,
Fabrics: &pb.FabricsPath{
Subnqn: subnqn,
Trsvcid: trSvcID,
Hostnqn: hostnqn,
Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4,
},

Check warning on line 78 in storage/goopicsi.go

View check run for this annotation

Codecov / codecov/patch

storage/goopicsi.go#L73-L78

Added lines #L73 - L78 were not covered by tests
},
})
if err != nil {
Expand Down
Loading