-
Notifications
You must be signed in to change notification settings - Fork 987
Add on-demand 'trigger-ml' CLI command for machine learning workers (fixes #2920) #3624
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 |
|---|---|---|
|
|
@@ -236,6 +236,27 @@ | |
| request.get_valid_repos(session) | ||
| return request | ||
|
|
||
| @celery.task(bind=True) | ||
| def trigger_ml_phase(self): | ||
| engine = self.app.engine | ||
| logger = logging.getLogger(trigger_ml_phase.__name__) | ||
| enabled_phase_names = get_enabled_phase_names_from_config(engine, logger) | ||
|
|
||
| if RUNNING_DOCKER or machine_learning_phase.__name__ not in enabled_phase_names: | ||
|
Contributor
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. why is docker being excluded here?
Contributor
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. oh i see, because it was excluded in the original logic |
||
| return | ||
|
|
||
|
|
||
| with DatabaseSession(logger, engine) as session: | ||
| config = AugurConfig(logger, session) | ||
| ml_phase_request = [] | ||
| ml_interval = config.get_value('Tasks', 'ml_collection_interval_days') or 40 | ||
| ml_phase_request.append(build_ml_repo_collect_request(session, logger, enabled_phase_names, ml_interval)) | ||
|
|
||
| main_routine = AugurTaskRoutine(logger, ml_phase_request) | ||
|
Contributor
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. Im not sure if creating a new instance of the augur task routine here could lead to issues or not, especially since we already have one |
||
|
|
||
| main_routine.start_data_collection() | ||
|
|
||
|
|
||
| @celery.task(bind=True) | ||
| def augur_collection_monitor(self): | ||
|
|
||
|
|
@@ -271,10 +292,6 @@ | |
| #start_facade_collection(session, max_repo=30) | ||
| enabled_collection_hooks.append(build_facade_repo_collect_request(session, logger, enabled_phase_names, facade_interval)) | ||
|
|
||
| if not RUNNING_DOCKER and machine_learning_phase.__name__ in enabled_phase_names: | ||
| enabled_collection_hooks.append(build_ml_repo_collect_request(session, logger, enabled_phase_names, ml_interval)) | ||
| #start_ml_collection(session,max_repo=5) | ||
|
|
||
| logger.info(f"Starting collection phases: {[h.name for h in enabled_collection_hooks]}") | ||
|
|
||
| main_routine = AugurTaskRoutine(logger, enabled_collection_hooks) | ||
|
|
@@ -304,7 +321,7 @@ | |
| status = repo.collection_status[0] | ||
| raw_count = status.issue_pr_sum | ||
|
|
||
| issue_pr_task_update_weight_util([int(raw_count)],repo_git=repo_git,session=session) | ||
|
Check warning on line 324 in augur/tasks/start_tasks.py
|
||
|
|
||
| facade_not_pending = CollectionStatus.facade_status != CollectionState.PENDING.value | ||
| facade_not_failed = CollectionStatus.facade_status != CollectionState.FAILED_CLONE.value | ||
|
|
||
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.
If the ml workers are not enabled in the config, this will still print a message saying they were started - this seems like it could very easily be confusing