diff --git a/compute_worker/compute_worker.py b/compute_worker/compute_worker.py index 1171bb590..6ac63c9d6 100644 --- a/compute_worker/compute_worker.py +++ b/compute_worker/compute_worker.py @@ -674,9 +674,10 @@ def prepare(self): def start(self): hostname = utils.nodenames.gethostname() - if not self.is_scoring: - self._update_status(STATUS_RUNNING, extra_information=f"hostname-{hostname}") - + if self.is_scoring: + self._update_status(STATUS_RUNNING, extra_information=f"scoring_hostname-{hostname}") + else: + self._update_status(STATUS_RUNNING, extra_information=f"ingestion_hostname-{hostname}") program_dir = os.path.join(self.root_dir, "program") ingestion_program_dir = os.path.join(self.root_dir, "ingestion_program") diff --git a/src/apps/api/views/submissions.py b/src/apps/api/views/submissions.py index 7e6b5970f..d4d82fba2 100644 --- a/src/apps/api/views/submissions.py +++ b/src/apps/api/views/submissions.py @@ -40,9 +40,15 @@ def check_object_permissions(self, request, obj): dir(self.request) # Set hostname of submission if "status_details" in self.request.data.keys(): - if request.data['status_details'].find('hostname') != -1: - hostname = request.data['status_details'].replace('hostname-', '') - obj.worker_hostname = hostname + # Check ingestion hostname + if request.data['status_details'].find('ingestion_hostname') != -1: + hostname = request.data['status_details'].replace('ingestion_hostname-', '') + obj.ingestion_worker_hostname = hostname + obj.save() + # Check socring hostname + if request.data['status_details'].find('scoring_hostname') != -1: + hostname = request.data['status_details'].replace('scoring_hostname-', '') + obj.scoring_worker_hostname = hostname obj.save() not_bot_user = self.request.user.is_authenticated and not self.request.user.is_bot diff --git a/src/apps/competitions/migrations/0038_auto_20230830_1631.py b/src/apps/competitions/migrations/0038_auto_20230830_1631.py new file mode 100644 index 000000000..3c72e6907 --- /dev/null +++ b/src/apps/competitions/migrations/0038_auto_20230830_1631.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.17 on 2023-08-30 16:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('competitions', '0037_auto_20230826_0859'), + ] + + operations = [ + migrations.RenameField( + model_name='submission', + old_name='worker_hostname', + new_name='ingestion_worker_hostname', + ), + migrations.AddField( + model_name='submission', + name='scoring_worker_hostname', + field=models.CharField(blank=True, max_length=255, null=True), + ), + ] diff --git a/src/apps/competitions/models.py b/src/apps/competitions/models.py index 9eb843f17..4a8a8c582 100644 --- a/src/apps/competitions/models.py +++ b/src/apps/competitions/models.py @@ -459,7 +459,10 @@ class Submission(ChaHubSaveMixin, models.Model): started_when = models.DateTimeField(null=True) is_public = models.BooleanField(default=False) is_specific_task_re_run = models.BooleanField(default=False) - worker_hostname = models.CharField(max_length=255, blank=True, null=True) + # Ingestion hostname + ingestion_worker_hostname = models.CharField(max_length=255, blank=True, null=True) + # Scoring hostname + scoring_worker_hostname = models.CharField(max_length=255, blank=True, null=True) queue = models.ForeignKey('queues.Queue', on_delete=models.SET_NULL, null=True, blank=True, related_name='submissions') is_migrated = models.BooleanField(default=False) diff --git a/src/templates/pages/server_status.html b/src/templates/pages/server_status.html index 561353b21..946bad77e 100644 --- a/src/templates/pages/server_status.html +++ b/src/templates/pages/server_status.html @@ -25,7 +25,8 @@

Recent submissions (up to 250 or 2 days old)

Size Submitter Queue - Hostname + Ingestion Hostname + Scoring Hostname Submitted at Status @@ -45,7 +46,8 @@

Recent submissions (up to 250 or 2 days old)

{{ submission.file_size }} {{ submission.owner.username }} {{ submission.competition_queue }} - {{ submission.worker_hostname }} + {{ submission.ingestion_worker_hostname }} + {{ submission.scoring_worker_hostname }} {{ submission.created_when|timesince }} ago {{ submission.status }}