Add clientset for MPIJob, PytorchJob, MXJob, and XGBoostJob (#1610)

This commit is contained in:
Yuki Iwai
2022-06-14 04:20:31 +00:00
committed by GitHub
parent c38406eb13
commit 0166d87791
233 changed files with 9003 additions and 8241 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail
repo_root="$(dirname ${BASH_SOURCE})/../.."
repo_root="$(dirname "${BASH_SOURCE}")/../.."
SWAGGER_JAR_URL="https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar"
SWAGGER_CODEGEN_JAR="${repo_root}/hack/python-sdk/openapi-generator-cli.jar"
@@ -40,7 +40,7 @@ if [[ ! -f "$SWAGGER_CODEGEN_JAR" ]]; then
fi
echo "Generating swagger file ..."
go run "${repo_root}"/hack/python-sdk/main.go ${VERSION} >"${SWAGGER_CODEGEN_FILE}"
go run "${repo_root}"/hack/swagger/main.go ${VERSION} >"${SWAGGER_CODEGEN_FILE}"
echo "Removing previously generated files ..."
rm -rf "${SDK_OUTPUT_PATH}"/docs/V1*.md "${SDK_OUTPUT_PATH}"/kubeflow/training/models "${SDK_OUTPUT_PATH}"/kubeflow/training/*.py "${SDK_OUTPUT_PATH}"/test/*.py
-107
View File
@@ -1,107 +0,0 @@
/*
Copyright 2021 kubeflow.org.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"os"
"strings"
mpi "github.com/kubeflow/training-operator/pkg/apis/mpi/v1"
mxnet "github.com/kubeflow/training-operator/pkg/apis/mxnet/v1"
pytorch "github.com/kubeflow/training-operator/pkg/apis/pytorch/v1"
tensorflow "github.com/kubeflow/training-operator/pkg/apis/tensorflow/v1"
xgboost "github.com/kubeflow/training-operator/pkg/apis/xgboost/v1"
"k8s.io/klog"
"k8s.io/kube-openapi/pkg/common"
"k8s.io/kube-openapi/pkg/validation/spec"
)
// Generate OpenAPI spec definitions for API resources
func main() {
if len(os.Args) <= 1 {
klog.Fatal("Supply a version")
}
version := os.Args[1]
if !strings.HasPrefix(version, "v") {
version = "v" + version
}
var oAPIDefs = map[string]common.OpenAPIDefinition{}
defs := spec.Definitions{}
refCallback := func(name string) spec.Ref {
return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(swaggify(name)))
}
for k, v := range tensorflow.GetOpenAPIDefinitions(refCallback) {
oAPIDefs[k] = v
}
for k, v := range pytorch.GetOpenAPIDefinitions(refCallback) {
oAPIDefs[k] = v
}
for k, v := range mxnet.GetOpenAPIDefinitions(refCallback) {
oAPIDefs[k] = v
}
for k, v := range xgboost.GetOpenAPIDefinitions(refCallback) {
oAPIDefs[k] = v
}
for k, v := range mpi.GetOpenAPIDefinitions(refCallback) {
oAPIDefs[k] = v
}
for defName, val := range oAPIDefs {
defs[swaggify(defName)] = val.Schema
}
swagger := spec.Swagger{
SwaggerProps: spec.SwaggerProps{
Swagger: "2.0",
Definitions: defs,
Paths: &spec.Paths{Paths: map[string]spec.PathItem{}},
Info: &spec.Info{
InfoProps: spec.InfoProps{
Title: "Kubeflow Training SDK",
Description: "Python SDK for Kubeflow Training",
Version: version,
},
},
},
}
jsonBytes, err := json.MarshalIndent(swagger, "", " ")
if err != nil {
klog.Fatal(err.Error())
}
fmt.Println(string(jsonBytes))
}
func swaggify(name string) string {
name = strings.Replace(name, "github.com/kubeflow/training-operator/pkg/apis/tensorflow/", "", -1)
name = strings.Replace(name, "github.com/kubeflow/training-operator/pkg/apis/pytorch/", "", -1)
name = strings.Replace(name, "github.com/kubeflow/training-operator/pkg/apis/mxnet/", "", -1)
name = strings.Replace(name, "github.com/kubeflow/training-operator/pkg/apis/xgboost/", "", -1)
name = strings.Replace(name, "github.com/kubeflow/training-operator/pkg/apis/mpi/", "", -1)
name = strings.Replace(name, "github.com/kubeflow/common/pkg/apis/common/", "", -1)
name = strings.Replace(name, "k8s.io/api/core/", "", -1)
name = strings.Replace(name, "k8s.io/apimachinery/pkg/apis/meta/", "", -1)
name = strings.Replace(name, "k8s.io/apimachinery/pkg/api/resource", "", -1)
name = strings.Replace(name, "/", ".", -1)
return name
}
+3 -1
View File
@@ -24,7 +24,9 @@ import re
__replacements = [
("import kubeflow.training", "from kubeflow.training.models import *"),
("kubeflow.training.models.v1\/.*.v1.", "V1")
("kubeflow.training.models.v1\/.*.v1.", "V1"),
("kubeflow.training.models.kubeflow/org/v1/", "kubeflow_org_v1_"),
("\.kubeflow.org.v1\.", ".KubeflowOrgV1"),
]
sdk_dir = os.path.abspath(os.path.join(__file__, "../../..", "sdk/python"))
+430 -430
View File
@@ -7,7 +7,7 @@
},
"paths": {},
"definitions": {
"v1.ElasticPolicy": {
"kubeflow.org.v1.ElasticPolicy": {
"type": "object",
"properties": {
"maxReplicas": {
@@ -45,7 +45,7 @@
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.RDZVConf"
"$ref": "#/definitions/kubeflow.org.v1.RDZVConf"
}
},
"rdzvHost": {
@@ -64,6 +64,434 @@
}
}
},
"kubeflow.org.v1.MPIJob": {
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.MPIJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"kubeflow.org.v1.MPIJobList": {
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.MPIJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"kubeflow.org.v1.MPIJobSpec": {
"type": "object",
"required": [
"mpiReplicaSpecs"
],
"properties": {
"cleanPodPolicy": {
"description": "CleanPodPolicy defines the policy that whether to kill pods after the job completes. Defaults to None.",
"type": "string"
},
"mainContainer": {
"description": "MainContainer specifies name of the main container which executes the MPI code.",
"type": "string"
},
"mpiReplicaSpecs": {
"description": "`MPIReplicaSpecs` contains maps from `MPIReplicaType` to `ReplicaSpec` that specify the MPI replicas to run.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
},
"runPolicy": {
"description": "`RunPolicy` encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"slotsPerWorker": {
"description": "Specifies the number of slots per worker used in hostfile. Defaults to 1.",
"type": "integer",
"format": "int32"
}
}
},
"kubeflow.org.v1.MXJob": {
"description": "MXJob is the Schema for the mxjobs API",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.MXJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"kubeflow.org.v1.MXJobList": {
"description": "MXJobList contains a list of MXJob",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.MXJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"kubeflow.org.v1.MXJobSpec": {
"description": "MXJobSpec defines the desired state of MXJob",
"type": "object",
"required": [
"runPolicy",
"jobMode",
"mxReplicaSpecs"
],
"properties": {
"jobMode": {
"description": "JobMode specify the kind of MXjob to do. Different mode may have different MXReplicaSpecs request",
"type": "string",
"default": ""
},
"mxReplicaSpecs": {
"description": "MXReplicaSpecs is map of commonv1.ReplicaType and commonv1.ReplicaSpec specifies the MX replicas to run. For example,\n {\n \"Scheduler\": commonv1.ReplicaSpec,\n \"Server\": commonv1.ReplicaSpec,\n \"Worker\": commonv1.ReplicaSpec,\n }",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
}
}
},
"kubeflow.org.v1.MXJobStatus": {
"description": "MXJobStatus defines the observed state of MXJob",
"type": "object"
},
"kubeflow.org.v1.PyTorchJob": {
"description": "PyTorchJob Represents a PyTorchJob resource.",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"description": "Specification of the desired state of the PyTorchJob.",
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.PyTorchJobSpec"
},
"status": {
"description": "Most recently observed status of the PyTorchJob. Read-only (modified by the system).",
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"kubeflow.org.v1.PyTorchJobList": {
"description": "PyTorchJobList is a list of PyTorchJobs.",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"description": "List of PyTorchJobs.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.PyTorchJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"description": "Standard list metadata.",
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"kubeflow.org.v1.PyTorchJobSpec": {
"description": "PyTorchJobSpec is a desired state description of the PyTorchJob.",
"type": "object",
"required": [
"runPolicy",
"pytorchReplicaSpecs"
],
"properties": {
"elasticPolicy": {
"$ref": "#/definitions/kubeflow.org.v1.ElasticPolicy"
},
"pytorchReplicaSpecs": {
"description": "A map of PyTorchReplicaType (type) to ReplicaSpec (value). Specifies the PyTorch cluster configuration. For example,\n {\n \"Master\": PyTorchReplicaSpec,\n \"Worker\": PyTorchReplicaSpec,\n }",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
}
}
},
"kubeflow.org.v1.RDZVConf": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"kubeflow.org.v1.TFJob": {
"description": "TFJob represents a TFJob resource.",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"description": "Specification of the desired state of the TFJob.",
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.TFJobSpec"
},
"status": {
"description": "Most recently observed status of the TFJob. Populated by the system. Read-only.",
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"kubeflow.org.v1.TFJobList": {
"description": "TFJobList is a list of TFJobs.",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"description": "List of TFJobs.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.TFJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"description": "Standard list metadata.",
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"kubeflow.org.v1.TFJobSpec": {
"description": "TFJobSpec is a desired state description of the TFJob.",
"type": "object",
"required": [
"runPolicy",
"tfReplicaSpecs"
],
"properties": {
"enableDynamicWorker": {
"description": "A switch to enable dynamic worker",
"type": "boolean"
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"successPolicy": {
"description": "SuccessPolicy defines the policy to mark the TFJob as succeeded. Default to \"\", using the default rules.",
"type": "string"
},
"tfReplicaSpecs": {
"description": "A map of TFReplicaType (type) to ReplicaSpec (value). Specifies the TF cluster configuration. For example,\n {\n \"PS\": ReplicaSpec,\n \"Worker\": ReplicaSpec,\n }",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
}
}
},
"kubeflow.org.v1.XGBoostJob": {
"description": "XGBoostJob is the Schema for the xgboostjobs API",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.XGBoostJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"kubeflow.org.v1.XGBoostJobList": {
"description": "XGBoostJobList contains a list of XGBoostJob",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kubeflow.org.v1.XGBoostJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"kubeflow.org.v1.XGBoostJobSpec": {
"description": "XGBoostJobSpec defines the desired state of XGBoostJob",
"type": "object",
"required": [
"runPolicy",
"xgbReplicaSpecs"
],
"properties": {
"runPolicy": {
"description": "INSERT ADDITIONAL SPEC FIELDS - desired state of cluster Important: Run \"make\" to regenerate code after modifying this file",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"xgbReplicaSpecs": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
}
}
},
"v1.JobCondition": {
"description": "JobCondition describes the state of the job at a certain point.",
"type": "object",
@@ -139,271 +567,6 @@
}
}
},
"v1.MPIJob": {
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/v1.MPIJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"v1.MPIJobList": {
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.MPIJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"v1.MPIJobSpec": {
"type": "object",
"required": [
"mpiReplicaSpecs"
],
"properties": {
"cleanPodPolicy": {
"description": "CleanPodPolicy defines the policy that whether to kill pods after the job completes. Defaults to None.",
"type": "string"
},
"mainContainer": {
"description": "MainContainer specifies name of the main container which executes the MPI code.",
"type": "string"
},
"mpiReplicaSpecs": {
"description": "`MPIReplicaSpecs` contains maps from `MPIReplicaType` to `ReplicaSpec` that specify the MPI replicas to run.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
},
"runPolicy": {
"description": "`RunPolicy` encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"slotsPerWorker": {
"description": "Specifies the number of slots per worker used in hostfile. Defaults to 1.",
"type": "integer",
"format": "int32"
}
}
},
"v1.MXJob": {
"description": "MXJob is the Schema for the mxjobs API",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/v1.MXJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"v1.MXJobList": {
"description": "MXJobList contains a list of MXJob",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.MXJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"v1.MXJobSpec": {
"description": "MXJobSpec defines the desired state of MXJob",
"type": "object",
"required": [
"runPolicy",
"jobMode",
"mxReplicaSpecs"
],
"properties": {
"jobMode": {
"description": "JobMode specify the kind of MXjob to do. Different mode may have different MXReplicaSpecs request",
"type": "string",
"default": ""
},
"mxReplicaSpecs": {
"description": "MXReplicaSpecs is map of common.ReplicaType and common.ReplicaSpec specifies the MX replicas to run. For example,\n {\n \"Scheduler\": common.ReplicaSpec,\n \"Server\": common.ReplicaSpec,\n \"Worker\": common.ReplicaSpec,\n }",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
}
}
},
"v1.MXJobStatus": {
"description": "MXJobStatus defines the observed state of MXJob",
"type": "object"
},
"v1.PyTorchJob": {
"description": "PyTorchJob Represents a PyTorchJob resource.",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"description": "Specification of the desired state of the PyTorchJob.",
"default": {},
"$ref": "#/definitions/v1.PyTorchJobSpec"
},
"status": {
"description": "Most recently observed status of the PyTorchJob. Read-only (modified by the system).",
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"v1.PyTorchJobList": {
"description": "PyTorchJobList is a list of PyTorchJobs.",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"description": "List of PyTorchJobs.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.PyTorchJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"description": "Standard list metadata.",
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"v1.PyTorchJobSpec": {
"description": "PyTorchJobSpec is a desired state description of the PyTorchJob.",
"type": "object",
"required": [
"runPolicy",
"pytorchReplicaSpecs"
],
"properties": {
"elasticPolicy": {
"$ref": "#/definitions/v1.ElasticPolicy"
},
"pytorchReplicaSpecs": {
"description": "A map of PyTorchReplicaType (type) to ReplicaSpec (value). Specifies the PyTorch cluster configuration. For example,\n {\n \"Master\": PyTorchReplicaSpec,\n \"Worker\": PyTorchReplicaSpec,\n }",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
}
}
},
"v1.RDZVConf": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"v1.ReplicaSpec": {
"description": "ReplicaSpec is a description of the replica",
"type": "object",
@@ -500,169 +663,6 @@
"type": "string"
}
}
},
"v1.TFJob": {
"description": "TFJob represents a TFJob resource.",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"description": "Specification of the desired state of the TFJob.",
"default": {},
"$ref": "#/definitions/v1.TFJobSpec"
},
"status": {
"description": "Most recently observed status of the TFJob. Populated by the system. Read-only.",
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"v1.TFJobList": {
"description": "TFJobList is a list of TFJobs.",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"description": "List of TFJobs.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.TFJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"description": "Standard list metadata.",
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"v1.TFJobSpec": {
"description": "TFJobSpec is a desired state description of the TFJob.",
"type": "object",
"required": [
"runPolicy",
"tfReplicaSpecs"
],
"properties": {
"enableDynamicWorker": {
"description": "A switch to enable dynamic worker",
"type": "boolean"
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"successPolicy": {
"description": "SuccessPolicy defines the policy to mark the TFJob as succeeded. Default to \"\", using the default rules.",
"type": "string"
},
"tfReplicaSpecs": {
"description": "A map of TFReplicaType (type) to ReplicaSpec (value). Specifies the TF cluster configuration. For example,\n {\n \"PS\": ReplicaSpec,\n \"Worker\": ReplicaSpec,\n }",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
}
}
},
"v1.XGBoostJob": {
"description": "XGBoostJob is the Schema for the xgboostjobs API",
"type": "object",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/v1.XGBoostJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
},
"v1.XGBoostJobList": {
"description": "XGBoostJobList contains a list of XGBoostJob",
"type": "object",
"required": [
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.XGBoostJob"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
},
"v1.XGBoostJobSpec": {
"description": "XGBoostJobSpec defines the desired state of XGBoostJob",
"type": "object",
"required": [
"runPolicy",
"xgbReplicaSpecs"
],
"properties": {
"runPolicy": {
"description": "INSERT ADDITIONAL SPEC FIELDS - desired state of cluster Important: Run \"make\" to regenerate code after modifying this file",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"xgbReplicaSpecs": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ReplicaSpec"
}
}
}
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"packageName" : "kubeflow.training",
"projectName" : "training",
"packageVersion": "1.3.0",
"packageVersion": "1.4.0",
"importMappings": {
"V1Container": "from kubernetes.client import V1Container",
"V1ObjectMeta": "from kubernetes.client import V1ObjectMeta",