Skip to content

DAOS-4988 control: Provide client with same class network device - #2894

Merged
mjmac merged 27 commits into
masterfrom
jbrosenz-daos-4988
Jun 23, 2020
Merged

mjmac merged 27 commits into
masterfrom
jbrosenz-daos-4988

Conversation

@jbrosenz

@jbrosenz jbrosenz commented Jun 9, 2020 •

Copy link
Copy Markdown
Contributor
    daos_server now examines the network device class that the
    daos_io_server is using and shares that with the
    daos_agent via GetAttachInfo.

    daos_agent now filters the network devices available for
    automatic assignment to clients to avoid assigning clients
    to networks that may not be compatible with the
    daos_io_server.

    In practice, this means that if the daos_io_server is using
    network device ib0, an Infiniband device, the agent will
    assign an Infiniband device.  If the daos_io_server is
    using eth0, an Ethernet device, the agent will assign an
    Ethernet device.

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>

jbrosenz added 5 commits June 2, 2020 14:59
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
    daos_server now examines the network device class that the
    daos_io_server is using and shares that with the
    daos_agent via GetAttachInfo.

    daos_agent now filters the network devices available for
    automatic assignment to clients to avoid assigning clients
    to networks that may not be compatible with the
    daos_io_server.

    In practice, this means that if the daos_io_server is using
    a network device ib0, an Infiniband device, the agent will
    assign an Infiniband device.  If the daos_io_server is
    using an Ethernet device, the agent will assign an Ethernet
    device.

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>

Conflicts:
	src/control/common/proto/mgmt/mgmt.pb.go
	src/control/common/proto/mgmt/pool.pb.go
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
src/control/common/proto/ctl/network_scan.pb.go

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>

@mjmac mjmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The "meat" of the change is overall OK, some small adjustments needed. It appears that you need to fix your versions of protobuf and friends, though.

For future reference, the fact that there are so many changes to generated protobuf files that have nothing to do with your changes is a strong indicator that something is amiss and that you probably need to fix something before committing/pushing.

Comment thread src/control/common/proto/ctl/common.pb.go Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/server/server.go Outdated
jbrosenz added 4 commits June 9, 2020 22:46
Sanity checks all of the IO servers to make sure they
have the same network device class.

Made strconv edits.

Updated error messages in netdetect to remove references
for tools using the library.

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
@jbrosenz

Copy link
Copy Markdown
Contributor Author

I forgot to run through gofmt. I'll fix that and update.

@jbrosenz

Copy link
Copy Markdown
Contributor Author

Yeah, so I was too trigger happy. I broke unit tests with the latest changes and merrily forgot all about them. I'll fix that and then push again. Sorry for the spam.

@daosbuild1

Copy link
Copy Markdown
Collaborator

@mjmac mjmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have you also verified that your version of protoc-gen-go is correct?

Comment thread src/control/lib/netdetect/netdetect.go
Comment thread src/control/fault/code/codes.go Outdated
jbrosenz added 8 commits June 11, 2020 17:51
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Updated srv.pb.go as a result

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Rebuilt srv.pb.go

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
automatically grab the correct version of protoc-gen-go
based on the value in go.mod

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
plugin is now updated automatically

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
@jbrosenz
jbrosenz requested a review from mjmac June 12, 2020 15:42
@daosbuild1

Copy link
Copy Markdown
Collaborator

Test stage run_test.sh completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-2894/6/display/redirect

mjmac
mjmac previously approved these changes Jun 12, 2020

@mjmac mjmac left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, though I remain concerned that the lack of automated test coverage in this area is likely to result in continued defect reports.

Comment thread src/control/server/faults.go Outdated
@jbrosenz
jbrosenz requested review from kjacque and tanabarr June 12, 2020 19:37
@jbrosenz

Copy link
Copy Markdown
Contributor Author

LGTM, though I remain concerned that the lack of automated test coverage in this area is likely to result in continued defect reports.

We shouldn't land it if you do not like it. So let's discuss adding in an appropriate amount of automated test coverage. These are the highlights that are occurring in this PR. 1) detecting the network device class, 2) sharing that with the agent via the GetAttachInfo gRPC, 3) having the agent filter the devices added to the attach info cache based on the network device class provided, and 4) validating that each IO server instance is configured with, and starts with the same device class.

Do you have concerns with all 4 areas, or something in particular that would benefit from some unit testing?

@daosbuild1

Copy link
Copy Markdown
Collaborator

Test stage Functional completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-2894/7/display/redirect

@mjmac

mjmac commented Jun 13, 2020

Copy link
Copy Markdown
Contributor

We shouldn't land it if you do not like it.

It's not that I don't like it. It's that I would be happier about landing it if there were a lot more tests demonstrating that it works now and will continue to work after future refactoring and other changes. Tests are also a good way to programmatically express requirements and explore possibilities before they're encountered in the real world.

So let's discuss adding in an appropriate amount of automated test coverage. These are the highlights that are occurring in this PR. 1) detecting the network device class, 2) sharing that with the agent via the GetAttachInfo gRPC, 3) having the agent filter the devices added to the attach info cache based on the network device class provided, and 4) validating that each IO server instance is configured with, and starts with the same device class.

Do you have concerns with all 4 areas, or something in particular that would benefit from some unit testing?

  1. Is tricky, given that it requires interaction with the system unless you're using stubs, and then you're just testing the stubs. The best way to handle this kind of thing is to keep the untestable stuff as separate from the "business logic" as possible. In the case of the netdetect library, this might mean changing things around a bit to pass things like device affinity into createFabricScanEntry() so that a set of table-driven unit tests can explore possibilities with a variety of synthetic inputs. This might arguably be outside the scope of this PR and I'm not insisting on it. I would suggest opening another low-priority ticket to address it as a background task, though.

  2. can be accomplished with a new TestServer_MgmtSvc_GetAttachInfo set of tests. I was going to suggest that you could just add on to what's already there, but I just looked and realized that no one ever added a set of test cases for that RPC handler. It's an ancient one that predates my time here. It could go alongside of TestServer_MgmtSvc_LeaderQuery and draw inspiration from it.

  3. looks pretty straightforward, unless I'm missing something... You already have some test coverage for the attachInfoCache, so adding a scenario to verify that the filtering works as expected should be pretty easy.

For 4), you could add a test to server/config_test.go to validate that a config with two different interface types fails validation. You added the ability to stub out the real GetDeviceClass(), so this should be trivial. I don't think we need to go further than that.

@kjacque kjacque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In general, I agree with Mike's testing comments. If you don't want to address it now, I think it should be done as a follow-on.

Comment thread doc/dev/development.md Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/server/config.go Outdated
Comment thread src/control/server/config.go Outdated
Comment thread src/control/server/ioserver/config.go Outdated
Comment thread src/control/server/server.go Outdated
jbrosenz added 7 commits June 16, 2020 16:27
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>

Conflicts:
	src/proto/Makefile
for single server case.

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
IO server config.  Instead, the value is computed at
validation time.

Updated unit tests

Moved GetDeviceClassStub out of netdetect

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Fixed a typo in a comment

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
@jbrosenz
jbrosenz requested review from kjacque and mjmac June 17, 2020 22:34
@daosbuild1

Copy link
Copy Markdown
Collaborator

Test stage Functional_Hardware_Large completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2894/10/execution/node/805/log

mjmac
mjmac previously approved these changes Jun 18, 2020
kjacque
kjacque previously approved these changes Jun 18, 2020

@kjacque kjacque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the testing, Joel. Overall it looks good, I still have a few comments about naming but they are minor, and could be addressed in a follow-on PR.

Comment thread src/control/cmd/daos_agent/infocache_test.go Outdated
Comment thread src/control/server/config_test.go
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/lib/netdetect/netdetect.go Outdated
Comment thread src/control/server/mgmt_system_test.go Outdated
jbrosenz added 2 commits June 19, 2020 15:54
instead of locally defined constants in the test code.

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
@jbrosenz
jbrosenz dismissed stale reviews from kjacque and mjmac via fd9a6b4 June 19, 2020 16:53
@jbrosenz
jbrosenz requested review from kjacque and mjmac June 19, 2020 17:01

@kjacque kjacque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@daosbuild1

Copy link
Copy Markdown
Collaborator

@daosbuild1

Copy link
Copy Markdown
Collaborator

Test stage Functional_Hardware_Large completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2894/11/execution/node/805/log

@jbrosenz

Copy link
Copy Markdown
Contributor Author

@mjmac
mjmac merged commit 3b1f7f4 into master Jun 23, 2020
@mjmac
mjmac deleted the jbrosenz-daos-4988 branch June 23, 2020 21:28
SABollinger pushed a commit that referenced this pull request Nov 11, 2020
daos_server now examines the network device class that the
daos_io_server is using and shares that with the
daos_agent via GetAttachInfo.

daos_agent now filters the network devices available for
automatic assignment to clients to avoid assigning clients
to networks that may not be compatible with the
daos_io_server.

In practice, this means that if the daos_io_server is using
network device ib0, an Infiniband device, the agent will
assign an Infiniband device.  If the daos_io_server is
using eth0, an Ethernet device, the agent will assign an
Ethernet device.

Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants