From 6fd3d0e0225440a84ba1621027bdbd18c3590141 Mon Sep 17 00:00:00 2001 From: yu lin <735122171@qq.com> Date: Tue, 20 Feb 2024 18:25:40 +0800 Subject: [PATCH] Upgrade Go version to v1.20 (#1032) Signed-off-by: Syulin7 <735122171@qq.com> --- .circleci/config.yml | 2 +- .travis.yml | 2 +- Dockerfile.build | 2 +- Dockerfile.install | 2 +- Dockerfile.notebook.cpu | 2 +- Dockerfile.notebook.kubeflow | 2 +- Makefile | 2 +- cmd/uninstall/uninstall.go | 5 +- go.mod | 2 +- hack/docgen.go | 2 +- pkg/apis/arenaclient/arenaclient.go | 9 ++-- pkg/apis/arenaclient/node_client.go | 2 +- pkg/apis/config/kubeclient.go | 2 +- pkg/apis/config/user.go | 4 +- pkg/apis/utils/utils.go | 3 +- pkg/argsbuilder/builder.go | 2 +- pkg/argsbuilder/scale_etjob.go | 2 +- pkg/argsbuilder/scalein_etjob.go | 2 +- pkg/argsbuilder/scaleout_etjob.go | 2 +- pkg/argsbuilder/serving_custom.go | 2 +- pkg/argsbuilder/serving_kf.go | 2 +- pkg/argsbuilder/serving_tensorflow.go | 2 +- pkg/argsbuilder/serving_tensorrt.go | 2 +- pkg/argsbuilder/submit_etjob.go | 2 +- pkg/argsbuilder/submit_horovodjob.go | 2 +- pkg/argsbuilder/submit_mpijob.go | 2 +- pkg/argsbuilder/submit_sparkjob.go | 2 +- pkg/argsbuilder/submit_volcanojob.go | 2 +- pkg/argsbuilder/traffic_router_builder.go | 2 +- pkg/argsbuilder/update_serving_custom.go | 2 +- pkg/argsbuilder/update_serving_tensorflow.go | 2 +- pkg/argsbuilder/update_serving_triton.go | 2 +- pkg/commands/training/prune.go | 2 +- pkg/operators/et-operator/api/common/types.go | 2 +- .../clientset/versioned/scheme/register.go | 14 +++--- .../clientset/versioned/fake/register.go | 14 +++--- .../clientset/versioned/scheme/register.go | 14 +++--- .../clientset/versioned/scheme/register.go | 14 +++--- .../clientset/versioned/fake/register.go | 14 +++--- .../clientset/versioned/scheme/register.go | 14 +++--- .../v1beta2/defaults_test.go | 2 +- .../clientset/versioned/fake/register.go | 14 +++--- .../clientset/versioned/scheme/register.go | 14 +++--- .../tf-operator/apis/common/v1/types.go | 2 +- .../tf-operator/apis/common/v1beta2/types.go | 2 +- .../clientset/versioned/fake/register.go | 14 +++--- .../clientset/versioned/scheme/register.go | 14 +++--- .../clientset/versioned/scheme/register.go | 14 +++--- pkg/topnode/gpuexclusive.go | 8 ++-- pkg/topnode/gpushare.go | 32 +++++++------ pkg/topnode/gputopology.go | 47 ++++++++++--------- pkg/training/trainer_spark.go | 45 +++++++++--------- pkg/training/trainer_tensorflow.go | 2 +- pkg/util/helm/helm.go | 5 +- pkg/util/helm/helm_advanced.go | 5 +- pkg/util/kubeclient/configmap.go | 6 +-- pkg/util/kubectl/kubectl.go | 9 ++-- pkg/util/volume.go | 4 +- version.go | 6 +-- 59 files changed, 208 insertions(+), 202 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d2082a94..7dd71d69a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ version: 2 jobs: build: docker: - - image: cimg/go:1.19.4 + - image: cimg/go:1.20.6 working_directory: /home/circleci/go/src/github.com/kubeflow/arena steps: - checkout diff --git a/.travis.yml b/.travis.yml index 7e66f4baa..820b87653 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - "1.19.4" + - "1.20.6" go_import_path: github.com/kubeflow/arena diff --git a/Dockerfile.build b/Dockerfile.build index 40f10cc13..9dc69ec70 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -3,7 +3,7 @@ # # Create a go runtime for building arena -ARG GOLANG_VERSION=1.19.4 +ARG GOLANG_VERSION=1.20.6 ARG KUBE_VERSION=v1.23.0 ARG HELM_VERSION=v3.7.2 ARG VERSION=v0.3.0-rc diff --git a/Dockerfile.install b/Dockerfile.install index f801adf62..9c095cef8 100644 --- a/Dockerfile.install +++ b/Dockerfile.install @@ -1,5 +1,5 @@ #FROM golang:1.10-stretch as build -FROM golang:1.19.4 as build +FROM golang:1.20.6 as build RUN mkdir -p /go/src/github.com/kubeflow/arena diff --git a/Dockerfile.notebook.cpu b/Dockerfile.notebook.cpu index cbcd45e12..be62ddccd 100644 --- a/Dockerfile.notebook.cpu +++ b/Dockerfile.notebook.cpu @@ -3,7 +3,7 @@ ARG BASE_IMAGE=tensorflow/tensorflow:1.12.0-devel-py3 ARG USER=root -FROM golang:1.19.4 as build +FROM golang:1.20.6 as build RUN mkdir -p /go/src/github.com/kubeflow/arena diff --git a/Dockerfile.notebook.kubeflow b/Dockerfile.notebook.kubeflow index 7bceb736b..359a48b39 100644 --- a/Dockerfile.notebook.kubeflow +++ b/Dockerfile.notebook.kubeflow @@ -2,7 +2,7 @@ ARG BASE_IMAGE=registry.aliyuncs.com/kubeflow-images-public/tensorflow-1.12.0-no ARG USER=jovyan -FROM golang:1.19.4 as build +FROM golang:1.20.6 as build RUN mkdir -p /go/src/github.com/kubeflow/arena diff --git a/Makefile b/Makefile index 14cca247c..b2c0f4ee5 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,7 @@ ifeq ($(GOLANGCI_LINT),) curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.53.3 $(info golangci-lint has been installed) endif - golangci-lint run --timeout 5m --go 1.18 ./... + golangci-lint run --timeout 5m --go 1.20 ./... test: go test ./... -coverprofile cover.out diff --git a/cmd/uninstall/uninstall.go b/cmd/uninstall/uninstall.go index b6e483c3a..ccda600a6 100644 --- a/cmd/uninstall/uninstall.go +++ b/cmd/uninstall/uninstall.go @@ -4,7 +4,6 @@ import ( "bytes" "flag" "fmt" - "io/ioutil" "os" "os/exec" "path" @@ -82,7 +81,7 @@ func deleteArenaArtifacts(force bool) error { } func parseFields(fileName string) ([]string, error) { - contentBytes, err := ioutil.ReadFile(fileName) + contentBytes, err := os.ReadFile(fileName) if err != nil { return nil, fmt.Errorf("failed to read file %v,reason: %v", fileName, err) } @@ -168,7 +167,7 @@ func detectManifests(manifestDir *string) (string, error) { } func detectCRDs(fileName string) ([]string, error) { - contentBytes, err := ioutil.ReadFile(fileName) + contentBytes, err := os.ReadFile(fileName) if err != nil { return nil, fmt.Errorf("failed to read file %v,reason: %v", fileName, err) } diff --git a/go.mod b/go.mod index d69eb1ee5..7ce8cb14a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubeflow/arena -go 1.18 +go 1.20 require ( github.com/docker/docker v20.10.12+incompatible diff --git a/hack/docgen.go b/hack/docgen.go index 7bf0d5c6e..a9bb0b076 100644 --- a/hack/docgen.go +++ b/hack/docgen.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/apis/arenaclient/arenaclient.go b/pkg/apis/arenaclient/arenaclient.go index cbe138bc2..29bdf9f4a 100644 --- a/pkg/apis/arenaclient/arenaclient.go +++ b/pkg/apis/arenaclient/arenaclient.go @@ -12,10 +12,11 @@ import ( // ArenaClient is a client which includes operations: // 1.manage training jobs,like: -// * submit a training job -// * get a training job information -// * get job logs -// * delete a job +// - submit a training job +// - get a training job information +// - get job logs +// - delete a job +// // TODO: 2.manage serving job // TODO: 3.manage node // it serves for commands and apis diff --git a/pkg/apis/arenaclient/node_client.go b/pkg/apis/arenaclient/node_client.go index 1476fe5a2..421f08846 100644 --- a/pkg/apis/arenaclient/node_client.go +++ b/pkg/apis/arenaclient/node_client.go @@ -39,7 +39,7 @@ func (t *NodeClient) Details(nodeNames []string, nodeType types.NodeType, showMe return topnode.ListNodeDetails(nodeNames, nodeType, showMetric) } -// ListAndPrintNodes is used to display nodes informations +// ListAndPrintNodes is used to display nodes informations func (t *NodeClient) ListAndPrintNodes(nodeNames []string, nodeType types.NodeType, format types.FormatStyle, details bool, notStop bool, showMetric bool) error { if format == types.UnknownFormat { return fmt.Errorf("Unknown output format,only support:[wide|json|yaml]") diff --git a/pkg/apis/config/kubeclient.go b/pkg/apis/config/kubeclient.go index 01e6d8101..90f938822 100644 --- a/pkg/apis/config/kubeclient.go +++ b/pkg/apis/config/kubeclient.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/apis/config/user.go b/pkg/apis/config/user.go index 85f70e1f9..f119a71aa 100644 --- a/pkg/apis/config/user.go +++ b/pkg/apis/config/user.go @@ -3,7 +3,7 @@ package config import ( "context" "fmt" - "io/ioutil" + "os" authenticationapi "k8s.io/api/authentication/v1" authorizationv1 "k8s.io/api/authorization/v1" @@ -29,7 +29,7 @@ func getUserName(namespace string, clientConfig clientcmd.ClientConfig, restConf var token string if tc.HasTokenAuth() { if restConfig.BearerTokenFile != "" { - tokenContent, err := ioutil.ReadFile(restConfig.BearerTokenFile) + tokenContent, err := os.ReadFile(restConfig.BearerTokenFile) if err != nil { return nil, err } diff --git a/pkg/apis/utils/utils.go b/pkg/apis/utils/utils.go index 2a1b1ca72..57e8900ce 100644 --- a/pkg/apis/utils/utils.go +++ b/pkg/apis/utils/utils.go @@ -3,7 +3,6 @@ package utils import ( "encoding/json" "fmt" - "io/ioutil" "math" "os" "strings" @@ -234,7 +233,7 @@ func DataUnitTransfer(from string, to string, value float64) float64 { } func ParseK8sObjectsFromYamlFile(filename string) ([]types.K8sObject, error) { - data, err := ioutil.ReadFile(filename) + data, err := os.ReadFile(filename) if err != nil { return nil, err } diff --git a/pkg/argsbuilder/builder.go b/pkg/argsbuilder/builder.go index 96cec8c71..3408022a2 100644 --- a/pkg/argsbuilder/builder.go +++ b/pkg/argsbuilder/builder.go @@ -4,7 +4,7 @@ import ( "github.com/spf13/cobra" ) -// ArgsBuilder +// ArgsBuilder type ArgsBuilder interface { AddSubBuilder(b ...ArgsBuilder) ArgsBuilder PreBuild() error diff --git a/pkg/argsbuilder/scale_etjob.go b/pkg/argsbuilder/scale_etjob.go index da7cbd6ce..da7d5b869 100644 --- a/pkg/argsbuilder/scale_etjob.go +++ b/pkg/argsbuilder/scale_etjob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/scalein_etjob.go b/pkg/argsbuilder/scalein_etjob.go index a88799f2e..2db7fcb67 100644 --- a/pkg/argsbuilder/scalein_etjob.go +++ b/pkg/argsbuilder/scalein_etjob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/scaleout_etjob.go b/pkg/argsbuilder/scaleout_etjob.go index 65ac87944..0a8d23ce6 100644 --- a/pkg/argsbuilder/scaleout_etjob.go +++ b/pkg/argsbuilder/scaleout_etjob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/serving_custom.go b/pkg/argsbuilder/serving_custom.go index e5851cf4e..f2022ed33 100644 --- a/pkg/argsbuilder/serving_custom.go +++ b/pkg/argsbuilder/serving_custom.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/serving_kf.go b/pkg/argsbuilder/serving_kf.go index 5ce86a8d3..e51b588e0 100644 --- a/pkg/argsbuilder/serving_kf.go +++ b/pkg/argsbuilder/serving_kf.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/serving_tensorflow.go b/pkg/argsbuilder/serving_tensorflow.go index a8a9331e3..e95e1d73b 100644 --- a/pkg/argsbuilder/serving_tensorflow.go +++ b/pkg/argsbuilder/serving_tensorflow.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/serving_tensorrt.go b/pkg/argsbuilder/serving_tensorrt.go index b24fb79a7..73704b19f 100644 --- a/pkg/argsbuilder/serving_tensorrt.go +++ b/pkg/argsbuilder/serving_tensorrt.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/submit_etjob.go b/pkg/argsbuilder/submit_etjob.go index 57010e9cf..0d1edd498 100644 --- a/pkg/argsbuilder/submit_etjob.go +++ b/pkg/argsbuilder/submit_etjob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/submit_horovodjob.go b/pkg/argsbuilder/submit_horovodjob.go index b763d1399..9ef2bb43a 100644 --- a/pkg/argsbuilder/submit_horovodjob.go +++ b/pkg/argsbuilder/submit_horovodjob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/submit_mpijob.go b/pkg/argsbuilder/submit_mpijob.go index f8f4ec571..2f9f4c5cc 100644 --- a/pkg/argsbuilder/submit_mpijob.go +++ b/pkg/argsbuilder/submit_mpijob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/submit_sparkjob.go b/pkg/argsbuilder/submit_sparkjob.go index 6fe67bad1..df6a87fcc 100644 --- a/pkg/argsbuilder/submit_sparkjob.go +++ b/pkg/argsbuilder/submit_sparkjob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/submit_volcanojob.go b/pkg/argsbuilder/submit_volcanojob.go index baf6f84df..bc1dda9b1 100644 --- a/pkg/argsbuilder/submit_volcanojob.go +++ b/pkg/argsbuilder/submit_volcanojob.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/traffic_router_builder.go b/pkg/argsbuilder/traffic_router_builder.go index 919a2f65c..8070f2d91 100644 --- a/pkg/argsbuilder/traffic_router_builder.go +++ b/pkg/argsbuilder/traffic_router_builder.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/update_serving_custom.go b/pkg/argsbuilder/update_serving_custom.go index 8404cc0b8..d64ba5141 100644 --- a/pkg/argsbuilder/update_serving_custom.go +++ b/pkg/argsbuilder/update_serving_custom.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/update_serving_tensorflow.go b/pkg/argsbuilder/update_serving_tensorflow.go index a209422cc..165fe3d05 100644 --- a/pkg/argsbuilder/update_serving_tensorflow.go +++ b/pkg/argsbuilder/update_serving_tensorflow.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/argsbuilder/update_serving_triton.go b/pkg/argsbuilder/update_serving_triton.go index 0b6e107a4..f46549d5b 100644 --- a/pkg/argsbuilder/update_serving_triton.go +++ b/pkg/argsbuilder/update_serving_triton.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/commands/training/prune.go b/pkg/commands/training/prune.go index b97475128..2883c3557 100644 --- a/pkg/commands/training/prune.go +++ b/pkg/commands/training/prune.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/operators/et-operator/api/common/types.go b/pkg/operators/et-operator/api/common/types.go index 3cc3f1d83..e6459ca42 100644 --- a/pkg/operators/et-operator/api/common/types.go +++ b/pkg/operators/et-operator/api/common/types.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/operators/et-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/et-operator/client/clientset/versioned/scheme/register.go index 572d7c5b6..a0d669b8d 100644 --- a/pkg/operators/et-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/et-operator/client/clientset/versioned/scheme/register.go @@ -35,14 +35,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/kubedl-operator/client/clientset/versioned/fake/register.go b/pkg/operators/kubedl-operator/client/clientset/versioned/fake/register.go index 4deca18df..0c76920fa 100644 --- a/pkg/operators/kubedl-operator/client/clientset/versioned/fake/register.go +++ b/pkg/operators/kubedl-operator/client/clientset/versioned/fake/register.go @@ -36,14 +36,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/kubedl-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/kubedl-operator/client/clientset/versioned/scheme/register.go index 09ace5d7f..651566be2 100644 --- a/pkg/operators/kubedl-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/kubedl-operator/client/clientset/versioned/scheme/register.go @@ -36,14 +36,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/mpi-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/mpi-operator/client/clientset/versioned/scheme/register.go index 9f491f159..cd1788961 100644 --- a/pkg/operators/mpi-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/mpi-operator/client/clientset/versioned/scheme/register.go @@ -36,14 +36,14 @@ func init() { // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/pytorch-operator/client/clientset/versioned/fake/register.go b/pkg/operators/pytorch-operator/client/clientset/versioned/fake/register.go index c55c99b39..fe288ad36 100644 --- a/pkg/operators/pytorch-operator/client/clientset/versioned/fake/register.go +++ b/pkg/operators/pytorch-operator/client/clientset/versioned/fake/register.go @@ -35,14 +35,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/pytorch-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/pytorch-operator/client/clientset/versioned/scheme/register.go index e1687948c..a29bce234 100644 --- a/pkg/operators/pytorch-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/pytorch-operator/client/clientset/versioned/scheme/register.go @@ -35,14 +35,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/spark-operator/apis/sparkoperator.k8s.io/v1beta2/defaults_test.go b/pkg/operators/spark-operator/apis/sparkoperator.k8s.io/v1beta2/defaults_test.go index fa38aaa51..318dd1044 100644 --- a/pkg/operators/spark-operator/apis/sparkoperator.k8s.io/v1beta2/defaults_test.go +++ b/pkg/operators/spark-operator/apis/sparkoperator.k8s.io/v1beta2/defaults_test.go @@ -5,7 +5,7 @@ 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 - https://www.apache.org/licenses/LICENSE-2.0 + https://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, diff --git a/pkg/operators/spark-operator/client/clientset/versioned/fake/register.go b/pkg/operators/spark-operator/client/clientset/versioned/fake/register.go index ea7c28fc4..a99d30f4a 100644 --- a/pkg/operators/spark-operator/client/clientset/versioned/fake/register.go +++ b/pkg/operators/spark-operator/client/clientset/versioned/fake/register.go @@ -41,14 +41,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/spark-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/spark-operator/client/clientset/versioned/scheme/register.go index a0d4badf1..63f27af8b 100644 --- a/pkg/operators/spark-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/spark-operator/client/clientset/versioned/scheme/register.go @@ -41,14 +41,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/tf-operator/apis/common/v1/types.go b/pkg/operators/tf-operator/apis/common/v1/types.go index bfe2bfd65..3ceb69f02 100644 --- a/pkg/operators/tf-operator/apis/common/v1/types.go +++ b/pkg/operators/tf-operator/apis/common/v1/types.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/operators/tf-operator/apis/common/v1beta2/types.go b/pkg/operators/tf-operator/apis/common/v1beta2/types.go index 760bf71f2..66ab6eccb 100644 --- a/pkg/operators/tf-operator/apis/common/v1beta2/types.go +++ b/pkg/operators/tf-operator/apis/common/v1beta2/types.go @@ -4,7 +4,7 @@ // 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, diff --git a/pkg/operators/tf-operator/client/clientset/versioned/fake/register.go b/pkg/operators/tf-operator/client/clientset/versioned/fake/register.go index 576561e28..47628f4e8 100644 --- a/pkg/operators/tf-operator/client/clientset/versioned/fake/register.go +++ b/pkg/operators/tf-operator/client/clientset/versioned/fake/register.go @@ -37,14 +37,14 @@ func init() { // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/tf-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/tf-operator/client/clientset/versioned/scheme/register.go index 3d1ddb504..fd30e7f8b 100644 --- a/pkg/operators/tf-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/tf-operator/client/clientset/versioned/scheme/register.go @@ -37,14 +37,14 @@ func init() { // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/operators/volcano-operator/client/clientset/versioned/scheme/register.go b/pkg/operators/volcano-operator/client/clientset/versioned/scheme/register.go index cedf28ca9..dcd78d0a7 100644 --- a/pkg/operators/volcano-operator/client/clientset/versioned/scheme/register.go +++ b/pkg/operators/volcano-operator/client/clientset/versioned/scheme/register.go @@ -38,14 +38,14 @@ func init() { // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/topnode/gpuexclusive.go b/pkg/topnode/gpuexclusive.go index 5822c0468..37dd3a315 100644 --- a/pkg/topnode/gpuexclusive.go +++ b/pkg/topnode/gpuexclusive.go @@ -332,9 +332,11 @@ UsedGPUs: 1/1(100.0%) UnhealthyGPUs: 0/1 Instances: - NAMESPACE NAME GPU(Requested) - --------- ---- -------------- - default tf-standalone-test-1-chief-0 1 + + NAMESPACE NAME GPU(Requested) + --------- ---- -------------- + default tf-standalone-test-1-chief-0 1 + ----------------------------------------------------------------------------------------- Allocated/Total GPUs In Cluster: 1/1(100.0%) diff --git a/pkg/topnode/gpushare.go b/pkg/topnode/gpushare.go index cdec162ca..da4dc1fce 100644 --- a/pkg/topnode/gpushare.go +++ b/pkg/topnode/gpushare.go @@ -504,23 +504,25 @@ Type: GPUShare Address: 192.168.7.183 Instances: - NAMESPACE NAME GPU_MEM(Requested) GPU_MEM(Allocated) - --------- ---- ------------------ ------------------ - default binpack-0 3 GPU3->3 - default fast-style-transfer-alpha-custom-serving-754c5ff685-vzjmt 5 GPU3->5 - default multi-gpushare-f4rgv 8 GPU0->2,GPU1->2,GPU2->2,GPU3->2 - default multi-gpushare-qcsqq 8 GPU0->2,GPU1->2,GPU2->2,GPU3->2 - default multi-gpushare-vz6xc 8 GPU0->2,GPU1->2,GPU2->2,GPU3->2 + + NAMESPACE NAME GPU_MEM(Requested) GPU_MEM(Allocated) + --------- ---- ------------------ ------------------ + default binpack-0 3 GPU3->3 + default fast-style-transfer-alpha-custom-serving-754c5ff685-vzjmt 5 GPU3->5 + default multi-gpushare-f4rgv 8 GPU0->2,GPU1->2,GPU2->2,GPU3->2 + default multi-gpushare-qcsqq 8 GPU0->2,GPU1->2,GPU2->2,GPU3->2 + default multi-gpushare-vz6xc 8 GPU0->2,GPU1->2,GPU2->2,GPU3->2 GPUs: - INDEX MEMORY(Used/Total) PERCENT - ----- ------------------ ------- - GPU0 6/15(GiB) 40.0% - GPU1 6/15(GiB) 40.0% - GPU2 6/15(GiB) 40.0% - GPU3 14/15(GiB) 93.3% - - Total(Memory/GiB): 60,Allocated(Memory/GiB): 32/60(53.3%),Unhealthy(Memory/GiB): 0/60 + + INDEX MEMORY(Used/Total) PERCENT + ----- ------------------ ------- + GPU0 6/15(GiB) 40.0% + GPU1 6/15(GiB) 40.0% + GPU2 6/15(GiB) 40.0% + GPU3 14/15(GiB) 93.3% + + Total(Memory/GiB): 60,Allocated(Memory/GiB): 32/60(53.3%),Unhealthy(Memory/GiB): 0/60 ----------------------------------------------------------------------------------------- Allocated/Total GPU Memory In Cluster: 32/60(53.3%) diff --git a/pkg/topnode/gputopology.go b/pkg/topnode/gputopology.go index 9f4a4d34b..c43c95064 100644 --- a/pkg/topnode/gputopology.go +++ b/pkg/topnode/gputopology.go @@ -396,34 +396,39 @@ UsedGPUs: 0 UnhealthyGPUs: 0 Instances: - NAMESPACE NAME GPU(Requested) GPU(Allocated) - --------- ---- -------------- -------------- - default nginx-deployment-6687789574-6mn2z 2 - default nginx-deployment-6687789574-wd7vf 2 + + NAMESPACE NAME GPU(Requested) GPU(Allocated) + --------- ---- -------------- -------------- + default nginx-deployment-6687789574-6mn2z 2 + default nginx-deployment-6687789574-wd7vf 2 GPUs: - INDEX STATUS HEALTHY - ---- ------ ------- - GPU0 idle true - GPU1 idle true - GPU2 idle true - GPU3 idle true - Total: 4,Allocated: 0/4,Unhealthy: 0/4 + INDEX STATUS HEALTHY + ---- ------ ------- + GPU0 idle true + GPU1 idle true + GPU2 idle true + GPU3 idle true + + Total: 4,Allocated: 0/4,Unhealthy: 0/4 LinkTypeMatrix: - GPU0 GPU1 GPU2 GPU3 - GPU0 N-A NV2 NV1 NV2 - GPU1 NV2 N-A NV2 NV1 - GPU2 NV1 NV2 N-A NV1 - GPU3 NV2 NV1 NV1 N-A + + GPU0 GPU1 GPU2 GPU3 + GPU0 N-A NV2 NV1 NV2 + GPU1 NV2 N-A NV2 NV1 + GPU2 NV1 NV2 N-A NV1 + GPU3 NV2 NV1 NV1 N-A BandwidthMatrix: - GPU0 GPU1 GPU2 GPU3 - GPU0 738.42 96.44 48.37 96.19 - GPU1 96.26 744.05 96.23 48.36 - GPU2 48.37 96.24 744.76 48.37 - GPU3 96.23 48.37 48.37 744.76 + + GPU0 GPU1 GPU2 GPU3 + GPU0 738.42 96.44 48.37 96.19 + GPU1 96.26 744.05 96.23 48.36 + GPU2 48.37 96.24 744.76 48.37 + GPU3 96.23 48.37 48.37 744.76 + ----------------------------------------------------------------------------------------- Allocated/Total GPUs In Cluster: 4/4(100.0%) diff --git a/pkg/training/trainer_spark.go b/pkg/training/trainer_spark.go index ab28b15a9..3b569c9be 100644 --- a/pkg/training/trainer_spark.go +++ b/pkg/training/trainer_spark.go @@ -54,28 +54,29 @@ func (sj *SparkJob) GetTrainJob() interface{} { } /* - spark job driver state - ------------------------------------------------------- - NewState ApplicationStateType = "" - SubmittedState ApplicationStateType = "SUBMITTED" - RunningState ApplicationStateType = "RUNNING" - CompletedState ApplicationStateType = "COMPLETED" - FailedState ApplicationStateType = "FAILED" - FailedSubmissionState ApplicationStateType = "SUBMISSION_FAILED" - PendingRerunState ApplicationStateType = "PENDING_RERUN" - InvalidatingState ApplicationStateType = "INVALIDATING" - SucceedingState ApplicationStateType = "SUCCEEDING" - FailingState ApplicationStateType = "FAILING" - UnknownState ApplicationStateType = "UNKNOWN" - - - spark job executor state - ------------------------------------------------------- - ExecutorPendingState ExecutorState = "PENDING" - ExecutorRunningState ExecutorState = "RUNNING" - ExecutorCompletedState ExecutorState = "COMPLETED" - ExecutorFailedState ExecutorState = "FAILED" - ExecutorUnknownState ExecutorState = "UNKNOWN" + spark job driver state + +------------------------------------------------------- +NewState ApplicationStateType = "" +SubmittedState ApplicationStateType = "SUBMITTED" +RunningState ApplicationStateType = "RUNNING" +CompletedState ApplicationStateType = "COMPLETED" +FailedState ApplicationStateType = "FAILED" +FailedSubmissionState ApplicationStateType = "SUBMISSION_FAILED" +PendingRerunState ApplicationStateType = "PENDING_RERUN" +InvalidatingState ApplicationStateType = "INVALIDATING" +SucceedingState ApplicationStateType = "SUCCEEDING" +FailingState ApplicationStateType = "FAILING" +UnknownState ApplicationStateType = "UNKNOWN" + + spark job executor state + +------------------------------------------------------- +ExecutorPendingState ExecutorState = "PENDING" +ExecutorRunningState ExecutorState = "RUNNING" +ExecutorCompletedState ExecutorState = "COMPLETED" +ExecutorFailedState ExecutorState = "FAILED" +ExecutorUnknownState ExecutorState = "UNKNOWN" */ func (sj *SparkJob) GetStatus() (status string) { diff --git a/pkg/training/trainer_tensorflow.go b/pkg/training/trainer_tensorflow.go index 5418b180e..ddb9d9be9 100644 --- a/pkg/training/trainer_tensorflow.go +++ b/pkg/training/trainer_tensorflow.go @@ -127,7 +127,7 @@ func (tj *TensorFlowJob) Age() time.Duration { return metav1.Now().Sub(job.Status.StartTime.Time) } -// Duration returns the duration of tfjob +// Duration returns the duration of tfjob func (tj *TensorFlowJob) Duration() time.Duration { job := tj.tfjob if job.Status.StartTime == nil || job.Status.StartTime.IsZero() { diff --git a/pkg/util/helm/helm.go b/pkg/util/helm/helm.go index e108b991d..57a6e3dcc 100644 --- a/pkg/util/helm/helm.go +++ b/pkg/util/helm/helm.go @@ -16,7 +16,6 @@ package helm import ( "fmt" - "io/ioutil" "os" "os/exec" "strings" @@ -38,7 +37,7 @@ func InstallRelease(name string, namespace string, values interface{}, chartName } // 1. generate the template file - valueFile, err := ioutil.TempFile(os.TempDir(), "values") + valueFile, err := os.CreateTemp(os.TempDir(), "values") if err != nil { log.Errorf("Failed to create tmp file %v due to %v", valueFile.Name(), err) return err @@ -53,7 +52,7 @@ func InstallRelease(name string, namespace string, values interface{}, chartName return err } - // 3. check if the chart file exists, if it's it's unix path, then check if it's exist + // 3. check if the chart file exists, if it's unix path, then check if it's exist if strings.HasPrefix(chartName, "/") { if _, err = os.Stat(chartName); os.IsNotExist(err) { // TODO: the chart will be put inside the binary in future diff --git a/pkg/util/helm/helm_advanced.go b/pkg/util/helm/helm_advanced.go index 8fc612d94..231862fa7 100644 --- a/pkg/util/helm/helm_advanced.go +++ b/pkg/util/helm/helm_advanced.go @@ -16,7 +16,6 @@ package helm import ( "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -30,7 +29,7 @@ import ( */ func GenerateValueFile(values interface{}) (valueFileName string, err error) { // 1. generate the template file - valueFile, err := ioutil.TempFile(os.TempDir(), "values") + valueFile, err := os.CreateTemp(os.TempDir(), "values") if err != nil { log.Errorf("Failed to create tmp file %v due to %v", valueFile.Name(), err) return "", err @@ -51,7 +50,7 @@ func GenerateValueFile(values interface{}) (valueFileName string, err error) { */ func GenerateHelmTemplate(name string, namespace string, valueFileName string, chartName string, options ...string) (templateFileName string, err error) { tempName := fmt.Sprintf("%s.yaml", name) - templateFile, err := ioutil.TempFile("", tempName) + templateFile, err := os.CreateTemp("", tempName) if err != nil { return templateFileName, err } diff --git a/pkg/util/kubeclient/configmap.go b/pkg/util/kubeclient/configmap.go index 5e4b3ae79..b7969cd29 100644 --- a/pkg/util/kubeclient/configmap.go +++ b/pkg/util/kubeclient/configmap.go @@ -4,7 +4,7 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "os" "github.com/kubeflow/arena/pkg/apis/config" "github.com/kubeflow/arena/pkg/apis/types" @@ -81,12 +81,12 @@ func CreateAppConfigmap(name, trainingType, namespace, configFileName, appInfoFi data := map[string]string{ chartName: chartVersion, } - content, err := ioutil.ReadFile(configFileName) + content, err := os.ReadFile(configFileName) if err != nil { return err } data["values"] = string(content) - content, err = ioutil.ReadFile(appInfoFileName) + content, err = os.ReadFile(appInfoFileName) if err != nil { return err } diff --git a/pkg/util/kubectl/kubectl.go b/pkg/util/kubectl/kubectl.go index 6acb029ca..f51ebd2dc 100644 --- a/pkg/util/kubectl/kubectl.go +++ b/pkg/util/kubectl/kubectl.go @@ -18,7 +18,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "os" "os/exec" "strings" @@ -59,7 +58,7 @@ func SaveAppInfo(fileName, namespace string) (configFileName string, err error) } // 1. generate the config file - configFile, err := ioutil.TempFile("", "config") + configFile, err := os.CreateTemp("", "config") if err != nil { log.Errorf("Failed to create tmp file %v due to %v", configFile.Name(), err) return "", err @@ -123,7 +122,7 @@ func UninstallAppsWithAppInfoFile(appInfoFile, namespace string) error { return err } - data, err := ioutil.ReadFile(appInfoFile) + data, err := os.ReadFile(appInfoFile) if err != nil { return err } @@ -276,7 +275,7 @@ func SaveAppConfigMapToFile(name, key, namespace string) (fileName string, err e return "", err } - file, err := ioutil.TempFile(os.TempDir(), name) + file, err := os.CreateTemp(os.TempDir(), name) if err != nil { log.Errorf("Failed to create tmp file %v due to %v", file.Name(), err) return fileName, err @@ -374,7 +373,7 @@ func UpdateInferenceService(inferenceService *kservev1beta1.InferenceService) er // PatchOwnerReferenceWithAppInfoFile patch tfjob / pytorchjob ownerReference func PatchOwnerReferenceWithAppInfoFile(name, trainingType, appInfoFile, namespace string) error { - data, err := ioutil.ReadFile(appInfoFile) + data, err := os.ReadFile(appInfoFile) if err != nil { return err } diff --git a/pkg/util/volume.go b/pkg/util/volume.go index 759cd9fb6..78739a774 100644 --- a/pkg/util/volume.go +++ b/pkg/util/volume.go @@ -75,8 +75,8 @@ func validateAbsolute(p string) error { // ValidateMountDestination validates the destination. // Currently, we have only two obvious rule for validation: -// - path must not be "/" -// - path must be absolute +// - path must not be "/" +// - path must be absolute func validateMountDestination(dest string) error { if err := validateNotRoot(dest); err != nil { return err diff --git a/version.go b/version.go index 009f5257f..8ae0eeb91 100644 --- a/version.go +++ b/version.go @@ -4,7 +4,7 @@ // 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,7 +15,7 @@ package arena import ( "fmt" - "io/ioutil" + "os" "runtime" "github.com/kubeflow/arena/pkg/util" @@ -90,7 +90,7 @@ func GetVersion() Version { func getChartsInfo() ChartsInfo { chartsFolder := util.GetChartsFolder() charts := []string{} - chartFolder, err := ioutil.ReadDir(chartsFolder) + chartFolder, err := os.ReadDir(chartsFolder) if err != nil { fmt.Println(err) } else {