def configure(mlbox: str, platform: str): mlbox: mlbox_metadata.MLBox = mlbox_metadata.MLBox(path=mlbox) mlbox.platform = objects.load_object_from_file(file_path=platform, obj_class=platform_config.PlatformConfig) print(mlbox) runner = SingularityRun(mlbox) runner.configure()
def configure(mlbox: str, platform: str): mlbox: mlbox_metadata.MLBox = mlbox_metadata.MLBox(path=mlbox) mlbox.platform = metadata.SingularityPlatform(path=platform, mlbox=mlbox) print(mlbox) runner = SingularityRun(mlbox) runner.configure()
def configure(mlbox: str, platform: str): mlbox: mlbox_metadata.MLBox = mlbox_metadata.MLBox(path=mlbox) mlbox.platform = ssh_metadata.Platform(path=platform, mlbox=mlbox) print(mlbox) runner = SSHRun(mlbox) runner.configure()
def run(mlbox: str, platform: str, task: str): mlbox: mlbox_metadata.MLBox = mlbox_metadata.MLBox(path=mlbox) mlbox.platform = objects.load_object_from_file(file_path=platform, obj_class=platform_config.PlatformConfig) mlbox.invoke = mlbox_metadata.MLBoxInvoke(task) mlbox.task = mlbox_metadata.MLBoxTask(os.path.join(mlbox.tasks_path, f'{mlbox.invoke.task_name}.yaml')) print(mlbox) runner = SingularityRun(mlbox) runner.run()
def run(mlbox: str, platform: str, task: str): mlbox: mlbox_metadata.MLBox = mlbox_metadata.MLBox(path=mlbox) mlbox.platform = ssh_metadata.Platform(path=platform, mlbox=mlbox) mlbox.invoke = mlbox_metadata.MLBoxInvoke(task) mlbox.task = mlbox_metadata.MLBoxTask(os.path.join(mlbox.tasks_path, f'{mlbox.invoke.task_name}.yaml')) print(mlbox) runner = SSHRun(mlbox) runner.run(task_file=task)
def setUp(self): self.path_to_mlbox = "mlcommons_box_k8s/tests/test_data/test_box" self.path_to_platform = "mlcommons_box_k8s/tests/test_data/test_box/platforms/docker.yaml" self.path_to_task = "mlcommons_box_k8s/tests/test_data/test_box/run/kubernetes.yaml" self.mlbox = mlbox_metadata.MLBox(path=self.path_to_mlbox) self.mlbox.platform = objects.load_object_from_file( file_path=self.path_to_platform, obj_class=platform_config.PlatformConfig) self.mlbox.invoke = mlbox_metadata.MLBoxInvoke(self.path_to_task) self.mlbox_k8s_runner = KubernetesRun(mlbox=self.mlbox, loglevel="INFO")
def run(mlbox: str, platform: str, task: str, loglevel: str): """ Runs a MLBox in a Kubernetes cluster. """ # set loglevel for CLI logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%d-%b-%y-%H:%M:%S', level=loglevel) logger = logging.getLogger(__name__) logger.info("Configuring MLBox platform, task for Kubernetes...") mlbox: mlbox_metadata.MLBox = mlbox_metadata.MLBox(path=mlbox) mlbox.platform = objects.load_object_from_file( file_path=platform, obj_class=platform_config.PlatformConfig) mlbox.invoke = mlbox_metadata.MLBoxInvoke(task) logger.info("MLBox: %s", mlbox) runner = KubernetesRun(mlbox, loglevel) runner.run()