diff --git a/alts/scheduler/scheduling.py b/alts/scheduler/scheduling.py index 0aa4559..bb2a59e 100644 --- a/alts/scheduler/scheduling.py +++ b/alts/scheduler/scheduling.py @@ -124,7 +124,7 @@ def schedule_test_task(self, payload: TaskRequestPayload): repo_counter += 1 repositories.append({'url': repository.baseurl, 'name': repo_name}) - queue_name = f'{runner_type}-{queue_arch}-{runner_class.COST}' + queue_name = f'{runner_type}-{queue_arch}-{runner_class.get_cost(payload.release_build)}' task_id = str(uuid.uuid4()) task_params = payload.model_dump() task_params['task_id'] = task_id diff --git a/alts/worker/runners/base.py b/alts/worker/runners/base.py index a80d20b..fb6832e 100644 --- a/alts/worker/runners/base.py +++ b/alts/worker/runners/base.py @@ -189,6 +189,11 @@ class BaseRunner(object): s390x=['s390x'], ) COST = 0 + + @classmethod + def get_cost(cls, release_build: bool = False) -> int: + return cls.COST + TF_VARIABLES_FILE = None TF_MAIN_FILE = None TF_VERSIONS_FILE = 'versions.tf' diff --git a/alts/worker/runners/opennebula.py b/alts/worker/runners/opennebula.py index b5f99d9..4345713 100644 --- a/alts/worker/runners/opennebula.py +++ b/alts/worker/runners/opennebula.py @@ -35,6 +35,13 @@ class OpennebulaRunner(GenericVMRunner): """Opennebula environment runner for testing tasks.""" TYPE = 'opennebula' + COST_STANDARD = 1 + COST_RELEASE_BUILD = 2 + + @classmethod + def get_cost(cls, release_build: bool = False) -> int: + return cls.COST_RELEASE_BUILD if release_build else cls.COST_STANDARD + TEMPFILE_PREFIX = 'opennebula_test_runner_' TF_VARIABLES_FILE = 'opennebula.tfvars' TF_MAIN_FILE = 'opennebula.tf'