Skip to content
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

Jumpstart #2902

Merged
merged 90 commits into from
Aug 27, 2024
Merged

Jumpstart #2902

merged 90 commits into from
Aug 27, 2024

Conversation

Ulincsys
Copy link
Contributor

Description

  • Add jumpstart subroutine for more robust process management
  • Fix logging inconsistencies
  • Fix augur api start and augur collection start commands
  • Add Textual dependency

In preparation for changes coming in the Admin Console release, it is desirable to have a proper "process manager" in place that can communicate with external clients and control Augur processes from a central perspective. This change enables more granular control over Augur's various worker types, and in the future more features are possible.

Signed commits

  • Yes, I signed my commits.

@@ -14,15 +14,16 @@

from augur.application.db.session import DatabaseSession

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0611: Unused DatabaseSession imported from augur.application.db.session (unused-import)

"""
Stop collection tasks if they are running, block until complete
"""
processes = get_augur_processes()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'processes' from outer scope (line 443) (redefined-outer-name)

stopped.append(p)
p.terminate()

if not len(stopped):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C1802: Do not use len(SEQUENCE) without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)


killed = []
while True:
for i in range(len(alive)):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)

for i in reversed(killed):
alive.pop(i)

if not len(alive):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C1802: Do not use len(SEQUENCE) without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)

if command["name"] == cmd:
packet["cmd"] = cmd
for arg in command["args"]:
if arg["required"] and not len(args):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C1802: Do not use len(SEQUENCE) without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)


for command in self.spec["commands"]:
help_str += f'\t> [bold yellow]{command["name"]}'
for arg in command["args"]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'arg' from outer scope (line 388) (redefined-outer-name)

log(e)
log(msg)

def run_app(socket_file = Path("jumpstart.sock"), ctx = None):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'socket_file' from outer scope (line 387) (redefined-outer-name)


import json
import asyncio
import logging

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0611: Unused import logging (unused-import)

from textual.app import App, on
from textual.binding import Binding
from textual.message import Message
from textual.events import Load, Mount

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0611: Unused Load imported from textual.events (unused-import)

sgoggins
sgoggins previously approved these changes Aug 27, 2024
Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @ABrain7710 needs to check the backend.py edits.

@@ -91,4 +91,4 @@ def write_settings(current_settings):
# Initialize logging
def init_logging():
global logger
logger = AugurLogger("augur_view", reset_logfiles=True).get_logger()
logger = AugurLogger("augur_view", reset_logfiles=False).get_logger()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only affect view?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it previously would reset all log files globally. So now the log files will continue to exist after starting Augur

@@ -22,14 +22,15 @@
from augur.application.db.session import DatabaseSession
from augur.application.logs import AugurLogger
from augur.application.db.lib import get_value
from augur.application.cli import test_connection, test_db_connection, with_database
from augur.application.cli import test_connection, test_db_connection, with_database, DatabaseContext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one just incorporating the latest from @ABrain7710 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the changes are unrelated

Ulincsys and others added 26 commits August 27, 2024 18:06
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
ABrain7710 and others added 26 commits August 27, 2024 18:06
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
…g to understand event API limits

Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
…in the data returned from the events API. It DOES look like what is returned may be a partially complte set in some cases.

Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
…taException class (I think)

Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
…e to the API

Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
…empty repos in repo_info

Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Traceback (most recent call last):
  File '/home/ubuntu/github/virtualenvs/hosted/lib/python3.11/site-packages/billiard/pool.py', line 366, in workloop
    put((READY, (job, i, result, inqW_fd)))
  File '/home/ubuntu/github/virtualenvs/hosted/lib/python3.11/site-packages/billiard/queues.py', line 366, in put
    self.send_payload(ForkingPickler.dumps(obj))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File '/home/ubuntu/github/virtualenvs/hosted/lib/python3.11/site-packages/billiard/reduction.py', line 56, in dumps
    cls(buf, protocol).dump(obj)
billiard.pool.MaybeEncodingError: Error sending result: ''(1, <ExceptionInfo: MetadataException('\'checks\' | Additional metadata: required_output: {}')>, None)''. Reason: ''PicklingError('Can\'t pickle <class \'augur.tasks.util.metadata_exception.MetadataException\'>: it\'s not the same object as augur.tasks.util.metadata_exception.MetadataException')''.

Signed-off-by: Sean P. Goggins <[email protected]>
Signed-off-by: Ulincsys <[email protected]>
Signed-off-by: Sean P. Goggins <[email protected]>
@sgoggins sgoggins merged commit aae2f19 into dev Aug 27, 2024
6 of 7 checks passed
@Ulincsys Ulincsys deleted the jumpstart branch August 27, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants