Skip to content

Conversation

@portante
Copy link
Member

We need to properly determine whether a given address for a host, IP or name, refers to the local host or to a remote host.

In all the case where it is used (tool registration, Tool Meister sub-system, bench-scripts (pbench-fio and pbench-uperf, primarily), we need to record at the time a bench-script is run which address is local vs remote.

We also need to make sure that we don't register tools for the same local host under different names.

We also need to ensure bench-scripts, i.e. pbench-uperf and pbench-fio, know the difference between local and remote hosts to avoid ssh operations where possible.

@portante portante added enhancement Agent fio pbench-fio benchmark related uperf pbench-uperf benchmark related tools Of and related to the operation and behavior of various tools (iostat, sar, etc.) labels Nov 13, 2021
@portante portante added this to the v0.71 milestone Nov 13, 2021
@portante portante self-assigned this Nov 13, 2021
Copy link
Member

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

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

Just a minor comment comment and a major philosophical rabbit hole ... that's all. 🤣

Copy link
Member Author

@portante portante left a comment

Choose a reason for hiding this comment

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

Keep in mind this is still a Draft PR, so the interface may change as I continue to work at how we can leverage it throughout our code.

Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

Looks like a good start.

My principal reservation is that the netifaces package is not a "pure-Python" package (it of necessity contains platform-specific code) and does not currently have a maintainer, not to mention the fact that it's not available (as far as we know) as an RPM. So, while it's a very cool package, we need to ensure that our dependency on it is highly encapsulated, so that we can rip it out if needed. (E.g., if we have to, we could replace it with a small set of heuristics.)

@portante portante force-pushed the is-remote branch 2 times, most recently from 1dabe45 to 4ca8579 Compare November 16, 2021 00:01
@portante portante force-pushed the is-remote branch 4 times, most recently from 4f0fb46 to c29e387 Compare November 18, 2021 04:36
@portante portante marked this pull request as ready for review November 18, 2021 04:36
@portante portante requested review from dbutenhof and webbnh November 18, 2021 04:37
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

  • The mocking for LocalRemoteHost should be done in some other way.
  • pbench-is-remote should have a proper docstring.
  • I think we should reconsider whether/how we work with all of the target addresses (when there is more than one); and, I think we should give due consideration to what the function should return in the "failure case" (i.e., if we get an ambiguous result).
  • I think I might have found a missing else.
  • Consider renaming things from "remote" to (not) "local".
  • Consider DRYing out a command invocation.
  • Why use symlinks for the test completion status files? (If one changes, they aren't all going to change...are they?...so they shouldn't be coupled to each other.)

Beyond those, there are a dozen smaller items.

Copy link
Member

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

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

I've rebased and updated this to handle the subjectively "biggest" issues:

  • IPv6 support (non-text comparisons);
  • Changing the sense of the test to explicitly support the fact that we can't/don't really test for "remote" but whether a host matches a known local address.

There are a few other issues worth considering here; but I'd also like to get this in because my non-DNS tool meister changes require it. (Which is why I "stole" it from Peter after it's been languishing in the GitHub closet since November...)

@dbutenhof
Copy link
Member

Argh; bug revealed by Jenkins IPv6 configuration, which is interesting. I think I need to try to mock ifaddr.get_adapters() ... which I'd lazily tried to avoid. ☹️

Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

The new changes appear to have resolved most of my previous concerns. I have a few new comments below. And I still have some conversations from earlier passes:

  • I think the mocking should be done in a different way. (@dbutenhof, and I discussed some possibilities -- my current favorite is to have the class to define both the real methods and mocks for them, and to bind the appropriate definition to the name at load-time.)
  • There's the question about the missing else in the fio script
  • My concern about using symlinks for the test completion status files

@dbutenhof dbutenhof requested a review from webbnh February 21, 2022 22:09
@dbutenhof dbutenhof self-assigned this Feb 21, 2022
webbnh
webbnh previously approved these changes Feb 21, 2022
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

@portante portante left a comment

Choose a reason for hiding this comment

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

FWIW, this looks good still.

webbnh
webbnh previously approved these changes Feb 23, 2022
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

GitHub says there's no change since my last review, so it must still be good!

@dbutenhof
Copy link
Member

GitHub says there's no change since my last review, so it must still be good!

Yeah, just needed to be dusted off (rebased); of course now it's out of date again!

@webbnh
Copy link
Member

webbnh commented Feb 23, 2022

Given that we can do a Squash-and-merge after we get everything approved, I'm no longer inclined to see the author do a rebase if it's "just to bring the branch up to date with main".

Granted, there are exceptions to that: if the reason for rebasing is another commit to a dependent or related area, we should have the author rebase so that we get the two new changes tested together before they are merged; and, obviously, if there are merge conflicts, those are probably best resolved by the author. But, if the reason for the rebase is otherwise unrelated changes, particularly if the intention of the PR is to merge a single commit, then I think it produces less overhead if we do the Squash-and-merge at the end, rather than having the author handle it and undergoing an additional round of approvals. (Likewise, if the contents of the PR are to be merged as a series of commits, then the author needs to do the squashes, but if the branch is already properly arranged, we can do a Rebase-and-merge without requiring an additional round of approvals.)

portante and others added 8 commits February 24, 2022 07:32
The new class, `LocalRemoteHost` allows one to construct an object which
offers an interface, `is_remote(<host name or IP address>)`, returning
a boolean `True` or `False` answering that question.
This adapts the new `LocalHostRemote` class for use with the orchestration
of Tool Meister's remotely.  Because of the nature of the legacy tests, we
need to endow the agent utils module with knowledge of the test environment.
1) Handle IPv6 localhost comparisons
2) Reverse the sense of the test from 'is-remote'
    to 'is-local' because strictly speaking that's
    the condition we know how to test.
We only allow a single `--client` value
corresponding to localhost, so there's
no need for the `do_local_client` logic;
in addition, it used the ${client} loop
local value outside the loop.
@dbutenhof
Copy link
Member

Given that we can do a Squash-and-merge after we get everything approved, I'm no longer inclined to see the author do a rebase if it's "just to bring the branch up to date with main".

You're not wrong; however,

  1. Relying on GitHub to do the rebase always makes me nervous even when it seems there "can't" be a conflict. 🍤
  2. I rebased before reading this reply;
  3. Since I rebased on top of my jenkins/run change, this is the first test of the merged code (even though it's already run in my PR branch, and there should be no difference...)

@dbutenhof dbutenhof requested a review from webbnh February 24, 2022 12:37
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

It still looks good to me. 🙃

@dbutenhof dbutenhof merged commit 0dabb23 into distributed-system-analysis:main Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Agent enhancement fio pbench-fio benchmark related tools Of and related to the operation and behavior of various tools (iostat, sar, etc.) uperf pbench-uperf benchmark related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants