Upgrade Kubernetes dependencies (#502)

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
This commit is contained in:
Yuki Iwai 2023-01-27 03:13:09 +09:00 committed by GitHub
parent cd83424f65
commit 05ac6addc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 2662 additions and 1514 deletions

110
Makefile
View File

@ -1,3 +1,17 @@
# Copyright 2023 The Kubeflow Authors.
#
# 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.
BIN_DIR=_output/cmd/bin
REPO_PATH="github.com/kubeflow/mpi-operator"
REL_OSARCH="linux/amd64"
@ -8,22 +22,24 @@ CONTROLLER_VERSION?=v2
BASE_IMAGE_SSH_PORT?=2222
IMG_BUILDER=docker
LD_FLAGS_V2=" \
-X '${REPO_PATH}/v2/pkg/version.GitSHA=${GitSHA}' \
-X '${REPO_PATH}/v2/pkg/version.Built=${Date}' \
-X '${REPO_PATH}/v2/pkg/version.Version=${RELEASE_VERSION}'"
-X '${REPO_PATH}/pkg/version.GitSHA=${GitSHA}' \
-X '${REPO_PATH}/pkg/version.Built=${Date}' \
-X '${REPO_PATH}/pkg/version.Version=${RELEASE_VERSION}'"
IMAGE_NAME?=mpioperator/mpi-operator
KUBEBUILDER_ASSETS_PATH := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))bin/kubebuilder/bin
KIND_VERSION=v0.11.1
KIND_VERSION=v0.17.0
# This kubectl version supports -k for kustomization.
KUBECTL_VERSION=v1.21.4
KUBECTL_VERSION=v1.25.6
ENVTEST_K8S_VERSION=1.25.0
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
GOARCH=$(shell go env GOARCH)
GOOS=$(shell go env GOOS)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true"
build: all
all: ${BIN_DIR} fmt tidy lint test mpi-operator.v2
all: ${BIN_DIR} fmt vet tidy lint test mpi-operator.v2
.PHONY: mpi-operator.v2
mpi-operator.v2:
@ -36,10 +52,14 @@ ${BIN_DIR}:
fmt:
go fmt ./...
.PHONY: vet
vet:
go vet ./...
.PHONY: test
test: export KUBEBUILDER_ASSETS = ${KUBEBUILDER_ASSETS_PATH}
test: bin/kubebuilder
go test -covermode atomic -coverprofile=profile.cov ./...
test:
test: bin/envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -covermode atomic -coverprofile=profile.cov ./...
# Only works with CONTROLLER_VERSION=v2
.PHONY: test_e2e
@ -54,8 +74,10 @@ dev_manifest:
.PHONY: generate
generate:
go generate ./pkg/... ./cmd/... && \
openapi-gen --input-dirs github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,github.com/kubeflow/common/pkg/apis/common/v1 --output-package github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1 --go-header-file hack/boilerplate/boilerplate.go.txt
go generate ./pkg/... ./cmd/...
hack/update-codegen.sh
$(MAKE) crd
hack/python-sdk/gen-sdk.sh
.PHONY: clean
clean:
@ -80,50 +102,38 @@ test_images:
tidy:
go mod tidy -go 1.19
GOLANGCI_LINT = ./bin/golangci-lint
bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.50.1
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
K8S_VERSION := "1.19.2"
bin/kubebuilder:
curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-${K8S_VERSION}-${GOOS}-${GOARCH}.tar.gz"
mkdir -p bin/kubebuilder
tar -C bin/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz
rm envtest-bins.tar.gz
bin/kubectl:
mkdir -p bin
curl -L -o bin/kubectl https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
chmod +x bin/kubectl
.PHONY: lint
lint: bin/golangci-lint ## Run golangci-lint linter
$(GOLANGCI_LINT) run --new-from-rev=origin/master --go 1.19
.PHONY: kind
kind:
go install sigs.k8s.io/kind@${KIND_VERSION}
# Generate CRD
crd: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=crd
.PHONY: bin
bin:
mkdir -p $(PROJECT_DIR)/bin
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
.PHONY: bin/golangci-lint
bin/golangci-lint: bin
@GOBIN=$(PROJECT_DIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest
bin/envtest: bin ## Download envtest-setup locally if necessary.
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
bin/kubectl: bin
curl -L -o $(PROJECT_DIR)/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/$(GOOS)/$(GOARCH)/kubectl
chmod +x $(PROJECT_DIR)/bin/kubectl
.PHONY: kind
kind: bin
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/kind@${KIND_VERSION}
# Download controller-gen locally if necessary
CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
controller-gen:
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1)
# go-get-tool will 'go get' any package $2 and install it to $1.
define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef
.PHONY: controller-gen
controller-gen: bin
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1

View File

@ -207,12 +207,12 @@ func Run(opt *options.ServerOption) error {
}
}()
rl := &resourcelock.EndpointsLock{
EndpointsMeta: metav1.ObjectMeta{
rl := &resourcelock.LeaseLock{
LeaseMeta: metav1.ObjectMeta{
Namespace: opt.LockNamespace,
Name: controllerName,
},
Client: leaderElectionClientSet.CoreV1(),
Client: leaderElectionClientSet.CoordinationV1(),
LockConfig: resourcelock.ResourceLockConfig{
Identity: id,
EventRecorder: recorder,

File diff suppressed because it is too large Load Diff

116
go.mod
View File

@ -3,78 +3,78 @@ module github.com/kubeflow/mpi-operator
go 1.19
require (
github.com/go-openapi/spec v0.20.3
github.com/google/go-cmp v0.5.6
github.com/kubeflow/common v0.4.0
github.com/onsi/ginkgo v1.14.1
github.com/onsi/gomega v1.10.2
github.com/prometheus/client_golang v1.10.0
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
k8s.io/api v0.19.9
k8s.io/apimachinery v0.19.9
k8s.io/apiserver v0.19.9
k8s.io/client-go v0.19.9
github.com/google/go-cmp v0.5.8
github.com/kubeflow/common v0.4.6
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.20.1
github.com/prometheus/client_golang v1.12.2
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
k8s.io/api v0.25.6
k8s.io/apimachinery v0.25.6
k8s.io/apiserver v0.25.6
k8s.io/client-go v0.25.6
k8s.io/code-generator v0.25.6
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
k8s.io/sample-controller v0.19.9
sigs.k8s.io/controller-runtime v0.7.2
volcano.sh/apis v1.2.0-k8s1.19.6
k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596
k8s.io/sample-controller v0.25.6
sigs.k8s.io/controller-runtime v0.13.1
volcano.sh/apis v1.7.0
)
require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.0+incompatible // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-logr/logr v0.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/googleapis/gnostic v0.5.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.10 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/nxadm/tail v1.4.4 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.18.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.24.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/tools v0.4.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
k8s.io/apiextensions-apiserver v0.19.2 // indirect
k8s.io/component-base v0.19.9 // indirect
k8s.io/klog/v2 v2.2.0 // indirect
k8s.io/utils v0.0.0-20200912215256-4140de9c8800 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/component-base v0.25.6 // indirect
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace k8s.io/code-generator => k8s.io/code-generator v0.19.9

805
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ fi
mv pkg/apis/kubeflow/v2beta1/openapi_generated.go pkg/apis/kubeflow/v2beta1/openapi_generated.go.backup
echo "Generating V2 OpenAPI specification ..."
openapi-gen --input-dirs github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,github.com/kubeflow/common/pkg/apis/common/v1 --output-package github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1 --go-header-file hack/boilerplate/boilerplate.go.txt
openapi-gen --input-dirs github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1,github.com/kubeflow/common/pkg/apis/common/v1 --output-package github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1 --go-header-file hack/boilerplate/boilerplate.go.txt
echo "Generating V2 swagger file ..."
go run hack/python-sdk/main.go v2beta1 > ${SWAGGER_V2_CODEGEN_FILE}

View File

@ -22,9 +22,9 @@ import (
"os"
"strings"
"github.com/go-openapi/spec"
"k8s.io/klog"
"k8s.io/kube-openapi/pkg/common"
"k8s.io/kube-openapi/pkg/validation/spec"
mpijobv2 "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
)
@ -44,6 +44,7 @@ func main() {
return spec.MustCreateRef(
"#/definitions/" + common.EscapeJsonPointer(swaggify(name)))
}
oAPIDefs := mpijobv2.GetOpenAPIDefinitions(filter)
defs := spec.Definitions{}
for defName, val := range oAPIDefs {

26
hack/tools.go Normal file
View File

@ -0,0 +1,26 @@
//go:build tools
// Copyright 2023 The Kubeflow Authors.
//
// 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 tools
import (
_ "k8s.io/code-generator/cmd/client-gen"
_ "k8s.io/code-generator/cmd/deepcopy-gen"
_ "k8s.io/code-generator/cmd/defaulter-gen"
_ "k8s.io/code-generator/cmd/informer-gen"
_ "k8s.io/code-generator/cmd/lister-gen"
_ "k8s.io/code-generator/cmd/openapi-gen"
)

View File

@ -18,8 +18,8 @@ set -o errexit
set -o nounset
set -o pipefail
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
pushd $SCRIPT_ROOT
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
pushd "${SCRIPT_ROOT}"
SCRIPT_ROOT=$(pwd)
popd
@ -28,8 +28,8 @@ popd
# Reference: https://github.com/kubernetes/code-generator/issues/57
CODEGEN_VERSION=$(grep 'k8s.io/code-generator' go.sum | awk '{print $2}' | sed 's/\/go.mod//g' | head -1)
CODEGEN_PKG=$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}")
chmod +x ${CODEGEN_PKG}/generate-groups.sh
chmod +x "${CODEGEN_PKG}/generate-groups.sh"
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
"${CODEGEN_PKG}/generate-groups.sh" "deepcopy,client,informer,lister" \
github.com/kubeflow/mpi-operator/pkg/client github.com/kubeflow/mpi-operator/pkg/apis \
kubeflow:v2beta1 --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt
kubeflow:v2beta1 --go-header-file "${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt"

View File

@ -83,6 +83,12 @@ rules:
- mpijobs/status
verbs:
- "*"
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- "*"
- apiGroups:
- scheduling.incubator.k8s.io
- scheduling.sigs.dev

View File

@ -16,6 +16,6 @@
// +k8s:defaulter-gen=TypeMeta
// +k8s:openapi-gen=true
// Package v1 is the v1 version of the API.
// Package v2beta1 is the v2beta1 version of the API.
// +groupName=kubeflow.org
package v2beta1

View File

@ -1,7 +1,7 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Copyright 2021 The Kubeflow Authors
// Copyright 2023 The Kubeflow Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -22,18 +22,18 @@
package v2beta1
import (
spec "github.com/go-openapi/spec"
common "k8s.io/kube-openapi/pkg/common"
spec "k8s.io/kube-openapi/pkg/validation/spec"
)
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
return map[string]common.OpenAPIDefinition{
"github.com/kubeflow/common/pkg/apis/common/v1.JobCondition": schema_pkg_apis_common_v1_JobCondition(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.JobStatus": schema_pkg_apis_common_v1_JobStatus(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.ReplicaSpec": schema_pkg_apis_common_v1_ReplicaSpec(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.ReplicaStatus": schema_pkg_apis_common_v1_ReplicaStatus(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.RunPolicy": schema_pkg_apis_common_v1_RunPolicy(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.SchedulingPolicy": schema_pkg_apis_common_v1_SchedulingPolicy(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.JobCondition": schema_pkg_apis_common_v1_JobCondition(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.JobStatus": schema_pkg_apis_common_v1_JobStatus(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.ReplicaSpec": schema_pkg_apis_common_v1_ReplicaSpec(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.ReplicaStatus": schema_pkg_apis_common_v1_ReplicaStatus(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.RunPolicy": schema_pkg_apis_common_v1_RunPolicy(ref),
"github.com/kubeflow/common/pkg/apis/common/v1.SchedulingPolicy": schema_pkg_apis_common_v1_SchedulingPolicy(ref),
"github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJob": schema_pkg_apis_kubeflow_v2beta1_MPIJob(ref),
"github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJobList": schema_pkg_apis_kubeflow_v2beta1_MPIJobList(ref),
"github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJobSpec": schema_pkg_apis_kubeflow_v2beta1_MPIJobSpec(ref),
@ -50,6 +50,7 @@ func schema_pkg_apis_common_v1_JobCondition(ref common.ReferenceCallback) common
"type": {
SchemaProps: spec.SchemaProps{
Description: "Type of job condition.",
Default: "",
Type: []string{"string"},
Format: "",
},
@ -57,6 +58,7 @@ func schema_pkg_apis_common_v1_JobCondition(ref common.ReferenceCallback) common
"status": {
SchemaProps: spec.SchemaProps{
Description: "Status of the condition, one of True, False, Unknown.",
Default: "",
Type: []string{"string"},
Format: "",
},
@ -78,12 +80,14 @@ func schema_pkg_apis_common_v1_JobCondition(ref common.ReferenceCallback) common
"lastUpdateTime": {
SchemaProps: spec.SchemaProps{
Description: "The last time this condition was updated.",
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
},
},
"lastTransitionTime": {
SchemaProps: spec.SchemaProps{
Description: "Last time the condition transitioned from one status to another.",
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
},
},
@ -110,7 +114,8 @@ func schema_pkg_apis_common_v1_JobStatus(ref common.ReferenceCallback) common.Op
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.JobCondition"),
Default: map[string]interface{}{},
Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.JobCondition"),
},
},
},
@ -174,6 +179,7 @@ func schema_pkg_apis_common_v1_ReplicaSpec(ref common.ReferenceCallback) common.
"template": {
SchemaProps: spec.SchemaProps{
Description: "Template is the object that describes the pod that will be created for this replica. RestartPolicy in PodTemplateSpec will be overide by RestartPolicy in ReplicaSpec",
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"),
},
},
@ -220,9 +226,24 @@ func schema_pkg_apis_common_v1_ReplicaStatus(ref common.ReferenceCallback) commo
Format: "int32",
},
},
"labelSelector": {
SchemaProps: spec.SchemaProps{
Description: "Deprecated: Use Selector instead",
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"),
},
},
"selector": {
SchemaProps: spec.SchemaProps{
Description: "A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects.",
Type: []string{"string"},
Format: "",
},
},
},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"},
}
}
@ -301,7 +322,8 @@ func schema_pkg_apis_common_v1_SchedulingPolicy(ref common.ReferenceCallback) co
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"),
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"),
},
},
},
@ -313,6 +335,12 @@ func schema_pkg_apis_common_v1_SchedulingPolicy(ref common.ReferenceCallback) co
Format: "",
},
},
"scheduleTimeoutSeconds": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
},
},
},
@ -343,17 +371,20 @@ func schema_pkg_apis_kubeflow_v2beta1_MPIJob(ref common.ReferenceCallback) commo
},
"metadata": {
SchemaProps: spec.SchemaProps{
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
},
},
"spec": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJobSpec"),
Default: map[string]interface{}{},
Ref: ref("github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJobSpec"),
},
},
"status": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.JobStatus"),
Default: map[string]interface{}{},
Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.JobStatus"),
},
},
},
@ -386,7 +417,8 @@ func schema_pkg_apis_kubeflow_v2beta1_MPIJobList(ref common.ReferenceCallback) c
},
"metadata": {
SchemaProps: spec.SchemaProps{
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
},
},
"items": {
@ -395,7 +427,8 @@ func schema_pkg_apis_kubeflow_v2beta1_MPIJobList(ref common.ReferenceCallback) c
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJob"),
Default: map[string]interface{}{},
Ref: ref("github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1.MPIJob"),
},
},
},
@ -426,6 +459,7 @@ func schema_pkg_apis_kubeflow_v2beta1_MPIJobSpec(ref common.ReferenceCallback) c
"runPolicy": {
SchemaProps: spec.SchemaProps{
Description: "RunPolicy encapsulates various runtime policies of the job.",
Default: map[string]interface{}{},
Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.RunPolicy"),
},
},
@ -458,7 +492,7 @@ func schema_pkg_apis_kubeflow_v2beta1_MPIJobSpec(ref common.ReferenceCallback) c
},
},
},
Required: []string{"runPolicy", "mpiReplicaSpecs"},
Required: []string{"mpiReplicaSpecs"},
},
},
Dependencies: []string{

View File

@ -17,10 +17,12 @@
"properties": {
"lastTransitionTime": {
"description": "Last time the condition transitioned from one status to another.",
"default": {},
"$ref": "#/definitions/v1.Time"
},
"lastUpdateTime": {
"description": "The last time this condition was updated.",
"default": {},
"$ref": "#/definitions/v1.Time"
},
"message": {
@ -33,11 +35,13 @@
},
"status": {
"description": "Status of the condition, one of True, False, Unknown.",
"type": "string"
"type": "string",
"default": ""
},
"type": {
"description": "Type of job condition.",
"type": "string"
"type": "string",
"default": ""
}
}
},
@ -57,6 +61,7 @@
"description": "Conditions is an array of current observed job conditions.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.JobCondition"
}
},
@ -92,6 +97,7 @@
},
"template": {
"description": "Template is the object that describes the pod that will be created for this replica. RestartPolicy in PodTemplateSpec will be overide by RestartPolicy in ReplicaSpec",
"default": {},
"$ref": "#/definitions/v1.PodTemplateSpec"
}
}
@ -110,6 +116,14 @@
"type": "integer",
"format": "int32"
},
"labelSelector": {
"description": "Deprecated: Use Selector instead",
"$ref": "#/definitions/v1.LabelSelector"
},
"selector": {
"description": "A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects.",
"type": "string"
},
"succeeded": {
"description": "The number of pods which reached phase Succeeded.",
"type": "integer",
@ -157,6 +171,7 @@
"minResources": {
"type": "object",
"additionalProperties": {
"default": {},
"$ref": "#/definitions/resource.Quantity"
}
},
@ -165,6 +180,10 @@
},
"queue": {
"type": "string"
},
"scheduleTimeoutSeconds": {
"type": "integer",
"format": "int32"
}
}
},
@ -180,12 +199,15 @@
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/v2beta1.MPIJobSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/v1.JobStatus"
}
}
@ -204,6 +226,7 @@
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v2beta1.MPIJob"
}
},
@ -212,6 +235,7 @@
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1.ListMeta"
}
}
@ -235,6 +259,7 @@
},
"runPolicy": {
"description": "RunPolicy encapsulates various runtime policies of the job.",
"default": {},
"$ref": "#/definitions/v1.RunPolicy"
},
"slotsPerWorker": {

View File

@ -40,6 +40,7 @@ type MPIJobList struct {
type MPIJobSpec struct {
// Specifies the number of slots per worker used in hostfile.
// Defaults to 1.
// +optional
// +kubebuilder:default:=1
SlotsPerWorker *int32 `json:"slotsPerWorker,omitempty"`
@ -52,6 +53,7 @@ type MPIJobSpec struct {
MPIReplicaSpecs map[MPIReplicaType]*common.ReplicaSpec `json:"mpiReplicaSpecs"`
// SSHAuthMountPath is the directory where SSH keys are mounted.
// Defaults to "/root/.ssh".
// +kubebuilder:default:="/root/.ssh"
SSHAuthMountPath string `json:"sshAuthMountPath,omitempty"`

View File

@ -1,13 +1,13 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Copyright The Kubeflow Authors
// Copyright 2023 The Kubeflow Authors.
//
// 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
// 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,
@ -15,13 +15,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by controller-gen. DO NOT EDIT.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v2beta1
import (
"github.com/kubeflow/common/pkg/apis/common/v1"
"k8s.io/apimachinery/pkg/runtime"
v1 "github.com/kubeflow/common/pkg/apis/common/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -31,6 +31,7 @@ func (in *MPIJob) DeepCopyInto(out *MPIJob) {
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIJob.
@ -63,6 +64,7 @@ func (in *MPIJobList) DeepCopyInto(out *MPIJobList) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIJobList.
@ -107,6 +109,7 @@ func (in *MPIJobSpec) DeepCopyInto(out *MPIJobSpec) {
(*out)[key] = outVal
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIJobSpec.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -18,6 +18,7 @@ package versioned
import (
"fmt"
"net/http"
kubeflowv2beta1 "github.com/kubeflow/mpi-operator/pkg/client/clientset/versioned/typed/kubeflow/v2beta1"
discovery "k8s.io/client-go/discovery"
@ -53,22 +54,45 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
// NewForConfig creates a new Clientset for the given config.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfig will generate a rate-limiter in configShallowCopy.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.UserAgent == "" {
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
}
// share the transport between all clients
httpClient, err := rest.HTTPClientFor(&configShallowCopy)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&configShallowCopy, httpClient)
}
// NewForConfigAndClient creates a new Clientset for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfigAndClient will generate a rate-limiter in configShallowCopy.
func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var cs Clientset
var err error
cs.kubeflowV2beta1, err = kubeflowv2beta1.NewForConfig(&configShallowCopy)
cs.kubeflowV2beta1, err = kubeflowv2beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
@ -78,11 +102,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.kubeflowV2beta1 = kubeflowv2beta1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
cs, err := NewForConfig(c)
if err != nil {
panic(err)
}
return cs
}
// New creates a new Clientset for the given RESTClient.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -72,7 +72,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ clientset.Interface = &Clientset{}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
)
// KubeflowV2beta1 retrieves the KubeflowV2beta1Client
func (c *Clientset) KubeflowV2beta1() kubeflowv2beta1.KubeflowV2beta1Interface {

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -115,7 +115,7 @@ func (c *FakeMPIJobs) UpdateStatus(ctx context.Context, mPIJob *v2beta1.MPIJob,
// Delete takes name of the mPIJob and deletes it. Returns an error if one occurs.
func (c *FakeMPIJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(mpijobsResource, c.ns, name), &v2beta1.MPIJob{})
Invokes(testing.NewDeleteActionWithOptions(mpijobsResource, c.ns, name, opts), &v2beta1.MPIJob{})
return err
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -17,6 +17,8 @@
package v2beta1
import (
"net/http"
v2beta1 "github.com/kubeflow/mpi-operator/pkg/apis/kubeflow/v2beta1"
"github.com/kubeflow/mpi-operator/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@ -37,12 +39,28 @@ func (c *KubeflowV2beta1Client) MPIJobs(namespace string) MPIJobInterface {
}
// NewForConfig creates a new KubeflowV2beta1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*KubeflowV2beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new KubeflowV2beta1Client for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*KubeflowV2beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Kubeflow Authors.
// Copyright 2023 The Kubeflow Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -9,8 +9,8 @@ Name | Type | Description | Notes
**last_update_time** | [**V1Time**](V1Time.md) | | [optional]
**message** | **str** | A human readable message indicating details about the transition. | [optional]
**reason** | **str** | The reason for the condition&#39;s last transition. | [optional]
**status** | **str** | Status of the condition, one of True, False, Unknown. |
**type** | **str** | Type of job condition. |
**status** | **str** | Status of the condition, one of True, False, Unknown. | [default to '']
**type** | **str** | Type of job condition. | [default to '']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -7,6 +7,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**active** | **int** | The number of actively running pods. | [optional]
**failed** | **int** | The number of pods which reached phase Failed. | [optional]
**label_selector** | [**V1LabelSelector**](V1LabelSelector.md) | | [optional]
**selector** | **str** | A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects. | [optional]
**succeeded** | **int** | The number of pods which reached phase Succeeded. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -9,6 +9,7 @@ Name | Type | Description | Notes
**min_resources** | [**dict(str, ResourceQuantity)**](ResourceQuantity.md) | | [optional]
**priority_class** | **str** | | [optional]
**queue** | **str** | | [optional]
**schedule_timeout_seconds** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -50,7 +50,7 @@ class V1JobCondition(object):
'type': 'type'
}
def __init__(self, last_transition_time=None, last_update_time=None, message=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501
def __init__(self, last_transition_time=None, last_update_time=None, message=None, reason=None, status='', type='', local_vars_configuration=None): # noqa: E501
"""V1JobCondition - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration.get_default_copy()

View File

@ -35,16 +35,20 @@ class V1ReplicaStatus(object):
openapi_types = {
'active': 'int',
'failed': 'int',
'label_selector': 'V1LabelSelector',
'selector': 'str',
'succeeded': 'int'
}
attribute_map = {
'active': 'active',
'failed': 'failed',
'label_selector': 'labelSelector',
'selector': 'selector',
'succeeded': 'succeeded'
}
def __init__(self, active=None, failed=None, succeeded=None, local_vars_configuration=None): # noqa: E501
def __init__(self, active=None, failed=None, label_selector=None, selector=None, succeeded=None, local_vars_configuration=None): # noqa: E501
"""V1ReplicaStatus - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration.get_default_copy()
@ -52,6 +56,8 @@ class V1ReplicaStatus(object):
self._active = None
self._failed = None
self._label_selector = None
self._selector = None
self._succeeded = None
self.discriminator = None
@ -59,6 +65,10 @@ class V1ReplicaStatus(object):
self.active = active
if failed is not None:
self.failed = failed
if label_selector is not None:
self.label_selector = label_selector
if selector is not None:
self.selector = selector
if succeeded is not None:
self.succeeded = succeeded
@ -108,6 +118,50 @@ class V1ReplicaStatus(object):
self._failed = failed
@property
def label_selector(self):
"""Gets the label_selector of this V1ReplicaStatus. # noqa: E501
:return: The label_selector of this V1ReplicaStatus. # noqa: E501
:rtype: V1LabelSelector
"""
return self._label_selector
@label_selector.setter
def label_selector(self, label_selector):
"""Sets the label_selector of this V1ReplicaStatus.
:param label_selector: The label_selector of this V1ReplicaStatus. # noqa: E501
:type label_selector: V1LabelSelector
"""
self._label_selector = label_selector
@property
def selector(self):
"""Gets the selector of this V1ReplicaStatus. # noqa: E501
A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects. # noqa: E501
:return: The selector of this V1ReplicaStatus. # noqa: E501
:rtype: str
"""
return self._selector
@selector.setter
def selector(self, selector):
"""Sets the selector of this V1ReplicaStatus.
A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects. # noqa: E501
:param selector: The selector of this V1ReplicaStatus. # noqa: E501
:type selector: str
"""
self._selector = selector
@property
def succeeded(self):
"""Gets the succeeded of this V1ReplicaStatus. # noqa: E501

View File

@ -36,17 +36,19 @@ class V1SchedulingPolicy(object):
'min_available': 'int',
'min_resources': 'dict(str, ResourceQuantity)',
'priority_class': 'str',
'queue': 'str'
'queue': 'str',
'schedule_timeout_seconds': 'int'
}
attribute_map = {
'min_available': 'minAvailable',
'min_resources': 'minResources',
'priority_class': 'priorityClass',
'queue': 'queue'
'queue': 'queue',
'schedule_timeout_seconds': 'scheduleTimeoutSeconds'
}
def __init__(self, min_available=None, min_resources=None, priority_class=None, queue=None, local_vars_configuration=None): # noqa: E501
def __init__(self, min_available=None, min_resources=None, priority_class=None, queue=None, schedule_timeout_seconds=None, local_vars_configuration=None): # noqa: E501
"""V1SchedulingPolicy - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration.get_default_copy()
@ -56,6 +58,7 @@ class V1SchedulingPolicy(object):
self._min_resources = None
self._priority_class = None
self._queue = None
self._schedule_timeout_seconds = None
self.discriminator = None
if min_available is not None:
@ -66,6 +69,8 @@ class V1SchedulingPolicy(object):
self.priority_class = priority_class
if queue is not None:
self.queue = queue
if schedule_timeout_seconds is not None:
self.schedule_timeout_seconds = schedule_timeout_seconds
@property
def min_available(self):
@ -151,6 +156,27 @@ class V1SchedulingPolicy(object):
self._queue = queue
@property
def schedule_timeout_seconds(self):
"""Gets the schedule_timeout_seconds of this V1SchedulingPolicy. # noqa: E501
:return: The schedule_timeout_seconds of this V1SchedulingPolicy. # noqa: E501
:rtype: int
"""
return self._schedule_timeout_seconds
@schedule_timeout_seconds.setter
def schedule_timeout_seconds(self, schedule_timeout_seconds):
"""Sets the schedule_timeout_seconds of this V1SchedulingPolicy.
:param schedule_timeout_seconds: The schedule_timeout_seconds of this V1SchedulingPolicy. # noqa: E501
:type schedule_timeout_seconds: int
"""
self._schedule_timeout_seconds = schedule_timeout_seconds
def to_dict(self, serialize=False):
"""Returns the model properties as a dict"""
result = {}

View File

@ -51,6 +51,8 @@ class TestV1JobStatus(unittest.TestCase):
'key' : mpijob.models.v1/replica_status.v1.ReplicaStatus(
active = 56,
failed = 56,
label_selector = None,
selector = '',
succeeded = 56, )
},
start_time = None
@ -70,6 +72,8 @@ class TestV1JobStatus(unittest.TestCase):
'key' : mpijob.models.v1/replica_status.v1.ReplicaStatus(
active = 56,
failed = 56,
label_selector = None,
selector = '',
succeeded = 56, )
},
)

View File

@ -38,6 +38,8 @@ class TestV1ReplicaStatus(unittest.TestCase):
return V1ReplicaStatus(
active = 56,
failed = 56,
label_selector = None,
selector = '',
succeeded = 56
)
else :

View File

@ -45,7 +45,8 @@ class TestV1RunPolicy(unittest.TestCase):
'key' : None
},
priority_class = '',
queue = '', ),
queue = '',
schedule_timeout_seconds = 56, ),
ttl_seconds_after_finished = 56
)
else :

View File

@ -41,7 +41,8 @@ class TestV1SchedulingPolicy(unittest.TestCase):
'key' : None
},
priority_class = '',
queue = ''
queue = '',
schedule_timeout_seconds = 56
)
else :
return V1SchedulingPolicy(

View File

@ -57,7 +57,8 @@ class TestV2beta1MPIJob(unittest.TestCase):
'key' : None
},
priority_class = '',
queue = '', ),
queue = '',
schedule_timeout_seconds = 56, ),
ttl_seconds_after_finished = 56, ),
slots_per_worker = 56,
ssh_auth_mount_path = '', ),
@ -77,6 +78,8 @@ class TestV2beta1MPIJob(unittest.TestCase):
'key' : mpijob.models.v1/replica_status.v1.ReplicaStatus(
active = 56,
failed = 56,
label_selector = None,
selector = '',
succeeded = 56, )
},
start_time = None, )

View File

@ -60,7 +60,8 @@ class TestV2beta1MPIJobList(unittest.TestCase):
'key' : None
},
priority_class = '',
queue = '', ),
queue = '',
schedule_timeout_seconds = 56, ),
ttl_seconds_after_finished = 56, ),
slots_per_worker = 56,
ssh_auth_mount_path = '', ),
@ -80,6 +81,8 @@ class TestV2beta1MPIJobList(unittest.TestCase):
'key' : mpijob.models.v1/replica_status.v1.ReplicaStatus(
active = 56,
failed = 56,
label_selector = None,
selector = '',
succeeded = 56, )
},
start_time = None, ), )
@ -112,7 +115,8 @@ class TestV2beta1MPIJobList(unittest.TestCase):
'key' : None
},
priority_class = '',
queue = '', ),
queue = '',
schedule_timeout_seconds = 56, ),
ttl_seconds_after_finished = 56, ),
slots_per_worker = 56,
ssh_auth_mount_path = '', ),
@ -132,6 +136,8 @@ class TestV2beta1MPIJobList(unittest.TestCase):
'key' : mpijob.models.v1/replica_status.v1.ReplicaStatus(
active = 56,
failed = 56,
label_selector = None,
selector = '',
succeeded = 56, )
},
start_time = None, ), )

View File

@ -53,7 +53,8 @@ class TestV2beta1MPIJobSpec(unittest.TestCase):
'key' : None
},
priority_class = '',
queue = '', ),
queue = '',
schedule_timeout_seconds = 56, ),
ttl_seconds_after_finished = 56, ),
slots_per_worker = 56,
ssh_auth_mount_path = ''
@ -66,18 +67,6 @@ class TestV2beta1MPIJobSpec(unittest.TestCase):
restart_policy = '',
template = None, )
},
run_policy = mpijob.models.v1/run_policy.v1.RunPolicy(
active_deadline_seconds = 56,
backoff_limit = 56,
clean_pod_policy = '',
scheduling_policy = mpijob.models.v1/scheduling_policy.v1.SchedulingPolicy(
min_available = 56,
min_resources = {
'key' : None
},
priority_class = '',
queue = '', ),
ttl_seconds_after_finished = 56, ),
)
def testV2beta1MPIJobSpec(self):

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build e2e
// +build e2e
package e2e
@ -21,7 +22,6 @@ import (
"fmt"
"os"
"os/exec"
"path"
"testing"
"time"
@ -42,11 +42,12 @@ const (
envTestKindImage = "TEST_KIND_IMAGE"
defaultMPIOperatorImage = "mpioperator/mpi-operator:local"
defaultKindImage = "kindest/node:v1.21.2"
defaultKindImage = "kindest/node:v1.25.3"
openMPIImage = "mpioperator/mpi-pi:openmpi"
intelMPIImage = "mpioperator/mpi-pi:intel"
rootPath = "../.."
kubectlPath = rootPath + "/bin/kubectl"
kindPath = rootPath + "/bin/kind"
operatorManifestsPath = rootPath + "/manifests/overlays/dev"
mpiOperator = "mpi-operator"
@ -58,7 +59,6 @@ const (
var (
useExistingCluster bool
useExistingOperator bool
kindPath string
mpiOperatorImage string
kindImage string
@ -71,10 +71,6 @@ func init() {
useExistingOperator = getEnvDefault(envUseExistingOperator, "false") == "true"
mpiOperatorImage = getEnvDefault(envTestMPIOperatorImage, defaultMPIOperatorImage)
kindImage = getEnvDefault(envTestKindImage, defaultKindImage)
kindPath = "kind"
if goPath := os.Getenv("GOPATH"); goPath != "" {
kindPath = path.Join(goPath, "bin", "kind")
}
}
func TestE2E(t *testing.T) {

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build e2e
// +build e2e
package e2e
@ -190,7 +191,7 @@ var _ = ginkgo.Describe("MPIJob", func() {
"-De",
},
ReadinessProbe: &corev1.Probe{
Handler: corev1.Handler{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(2222),
},