Пример #1
0
def configure(mlcube: str, platform: str):
    mlcube: mlcube_metadata.MLCube = mlcube_metadata.MLCube(path=mlcube)
    mlcube.platform = objects.load_object_from_file(
        file_path=platform, obj_class=platform_config.PlatformConfig)
    print(mlcube)

    runner = DockerRun(mlcube)
    runner.configure()
Пример #2
0
def run(mlcube: str, platform: str, task: str):
    mlcube: mlcube_metadata.MLCube = mlcube_metadata.MLCube(path=mlcube)
    mlcube.platform = objects.load_object_from_file(
        file_path=platform, obj_class=platform_config.PlatformConfig)
    mlcube.invoke = mlcube_metadata.MLCubeInvoke(task)
    mlcube.task = mlcube_metadata.MLCubeTask(
        os.path.join(mlcube.tasks_path, f'{mlcube.invoke.task_name}.yaml'))
    print(mlcube)

    runner = DockerRun(mlcube)
    runner.run()
Пример #3
0
 def setUp(self):
     self.path_to_mlcube = os.path.join(os.path.dirname(__file__),
                                        "test_data/test_cube")
     self.path_to_platform = os.path.join(self.path_to_mlcube,
                                          "platforms/docker.yaml")
     self.path_to_task = os.path.join(self.path_to_mlcube,
                                      "run/kubernetes.yaml")
     self.mlcube = mlcube_metadata.MLCube(path=self.path_to_mlcube)
     self.mlcube.platform = objects.load_object_from_file(
         file_path=self.path_to_platform,
         obj_class=platform_config.PlatformConfig)
     self.mlcube.invoke = mlcube_metadata.MLCubeInvoke(self.path_to_task)
     self.mlcube_k8s_runner = KubernetesRun(mlcube=self.mlcube,
                                            loglevel="INFO")