-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wait for yagna apis to be listening before starting agents #335
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 |
---|---|---|
|
@@ -227,9 +227,15 @@ def __init__( | |
): | ||
super().__init__(runner, client, config, log_config) | ||
|
||
def start_agent(self): | ||
async def start_agent(self): | ||
"""Start the requestor agent and attach to its log stream.""" | ||
|
||
self._logger.info("Waiting for yagna API to be listening.") | ||
await self.container.logs.wait_for_entry( | ||
"Starting .* service on .*.", timeout=300 | ||
) | ||
self._logger.info("Starting ya-requestor") | ||
|
||
pkg_spec = self.task_package.format( | ||
web_server_addr=self.runner.host_address, | ||
web_server_port=self.runner.web_server_port, | ||
|
@@ -260,9 +266,15 @@ def __init__( | |
super().__init__(runner, client, config, log_config) | ||
self.agent_preset = agent_preset | ||
|
||
def start_agent(self) -> None: | ||
async def start_agent(self): | ||
"""Start the provider agent and attach to its log stream.""" | ||
|
||
self._logger.info("Waiting for yagna apis to be listening...") | ||
await self.container.logs.wait_for_entry( | ||
"Starting .* service on .*.", timeout=10 | ||
) | ||
Comment on lines
+272
to
+275
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. Since this is copy-pasted between the two agents, maybe it's better to push it into their base class (i.e. 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. the only differences are the timeout and the name of the starting binary, so can do :) |
||
self._logger.info("Starting ya-provider") | ||
|
||
if self.agent_preset: | ||
self.container.exec_run(f"ya-provider preset activate {self.agent_preset}") | ||
|
||
|
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.
The timeout here is different from the one in provider agent. Is this intentional?
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.
yes, the requestor is requesting funds, while the provider is not