-
Notifications
You must be signed in to change notification settings - Fork 71
feat: Include UDS path in connection properties. #5172
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Include UDS path in connection properties. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -247,12 +247,35 @@ def clear(self): | |||||
| self._details = "" | ||||||
|
|
||||||
|
|
||||||
| @dataclass(frozen=True) | ||||||
| @dataclass(frozen=True, kw_only=True) | ||||||
| class FluentConnectionProperties: | ||||||
| """Stores Fluent connection properties, including connection IP, port and password; | ||||||
| """Stores Fluent connection properties, including connection IP/port or UDS path and password; | ||||||
| Fluent Cortex working directory, process ID and hostname; and whether Fluent was | ||||||
| launched in a docker container. | ||||||
|
|
||||||
| Attributes | ||||||
| ---------- | ||||||
| ip : str | None | ||||||
| IP address used to connect to Fluent. | ||||||
| port : int | None | ||||||
| Port used to connect to Fluent. | ||||||
| uds_fullpath : str | Path | None | ||||||
| Full path to the Unix Domain Socket used for local connections on Linux. | ||||||
| password : str | None | ||||||
| Password used for authentication when calling Fluent services. | ||||||
| cortex_pwd : str | None | ||||||
| Fluent Cortex working directory. | ||||||
| cortex_pid : int | None | ||||||
| Process ID of the Cortex process. | ||||||
| cortex_host : str | None | ||||||
| Hostname of the Cortex process. | ||||||
| fluent_host_pid : int | None | ||||||
| Process ID of the Fluent solver host process. | ||||||
| inside_container : bool | ContainerT | None | ||||||
| Container context for Fluent. | ||||||
| Returns ``False`` when not running in a container, | ||||||
| and the container instance when running in one. | ||||||
|
|
||||||
| Examples | ||||||
| -------- | ||||||
| These properties are also available through the session object and can be accessed as: | ||||||
|
|
@@ -267,6 +290,7 @@ class FluentConnectionProperties: | |||||
|
|
||||||
| ip: str | None = None | ||||||
| port: int | None = None | ||||||
| uds_fullpath: str | Path | None = None | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| password: str | None = None | ||||||
| cortex_pwd: str | None = None | ||||||
| cortex_pid: int | None = None | ||||||
|
|
@@ -583,14 +607,14 @@ def __init__( | |||||
| self._channel_str = None | ||||||
| self._slurm_job_id = None | ||||||
| self.finalizer_cbs = [] | ||||||
| self._uds_fullpath = None | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| if channel is not None: | ||||||
| self._channel = channel | ||||||
| else: | ||||||
| uds_fullpath = None | ||||||
| if address is not None: | ||||||
| self._channel_str = address | ||||||
| uds_fullpath = get_uds_path(address) | ||||||
| if uds_fullpath is None: | ||||||
| self._uds_fullpath = get_uds_path(address) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| if self._uds_fullpath is None: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ip, port = address.rsplit(":", 1) | ||||||
| port = int(port) | ||||||
| else: | ||||||
|
|
@@ -599,7 +623,7 @@ def __init__( | |||||
| self._channel = _get_channel( | ||||||
| ip=ip, | ||||||
| port=port, | ||||||
| uds_fullpath=uds_fullpath, | ||||||
| uds_fullpath=self._uds_fullpath, | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| allow_remote_host=allow_remote_host, | ||||||
| certificates_folder=certificates_folder, | ||||||
| insecure_mode=insecure_mode, | ||||||
|
|
@@ -664,14 +688,15 @@ def __init__( | |||||
| ) | ||||||
|
|
||||||
| self.connection_properties = FluentConnectionProperties( | ||||||
| ip, | ||||||
| port, | ||||||
| password, | ||||||
| cortex_pwd, | ||||||
| cortex_pid, | ||||||
| cortex_host, | ||||||
| fluent_host_pid, | ||||||
| inside_container, | ||||||
| ip=ip, | ||||||
| port=port, | ||||||
| uds_fullpath=self._uds_fullpath, | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| password=password, | ||||||
| cortex_pwd=cortex_pwd, | ||||||
| cortex_pid=cortex_pid, | ||||||
| cortex_host=cortex_host, | ||||||
| fluent_host_pid=fluent_host_pid, | ||||||
| inside_container=inside_container, | ||||||
| ) | ||||||
|
|
||||||
| self._remote_instance = remote_instance | ||||||
|
|
||||||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
@seanpearsonuk The naming followed the parameter name in the cyberchannel module documentation. The
create_channelwithin cyberchannel is exposed to users and we also support passing the channel within theFluentConnectionconstructor while directly initializing the session classes (although this is not a mainstream usage pattern). Should we change the parameter name in PyFluent or be consistent with thecyberchannelmodule?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.
@RobPasMue I think that the name of the parameter in
cyberchannelcould be updated. WDYT?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.
Hi @seanpearsonuk! We can update the cyberchannel if needed - but the update would imply accepting both options in fact, at least for a while. We could then move to deprecating the old version.
Nonetheless - what's the main driver? I'm guessing readability but just in case =)