dragon.workflows.runtime.lookup
- lookup(system, name, timeout_in=None, publish_dir=None)[source]
Look up and retrieve a published runtime descriptor from a remote system.
This function attempts to retrieve a serialized runtime descriptor that was previously published on a remote system using the publish() function. It uses SCP to copy the descriptor file from the remote system to the local machine.
Each call fetches the current descriptor. The returned string is a snapshot and does not track a runtime that later replaces the published instance.
The function will retry the lookup operation until the specified timeout is reached, sleeping 1 second between attempts. This allows time for the descriptor file to become visible on distributed/parallel file systems.
- Parameters:
system (str) – Hostname or IP address of the remote system where the runtime was published
name (str) – Name identifier used when the runtime descriptor was published
timeout_in (int, optional) – Maximum time in seconds to wait for the descriptor file, defaults to 1
publish_dir (str, optional) – Directory path where the descriptor was published. If None, uses ~/.dragon, defaults to None
- Returns:
Base64-encoded runtime descriptor string
- Return type:
- Raises:
RuntimeError – If the descriptor could not be retrieved within the timeout period