コード例 #1
0
    def test_parse_from_labels(self):
        inspect_result = docker_inspect.InspectResult(
            "openmindstudio",
            "trialslot_nnimain_d65bc5ac",
            "tuner",
            "0",
            "this_is_pod_name_val",
            "0,1,",
            12345,
            "*****@*****.**",
            "platform",
            False,
            False,
        )

        gpu_ids, labels = ContainerCollector.parse_from_labels(
            inspect_result, None)
        self.assertEqual(["0", "1"], gpu_ids)

        target_labels = {
            "username": "******",
            "job_name": "trialslot_nnimain_d65bc5ac",
            "role_name": "tuner",
            "task_index": "0",
            "pod_name": "this_is_pod_name_val",
            "user_email": "*****@*****.**",
            "vc_name": "platform",
            "preemptible": "false",
        }

        self.assertEqual(target_labels, labels)
コード例 #2
0
    def test_parse_from_labels(self):
        inspect_result = docker_inspect.InspectResult(
            "openmindstudio", "trialslot_nnimain_d65bc5ac", "tuner", "0",
            "0,1,", 12345)

        gpu_ids, labels = ContainerCollector.parse_from_labels(
            inspect_result, None)
        self.assertEqual(["0", "1"], gpu_ids)

        target_labels = {
            "username": "******",
            "job_name": "trialslot_nnimain_d65bc5ac",
            "role_name": "tuner",
            "task_index": "0"
        }

        self.assertEqual(target_labels, labels)
コード例 #3
0
ファイル: test_collector.py プロジェクト: shen-hui/pai
    def test_parse_from_labels(self):
        inspect_result = docker_inspect.InspectResult(
            "openmindstudio", "trialslot_nnimain_d65bc5ac", "tuner", "0",
            "0,1,", "application_1522829300813_1943", "default", 12345)

        gpu_ids, labels = ContainerCollector.parse_from_labels(
            inspect_result, None)
        self.assertEqual(["0", "1"], gpu_ids)

        target_labels = {
            "username": "******",
            "job_name": "trialslot_nnimain_d65bc5ac",
            "role_name": "tuner",
            "task_index": "0",
            "job_instance_id": "application_1522829300813_1943",
            "virtual_cluster": "default"
        }

        self.assertEqual(target_labels, labels)