Skip to content

Conductor process logging - #475

Open
jwhite242 wants to merge 9 commits into
developfrom
feature/conductor_logging
Open

Conductor process logging#475
jwhite242 wants to merge 9 commits into
developfrom
feature/conductor_logging

Conversation

@jwhite242

Copy link
Copy Markdown
Collaborator

Adds logging of conductor processes to help track across multi-node clusters

Adds staged logging of maestro run to capture existing stdout/stderr log messages to real study log file unless launch is aborted.

@doutriaux1 doutriaux1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good I have a few comments though.

Comment thread maestrowf/conductor.py
@classmethod
def _conductor_record_path(cls, output_path, conductor_id):
registry_path = cls._conductor_registry_path(output_path)
return make_safe_path(registry_path, "{}.json".format(conductor_id))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no f string?

assert conductor_id in conductors
record = conductors[conductor_id]
assert record["conductor_id"] == conductor_id
assert record["study_name"] == "dummy_study"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we probably need a study_id as well no? If we ever decide to put everything in a single db. I do realize at the moment it's not necessary since there's only study and one conductor

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

conductor_step to show which step it is at (at least until we can link to a study record which will link to each expanded steps' records.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we want the things like throttle sleeptime etc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it might be in argv but would be nice to get them in a dedicated place

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks like you're not tesing everything here, e.g. python_executable

Comment thread maestrowf/conductor.py Outdated
ROOTLOGGER.addHandler(handler)
ROOTLOGGER.setLevel(loglevel)

LOGGER.info("Running Maestro Conductor standalone.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is there a non standalone mode?

Comment thread maestrowf/conductor.py

@staticmethod
def _get_host_addresses():
"""Return best-effort IP addresses for the current host."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can a host have mutliple ips?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

unfortunately, yes; getaddrinfo returns address for each network adapter and protocol (tcp/udp/...) on the host. tested a few clusters and only seen single addresses so far, so hopefully prioritizing the first tcp one is going to work?

Comment thread maestrowf/conductor.py
return json.load(data) or {}
except (OSError, ValueError) as exc:
last_error = exc
if attempt + 1 < attempts:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if attempt <= attempts ?

Comment thread maestrowf/conductor.py
return record

@classmethod
def get_conductors(cls, output_path):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there can be multiple conductors for the same study?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

not yet; first instance of this will be resuming studies after conductor shuts down to rerun steps/override restart limit/...

Comment thread maestrowf/conductor.py Outdated

def _new_conductor_id(self):
hostname = socket.gethostname()
return "{}.{}.{}".format(hostname, os.getpid(), uuid.uuid4().hex[:12])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is it just for readability? we don't really need hostname and pid?

Comment thread maestrowf/conductor.py Outdated
self._conductor_id = self._new_conductor_id()

now = self._timestamp()
record = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

did you check these match the other part of the code that tests this ? (I didn't do it carefully)

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.

2 participants