Skip to content

Commit

Permalink
chore: go fmt (#1028)
Browse files Browse the repository at this point in the history
Signed-off-by: Syulin7 <[email protected]>
  • Loading branch information
Syulin7 committed Jan 17, 2024
1 parent ff24a10 commit 10e1e62
Show file tree
Hide file tree
Showing 35 changed files with 56 additions and 29 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ build-pkg:
docker cp arena-pkg:/arena-installer-${VERSION}-${GIT_SHORT_COMMIT}-${OS_ARCH}.tar.gz .
docker rm -f arena-pkg

fmt: ## Run go fmt against code.
go fmt ./...

vet: ## Run go vet against code.
go vet ./...

build-dependabot:
python3 hack/create_dependabot.py
5 changes: 3 additions & 2 deletions cmd/arena/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"runtime/trace"
"strconv"

"github.com/kubeflow/arena/pkg/commands"
"github.com/kubeflow/arena/pkg/apis/utils"
log "github.com/sirupsen/logrus"

"github.com/kubeflow/arena/pkg/apis/utils"
"github.com/kubeflow/arena/pkg/commands"
)

func main() {
Expand Down
7 changes: 4 additions & 3 deletions pkg/apis/arenaclient/evaluate_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package arenaclient

import (
"fmt"

"github.com/google/uuid"
log "github.com/sirupsen/logrus"

"github.com/kubeflow/arena/pkg/apis/config"
apievaluate "github.com/kubeflow/arena/pkg/apis/evaluate"
"github.com/kubeflow/arena/pkg/apis/types"
"github.com/kubeflow/arena/pkg/apis/utils"
"github.com/kubeflow/arena/pkg/evaluate"
log "github.com/sirupsen/logrus"
"github.com/google/uuid"
)

type EvaluateClient struct {
Expand Down Expand Up @@ -107,4 +109,3 @@ func (c *EvaluateClient) Delete(names ...string) error {

return nil
}

10 changes: 5 additions & 5 deletions pkg/apis/evaluate/evaluatejob.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluate

type baseJob struct {
name string
args interface{}
name string
args interface{}
}

type EvaluateJob struct {
Expand All @@ -11,8 +11,8 @@ type EvaluateJob struct {

func newBaseJob(name string, args interface{}) baseJob {
return baseJob{
name: name,
args: args,
name: name,
args: args,
}
}

Expand All @@ -28,4 +28,4 @@ func NewEvaluateJob(name string, args interface{}) *EvaluateJob {
return &EvaluateJob{
baseJob: newBaseJob(name, args),
}
}
}
14 changes: 7 additions & 7 deletions pkg/argsbuilder/cron_tfjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
)

type CronTFJobArgsBuilder struct {
args *types.CronTFJobArgs
argValues map[string]interface{}
subBuilders map[string]ArgsBuilder
args *types.CronTFJobArgs
argValues map[string]interface{}
subBuilders map[string]ArgsBuilder
}

func NewCronTFJobArgsBuilder(args *types.CronTFJobArgs) ArgsBuilder {
args.TrainingType = types.TFTrainingJob
c := &CronTFJobArgsBuilder{
args: args,
argValues: map[string]interface{}{},
subBuilders: map[string]ArgsBuilder{},
args: args,
argValues: map[string]interface{}{},
subBuilders: map[string]ArgsBuilder{},
}
c.AddSubBuilder(
NewSubmitTFJobArgsBuilder(&c.args.SubmitTFJobArgs),
Expand Down Expand Up @@ -87,4 +87,4 @@ func (c *CronTFJobArgsBuilder) check() error {
return fmt.Errorf("--schedule must be set ")
}
return nil
}
}
4 changes: 2 additions & 2 deletions pkg/commands/evaluate/evaluate_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
func NewEvaluateModelCommand() *cobra.Command {
builder := evaluate.NewEvaluateJobBuilder()
var command = &cobra.Command{
Use: "model",
Short: "Submit a model evaluate job.",
Use: "model",
Short: "Submit a model evaluate job.",
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags())
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/evaluate/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ func NewEvaluateGetCommand() *cobra.Command {
}
command.Flags().StringVarP(&format, "output", "o", "wide", "Output format. One of: json|yaml|wide")
return command
}
}
2 changes: 1 addition & 1 deletion pkg/commands/evaluate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ func NewEvaluateListCommand() *cobra.Command {
command.Flags().BoolVarP(&allNamespaces, "all-namespaces", "A", false, "show all the namespaces")
command.Flags().StringVarP(&format, "output", "o", "wide", "Output format. One of: json|yaml|wide")
return command
}
}
5 changes: 3 additions & 2 deletions pkg/evaluate/delete.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package evaluate

import (
log "github.com/sirupsen/logrus"

"github.com/kubeflow/arena/pkg/apis/types"
"github.com/kubeflow/arena/pkg/workflow"
log "github.com/sirupsen/logrus"
)

func DeleteEvaluateJob(name, namespace string) error {
log.Infof("delete evaluate job, %s-%s", name, namespace)
return workflow.DeleteJob(name, namespace, string(types.EvaluateJob))
}
}
2 changes: 1 addition & 1 deletion pkg/evaluate/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ func SubmitEvaluateJob(namespace string, submitArgs *types.EvaluateJobArgs) (err
log.Infof("You can run `arena evaluate get %s` to check the evaluate job status", submitArgs.Name)

return nil
}
}

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

2 changes: 1 addition & 1 deletion pkg/training/trainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ func CompatibleJobCRD(crdName, fieldToCheck string) bool {
}

return compatible
}
}
2 changes: 1 addition & 1 deletion pkg/training/trainer_pytorch.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (tt *PyTorchJobTrainer) isChiefPod(pytorchjob *pytorchv1.PyTorchJob, item *
if val, ok := item.Labels[TrainingReplicaTypeLabel]; ok && val == "master" {
isChiefPod = true
}

return isChiefPod
}

Expand Down

0 comments on commit 10e1e62

Please sign in to comment.