云容器实例 CCI-替换PyTorchJob:请求消息

时间:2025-02-12 14:55:26

请求消息

请求参数

请求参数的详细描述请参见表165

请求示例:

更改PyTorchJob的结束存活时间ttlSecondsAfterFinished:

{    "apiVersion": "kubeflow.org/v1",    "kind": "PyTorchJob",    "metadata": {        "creationTimestamp": "2019-07-24T10:35:38Z",        "generation": 2,        "labels": {            "app": "test"        },        "name": "pytorch-test",        "namespace": "kube-test",        "resourceVersion": "72519846",        "selfLink": "/apis/kubeflow.org/v1/namespaces/kube-test/pytorchjobs/pytorch-test",        "uid": "c6e548f1-adfe-11e9-ba3a-b44326d0c915"    },    "spec": {        "pytorchReplicaSpecs": {            "Master": {                "replicas": 1,                "restartPolicy": "Never",                "template": {                    "spec": {                        "containers": [                            {                                "args": [                                    "--backend",                                    "gloo"                                ],                                "command": [                                    "python",                                    "/var/mnist.py"                                ],                                "image": "*.*.*.215:20202/gcs/pytorch-cpu:v1",                                "name": "pytorch",                                "resources": {                                    "limits": {                                        "cpu": 2,                                        "memory": "4Gi"                                    },                                    "requests": {                                        "cpu": 2,                                        "memory": "4Gi"                                    }                                }                            }                        ],                        "imagePullSecrets": [                            {                                "name": "imagepull-secret"                            }                        ]                    }                }            },            "Worker": {                "replicas": 1,                "restartPolicy": "OnFailure",                "template": {                    "spec": {                        "containers": [                            {                                "args": [                                    "--backend",                                    "gloo"                                ],                                "command": [                                    "python",                                    "/var/mnist.py"                                ],                                "image": "*.*.*.215:20202/gcs/pytorch-cpu:v1",                                "name": "pytorch",                                "resources": {                                    "limits": {                                        "cpu": 2,                                        "memory": "4Gi"                                    },                                    "requests": {                                        "cpu": 2,                                        "memory": "4Gi"                                    }                                }                            }                        ],                        "imagePullSecrets": [                            {                                "name": "imagepull-secret"                            }                        ]                    }                }            }        },        "ttlSecondsAfterFinished": 3000    },    "status": {        "conditions": [            {                "lastTransitionTime": "2019-07-24T10:36:26Z",                "lastUpdateTime": "2019-07-24T10:36:26Z",                "message": "PyTorchJob pytorch-test is created.",                "reason": "PyTorchJobCreated",                "status": "True",                "type": "Created"            }        ],        "replicaStatuses": {            "Master": {}        },        "startTime": "2019-07-24T10:36:26Z"    }}
support.huaweicloud.com/api-cci/cci_02_3167.html