Skip to content

Commit

Permalink
Fix address field in TaskVine manager config. (#3066)
Browse files Browse the repository at this point in the history
Previously it looks like this field was ignored, because it was always
(in the absence of a project name) overriddel by
parsl.addresses.get_any_address. This PR makes that override only happen
when the address field is set to None.

Previously this field had a class level default value of socket.gethostname()
That value was never used, because of the above override, and resulted in the
hostname of the documentation build host being listed as the default value
for this parameter, incorrectly.

This PR removes that default value, allows the address field to be None,
and makes the address field be None by default.

Cross-reference this Debian documentation reproducibility issue where the
presence of socket.gethostname() breaks binary reproducibility:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063542

Testing:

Prior to this PR, setting address='10.10.10.10' does not break anything, even
though that is not an IP address of my test environment. After this PR,
setting that IP address causes taskvine to hang as I would expect.
  • Loading branch information
benclifford authored Mar 12, 2024
1 parent 920852f commit b4a61fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions parsl/executors/taskvine/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ def __synchronize_manager_factory_comm_settings(self):
if self.manager_config.port == 0 and self.manager_config.project_name is None:
self.manager_config.project_name = "parsl-vine-" + str(uuid.uuid4())

# guess the host name if the project name is not given
if not self.manager_config.project_name:
# guess the host name if the project name is not given and none has been supplied
# explicitly in the manager config.
if not self.manager_config.project_name and self.manager_config.address is None:
self.manager_config.address = get_any_address()

# Factory communication settings are overridden by manager communication settings.
Expand Down
7 changes: 3 additions & 4 deletions parsl/executors/taskvine/manager_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import socket
from dataclasses import dataclass
from typing import Optional

Expand All @@ -23,9 +22,9 @@ class TaskVineManagerConfig:
A value of 0 means TaskVine chooses any available port.
Default is VINE_DEFAULT_PORT.
address: str
address: Optional[str]
Address of the local machine.
Default is socket.gethostname().
If None, socket.gethostname() will be used to determine the address.
project_name: Optional[str]
If given, TaskVine will periodically report its status and performance
Expand Down Expand Up @@ -161,7 +160,7 @@ class TaskVineManagerConfig:

# Connection and communication settings
port: int = VINE_DEFAULT_PORT
address: str = socket.gethostname()
address: Optional[str] = None
project_name: Optional[str] = None
project_password_file: Optional[str] = None

Expand Down

0 comments on commit b4a61fc

Please sign in to comment.