-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: passive runner deletion #294
feat: passive runner deletion #294
Conversation
Returns: | ||
An SSH connection to OpenStack server instance. | ||
""" | ||
server: Server | None = conn.get_server(name_or_id=server_name) |
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.
Refresh server on error (e.g. network not yet attached)
@staticmethod | ||
def _get_key_path(name: str) -> Path: | ||
"""Get the filepath for storing private SSH of a runner. | ||
def reconcile(self, quantity: int) -> int: |
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.
Step down ordering of methods.
This reverts commit 9b4678e.
] | ||
|
||
@staticmethod | ||
def _health_check(conn: OpenstackConnection, server_name: str, startup: bool = False) -> bool: |
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.
Main change
|
||
@staticmethod | ||
def _ssh_health_check(server: Server) -> bool: | ||
def _ssh_health_check(conn: OpenstackConnection, server_name: str, startup: bool) -> bool: |
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.
Main change
|
||
@staticmethod | ||
@retry(tries=3, delay=5, max_delay=60, backoff=2, local_logger=logger) | ||
def _get_ssh_connection( |
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.
Improved _get_ssh_connection function
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.
Comments to assist in PR review
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.
Minor comments and a question. Thanks!
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.
LGTM
Applicable spec: N/A
Rejected:
Overview
_get_ssh_connection
function to return a single working SSH connection instance. (There is no need to loop over every possible network connections and try them for each business logic)._health_check
function that encapsulates the business logic of health checking for both startup and running health checks.Log and alert when there is an unexpected health check result to allow more insights into the state of Openstack GitHub runners.Rationale
To gain more insights into interactions with Openstack.
Juju Events Changes
None.
Module Changes
openstack_manager.py
_health_check
function_get_ssh_connection
functionLibrary Changes
None.
Checklist
src-docs
urgent
,trivial
,complex
)Testing has been one on PS6