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

Don't copy monitoring address/port parameters into the DFK. #3522

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

benclifford
Copy link
Collaborator

Prior to this PR, monitoring hub address and ZMQ port were stored as attributes of the DFK. The address also existed as an attribute on dfk.monitoring, and the ZMQ port was returned by dfk.monitoring.start

Afte this PR, those values are not added to the DFK, but instead are accessed via dfk.monitoring.

These two attributes are now only set on a new executor when monitoring is enabled, rather than always being intialised by the DFK. Default values now come from the executor init method, which is a more usual style in Python for providing default values. See PR #3361

This is part of ongoing work to introduce more pluggable monitoring network connectivity - see PR #3315

Changed Behaviour

none

Type of change

  • Code maintenance/cleanup

Prior to this PR, monitoring hub address and ZMQ port were stored as
attributes of the DFK. The address also existed as an attribute on
dfk.monitoring, and the ZMQ port was returned by dfk.monitoring.start

Afte this PR, those values are not added to the DFK, but instead are
accessed via dfk.monitoring.

These two attributes are now only set on a new executor when monitoring
is enabled, rather than always being intialised by the DFK. Default values
now come from the executor __init__ method, which is a more usual style
in Python for providing default values. See PR #3361

This is part of ongoing work to introduce more pluggable monitoring
network connectivity - see PR #3315
@benclifford benclifford requested a review from yadudoc July 12, 2024 15:23
Comment on lines +1181 to 1183
executor.hub_address = self.monitoring.hub_address
executor.hub_zmq_port = self.monitoring.hub_zmq_port
executor.monitoring_radio = self.monitoring.radio
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if it would be better to simply attach the monitor to the executor, rather than copying these details over piecemeal. I haven't thought that through though, I just don't like the smell of multiple copies of the same data lying around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the whole model of populating state post-construction ad-hoc into various objects makes me generally uncomfortable in Parsl - way longer term I'd love some stronger notion of "existing in a context" that doesn't look like this. (absolutely not suggesting this as an approach but compare how pytest uses fixtures)

that's not for this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

although monitoring specific, this is part of the monitoring radio plugin prototype which I hope to reduce the context that needs to be passed around to be "here's the object you use to send your messages, it encapsulates everything needed for that".

@benclifford benclifford merged commit 71d9c71 into master Jul 25, 2024
7 checks passed
@benclifford benclifford deleted the benc-monitoring-no-copy-network branch July 25, 2024 06:30
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