Skip to content

Commit

Permalink
Upgrade Go version to v1.20 (#1032)
Browse files Browse the repository at this point in the history
Signed-off-by: Syulin7 <[email protected]>
  • Loading branch information
Syulin7 committed Feb 20, 2024
1 parent f27a678 commit 6fd3d0e
Show file tree
Hide file tree
Showing 59 changed files with 208 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- "1.19.4"
- "1.20.6"

go_import_path: github.com/kubeflow/arena

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.install
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.notebook.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.notebook.kubeflow
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions cmd/uninstall/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kubeflow/arena

go 1.18
go 1.20

require (
github.com/docker/docker v20.10.12+incompatible
Expand Down
2 changes: 1 addition & 1 deletion hack/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions pkg/apis/arenaclient/arenaclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/arenaclient/node_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/config/kubeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/config/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"context"
"fmt"
"io/ioutil"
"os"

authenticationapi "k8s.io/api/authentication/v1"
authorizationv1 "k8s.io/api/authorization/v1"
Expand All @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package utils
import (
"encoding/json"
"fmt"
"io/ioutil"
"math"
"os"
"strings"
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/spf13/cobra"
)

// ArgsBuilder
// ArgsBuilder
type ArgsBuilder interface {
AddSubBuilder(b ...ArgsBuilder) ArgsBuilder
PreBuild() error
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/scale_etjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/scalein_etjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/scaleout_etjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/serving_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/serving_kf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/serving_tensorflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/serving_tensorrt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/submit_etjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/submit_horovodjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/submit_mpijob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/submit_sparkjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/submit_volcanojob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/traffic_router_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/update_serving_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/update_serving_tensorflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/argsbuilder/update_serving_triton.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/training/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/operators/et-operator/api/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6fd3d0e

Please sign in to comment.