云容器实例 CCI-查询指定namespace下的所有TFJob:响应消息

时间:2024-11-06 15:35:37

响应消息

响应参数

响应参数的详细描述请参见表168

响应示例:

{
    "apiVersion": "kubeflow.org/v1",
    "items": [
        {
            "apiVersion": "kubeflow.org/v1",
            "kind": "TFJob",
            "metadata": {
                "creationTimestamp": "2019-07-23T12:39:47Z",
                "generation": 1,
                "name": "tfjob-test",
                "namespace": "kube-test",
                "resourceVersion": "72050567",
                "selfLink": "/apis/kubeflow.org/v1/namespaces/kube-test/tfjobs/tfjob-test",
                "uid": "f461f966-ad46-11e9-aaa4-340a9837e413"
            },
            "spec": {
                "backoffLimit": 6,
                "tfReplicaSpecs": {
                    "Ps": {
                        "replicas": 1,
                        "template": {
                            "spec": {
                                "containers": [
                                    {
                                        "args": [
                                            "python",
                                            "/opt/tf-benchmarks/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py",
                                            "--batch_size=1",
                                            "--model=resnet50",
                                            "--variable_update=parameter_server",
                                            "--flush_stdout=true",
                                            "--num_gpus=1",
                                            "--local_parameter_device=cpu",
                                            "--device=cpu",
                                            "--data_format=NHWC"
                                        ],
                                        "image": "*.*.*.215:20202/cci/tf-benchmarks-cpu:v1",
                                        "name": "tensorflow",
                                        "ports": [
                                            {
                                                "containerPort": 2222,
                                                "name": "tfjob-port"
                                            }
                                        ],
                                        "resources": {
                                            "limits": {
                                                "cpu": "2",
                                                "memory": "4Gi"
                                            },
                                            "requests": {
                                                "cpu": "2",
                                                "memory": "4Gi"
                                            }
                                        }
                                    }
                                ],
                                "imagePullSecrets": [
                                    {
                                        "name": "imagepull-secret"
                                    }
                                ],
                                "restartPolicy": "OnFailure"
                            }
                        }
                    },
                    "Worker": {
                        "replicas": 1,
                        "template": {
                            "spec": {
                                "containers": [
                                    {
                                        "args": [
                                            "python",
                                            "/opt/tf-benchmarks/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py",
                                            "--batch_size=1",
                                            "--model=resnet50",
                                            "--variable_update=parameter_server",
                                            "--flush_stdout=true",
                                            "--local_parameter_device=cpu",
                                            "--device=cpu",
                                            "--data_format=NHWC"
                                        ],
                                        "image": "*.*.*.215:20202/cci/tf-benchmarks-cpu:v1",
                                        "name": "tensorflow",
                                        "ports": [
                                            {
                                                "containerPort": 2222,
                                                "name": "tfjob-port"
                                            }
                                        ],
                                        "resources": {
                                            "limits": {
                                                "cpu": "2",
                                                "memory": "4Gi"
                                            },
                                            "requests": {
                                                "cpu": "2",
                                                "memory": "4Gi"
                                            }
                                        }
                                    }
                                ],
                                "imagePullSecrets": [
                                    {
                                        "name": "imagepull-secret"
                                    }
                                ],
                                "restartPolicy": "OnFailure"
                            }
                        }
                    }
                }
            },
            "status": {
                "conditions": [
                    {
                        "lastTransitionTime": "2019-07-23T12:38:58Z",
                        "lastUpdateTime": "2019-07-23T12:38:58Z",
                        "message": "TFJob tfjob-test is created.",
                        "reason": "TFJobCreated",
                        "status": "True",
                        "type": "Created"
                    },
                    {
                        "lastTransitionTime": "2019-07-23T12:39:30Z",
                        "lastUpdateTime": "2019-07-23T12:39:30Z",
                        "message": "TFJob tfjob-test is running.",
                        "reason": "TFJobRunning",
                        "status": "True",
                        "type": "Running"
                    }
                ],
                "replicaStatuses": {
                    "PS": {
                        "active": 1
                    },
                    "Worker": {
                        "active": 1
                    }
                },
                "startTime": "2019-07-23T12:38:58Z"
            }
        }
    ],
    "kind": "TFJobList",
    "metadata": {
        "continue": "",
        "resourceVersion": "72353810",
        "selfLink": "/apis/kubeflow.org/v1/namespaces/kube-test/tfjobs"
    }
}
support.huaweicloud.com/api-cci/cci_02_3143.html