Get back to original

This commit is contained in:
Bart van der Braak 2024-11-20 16:02:13 +01:00
parent 77ae214d24
commit 5cc9d7b0e9
68 changed files with 83 additions and 42 deletions

View file

@ -0,0 +1,39 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2011-2024 Blender Authors
# <pep8 compliant>
import importlib
def _get_config(ENVIRONMENT: str):
if ENVIRONMENT == "LOCAL":
import conf.local.machines
importlib.reload(conf.local.machines)
return conf.local.machines
else:
import conf.production.machines
importlib.reload(conf.production.machines)
return conf.production.machines
def fetch_platform_worker_names(ENVIRONMENT: str):
machines_config = _get_config(ENVIRONMENT)
return machines_config.get_worker_names(ENVIRONMENT)
def get_worker_password(ENVIRONMENT: str, worker_name: str) -> str:
machines_config = _get_config(ENVIRONMENT)
return machines_config.get_worker_password(worker_name)
def fetch_local_worker_names():
worker_names = []
worker_numbers = range(1, 5, 1)
for worker_number in worker_numbers:
worker_id = str(worker_number).zfill(2)
worker_name = f"local-coordinator-{worker_id}"
worker_names += [worker_name]
return worker_names