云容器实例 CCI-创建MXJob:请求消息

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

请求消息

请求参数

请求参数的详细描述请参考表162

请求示例:

{
    "apiVersion": "kubeflow.org/v1",
    "kind": "MXJob",
    "metadata": {
        "name": "mxnet-job"
    },
    "spec": {
        "cleanPodPolicy": "Running",
        "jobMode": "MXTrain",
        "mxReplicaSpecs": {
            "Scheduler": {
                "replicas": 1,
                "restartPolicy": "Never",
                "template": {
                    "spec": {
                        "imagePullSecrets": [
                            {
                                "name": "imagepull-secret"
                            }
                        ],
                        "containers": [
                            {
                                "name": "mxnet",
                                "image": "*.*.*.215:20202/cci/mxnet:xsw-dis",
                                "command": [
                                    "/bin/bash"
                                ],
                                "args": [
                                    "-c",
                                    "python train_imagenet.py"
                                ],
                                "resources": {
                                    "requests": {
                                        "cpu": "1000m",
                                        "memory": "2Gi"
                                    },
                                    "limits": {
                                        "cpu": "1000m",
                                        "memory": "2Gi"
                                    }
                                }
                            }
                        ]
                    }
                }
            },
            "Server": {
                "replicas": 1,
                "restartPolicy": "Never",
                "template": {
                    "spec": {
                        "imagePullSecrets": [
                            {
                                "name": "imagepull-secret"
                            }
                        ],
                        "containers": [
                            {
                                "name": "mxnet",
                                "image": "*.*.*.215:20202/cci/mxnet:xsw-dis",
                                "command": [
                                    "/bin/bash"
                                ],
                                "args": [
                                    "-c",
                                    "python train_imagenet.py"
                                ],
                                "resources": {
                                    "requests": {
                                        "cpu": "1000m",
                                        "memory": "2Gi"
                                    },
                                    "limits": {
                                        "cpu": "1000m",
                                        "memory": "2Gi"
                                    }
                                }
                            }
                        ]
                    }
                }
            },
            "Worker": {
                "replicas": 1,
                "restartPolicy": "Never",
                "template": {
                    "spec": {
                        "imagePullSecrets": [
                            {
                                "name": "imagepull-secret"
                            }
                        ],
                        "containers": [
                            {
                                "name": "mxnet",
                                "image": "*.*.*.215:20202/cci/mxnet:xsw-dis",
                                "command": [
                                    "/bin/bash"
                                ],
                                "args": [
                                    "-c",
                                    "python train_imagenet.py --benchmark 1  --network resnet --batch-size 1 --num-epochs 1 --kv-store dist_sync --num-examples 500"
                                ],
                                "resources": {
                                    "requests": {
                                        "cpu": "1000m",
                                        "memory": "2Gi"
                                    },
                                    "limits": {
                                        "cpu": "1000m",
                                        "memory": "2Gi"
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
}
support.huaweicloud.com/api-cci/cci_02_3151.html