From b4a61fc430d2ff411d86763d7fd26add02d27bb3 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Tue, 12 Mar 2024 15:30:56 -0500 Subject: [PATCH] Fix address field in TaskVine manager config. (#3066) 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. --- parsl/executors/taskvine/executor.py | 5 +++-- parsl/executors/taskvine/manager_config.py | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/parsl/executors/taskvine/executor.py b/parsl/executors/taskvine/executor.py index 207675147e..0cd7fac697 100644 --- a/parsl/executors/taskvine/executor.py +++ b/parsl/executors/taskvine/executor.py @@ -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. diff --git a/parsl/executors/taskvine/manager_config.py b/parsl/executors/taskvine/manager_config.py index a037717366..18e58a0b90 100644 --- a/parsl/executors/taskvine/manager_config.py +++ b/parsl/executors/taskvine/manager_config.py @@ -1,4 +1,3 @@ -import socket from dataclasses import dataclass from typing import Optional @@ -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 @@ -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