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

Fix autoscaling ramping down when new analysis run is triggered #1062

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/model_execution_worker/distributed_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,6 @@ def pre_analysis_hook(self,
# OED has been loaded and check in this step, disable check in file gen
# This is in case pre-exposure func has added non-standard cols to the file.
params['check_oed'] = False

# remove any pre-loaded files (only affects this worker)
oed_files = {v for k, v in params.items() if k.startswith('oed_') and isinstance(v, str)}
for filepath in oed_files:
if Path(filepath).exists():
os.remove(filepath)
else:
logger.info('pre_analysis_hook: SKIPPING, param "exposure_pre_analysis_module" not set')
params['log_location'] = filestore.put(kwargs.get('log_filename'))
Expand Down
5 changes: 3 additions & 2 deletions src/server/oasisapi/analyses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from src.server.oasisapi.celery_app_v1 import v1 as celery_app_v1
from src.server.oasisapi.celery_app_v2 import v2 as celery_app_v2
from src.server.oasisapi.queues.consumers import send_task_status_message, TaskStatusMessageItem, \
TaskStatusMessageAnalysisItem, build_task_status_message
TaskStatusMessageAnalysisItem, build_task_status_message, build_all_queue_status_message
from ..analysis_models.models import AnalysisModel, ModelChunkingOptions
from ..data_files.models import DataFile
from ..files.models import RelatedFile, file_storage_link
Expand Down Expand Up @@ -64,7 +64,8 @@ def create_statuses(self, objs):
"""
statuses = self.bulk_create(objs)

self._send_socket_messages(statuses)
send_task_status_message(build_all_queue_status_message())
# self._send_socket_messages(statuses)

# This generates too much WS traffic disableing message per sub-task update
# def update(self, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions src/server/oasisapi/queues/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ def build_all_queue_status_message(analysis_filter=None, message_type='queue_sta
queue_names = analyses.values_list('sub_task_statuses__queue_name', flat=True).distinct()
else:
analyses = Analysis.objects.filter(status__in=[
Analysis.status_choices.NEW,
Analysis.status_choices.INPUTS_GENERATION_QUEUED,
Analysis.status_choices.INPUTS_GENERATION_STARTED,
Analysis.status_choices.READY,
Analysis.status_choices.RUN_QUEUED,
Analysis.status_choices.RUN_STARTED,
])
Expand Down
Loading