-
Notifications
You must be signed in to change notification settings - Fork 107
Refactor tool-meister-start orchestration #2181
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 tool-meister-start orchestration #2181
Conversation
|
This pull request introduces 2 alerts when merging 0903571 into cf66c53 - view on LGTM.com new alerts:
|
9b7d998 to
920907d
Compare
|
@RobertKrawitz, okay here is the fixed code to handle specifying the listen (binding) vs connection IP/ports for both the Tool Data Sink and the Redis Server as created by Please take a moment to review the PR description where we describe how to use |
|
I need to test this in a real container, still, but it is a start. |
920907d to
94f1a73
Compare
ndokos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Light first pass: typos and some questions. Need to go through main() in more detail though.
Maxusmusti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome so far, just a couple of design questions
webbnh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More to come....
37fb854 to
3c14a84
Compare
webbnh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! (For this round....)
29b6913 to
9ab5b0a
Compare
|
Okay, since some of the code-review comments were asking about validating host names and IP addresses, and we had issue #2201 come up during this window of work, I decided to add a commit to solve #2201 first. It is now the first commit before any other changes. I'll follow that up with another refactoring so that the |
f7a4b8f to
9641f62
Compare
dbutenhof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The levels of validate-hostname / validate_hostname are a bit convoluted, but I like the idea.
I see Webb pointed out a few problems that need to be resolved; but pending that, it's looking good.
|
@Maxusmusti, @ndokos, this PR still have 2 changes requested from the two of you. Is that still the case? |
a0cfe54 to
8fdac35
Compare
webbnh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that you are going to open an issue for the IPv6 address-with-port format, rather than add it to this PR, so, modulo the documentation nit below (and Nick's concerns), I think this is good to go.
portante
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, ready for another pass. I had to rebase anyways, and these changes were straightforward to make.
dbutenhof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we need to clean up the IPv6 addressing, but since we're not using IPv6 I guess that can be deferred. (Do we even have IPv6 in RDU2 or BOS labs?)
Maxusmusti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed usual local/remote node testing with expected results
We needed a way to specify what IP address and port to use when the
Redis server and Tool Data Sink (really its WSGI server) bind for their
respective services, while also being able to specify what address and
port the Tool Meister(s) should connect to in environments where those
address and ports are different (software-defined-networking, or NAT'd,
or some other reason).
We solve this need by adding a new option, `--orchestrate`, along with
a new `--tool-data-sink` option, and adjust the behaviors a bit.
The new `--orchestrate` option accepts two keywords, `create` and
`existing`, which allow the caller to direct tool-meister-start to
either be responsible for creating the Redis server, Tool Data Sink,
and Tool Meister instances, or use existing instances. The
`--redis-server` (or the `PBENCH_REDIS_SERVER` environment variable)
and `--tool-data-sink` (or the `PBENCH_TOOL_DATA_SINK` environment
variable) options give the caller the ability to specify the IP/port
combinations to use in either operating case.
When `--orchestrate=existing` is specified, the `--redis-server` and
`--tool-data-sink` options (or environment variables) must be specified.
The format for specifying the IP/ports to use via the `--redis-server`
and `--tool-data-sink` options can be one of the following:
* `<host ip>:<port>`: used both for listening and connections
* `<listen host ip>:<port>;<connection host ip>:<port>`: the 1st
host/port pair is used for listening for connections, the 2nd
host/port pair is used to specify how to make connections to
the instances
The defaults are:
* Redis: bind & connect, `${_pbench_full_hostname}:17001`
* Also binds to `localhost`
* TDS: bind & connect, `${_pbench_full_hostname}:8080`
Prior to this change, `pbench-tool-meister-start` had one very long
`main` method. This refactoring breaks out the orchestration pieces
required to start the Redis server, Tool Data Sink, and the Tool
Meisters, into their own methods and classes, reducing `main` to
something a bit more reasonable.
As part of this work, a new `BaseServer` abstraction, sub-classed for
the `RedisServer` and `ToolDataSink`, now handles how the Redis server
and Tool Data Sink instance tracking works, either when they are
created by tool-meister-start, or created ahead of time by the caller.
f7652cf to
c6848ee
Compare
webbnh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, let's ship it! (Please don't make me review the entire thing again....)
What? Oh, them?...no, pay no attention to those comments.....
dbutenhof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say go.
We needed a way to specify what IP address and port to use when the Redis server and Tool Data Sink (really its WSGI server) bind for their respective services, while also being able to specify what address and port the Tool Meister(s) should connect to in environments where those address and ports are different (software-defined-networking, or NAT'd, or some other reason).
We solve this need by adding a new option,
--orchestrate, along with a new--tool-data-sinkoption, and adjust the behaviors a bit.The new
--orchestrateoption accepts two keywords,createandexisting, which allow the caller to direct tool-meister-start to either be responsible for creating the Redis server, Tool Data Sink, and Tool Meister instances, or use existing instances. The--redis-server(or thePBENCH_REDIS_SERVERenvironment variable) and--tool-data-sink(or thePBENCH_TOOL_DATA_SINKenvironment variable) options give the caller the ability to specify the IP/port combinations to use in either operating case.When
--orchestrate=existingis specified, the--redis-serverand--tool-data-sinkoptions (or environment variables) must be specified.The format for specifying the IP/ports to use via the
--redis-serverand--tool-data-sinkoptions can be one of the following:<host ip>:<port>: used both for listening and connections<listen host ip>:<port>;<connection host ip>:<port>: the 1st host/port pair is used for listening for connections, the 2nd host/port pair is used to specify how to make connections to the instancesThe defaults are:
${_pbench_full_hostname}:17001localhost${_pbench_full_hostname}:8080Prior to this change,
pbench-tool-meister-starthad one very longmainmethod. This refactoring breaks out the orchestration pieces required to start the Redis server, Tool Data Sink, and the Tool Meisters, into their own methods and classes, reducingmainto something a bit more reasonable.As part of this work, a new
BaseServerabstraction, sub-classed for theRedisServerandToolDataSink, now handles how the Redis server and Tool Data Sink instance tracking works, either when they are created by tool-meister-start, or created ahead of time by the caller.