Skip to content

Commit

Permalink
worker: Rename (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaocegege authored and k8s-ci-robot committed Apr 26, 2018
1 parent 71a2bd3 commit db8e026
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 54 deletions.
10 changes: 5 additions & 5 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
kdb "github.com/kubeflow/katib/pkg/db"
"github.com/kubeflow/katib/pkg/manager/modelstore"
tbif "github.com/kubeflow/katib/pkg/manager/visualise/tensorboard"
"github.com/kubeflow/katib/pkg/manager/worker_interface"
dlkwif "github.com/kubeflow/katib/pkg/manager/worker_interface/dlk"
k8swif "github.com/kubeflow/katib/pkg/manager/worker_interface/kubernetes"
nvdwif "github.com/kubeflow/katib/pkg/manager/worker_interface/nvdocker"
"github.com/kubeflow/katib/pkg/manager/worker"
dlkwif "github.com/kubeflow/katib/pkg/manager/worker/dlk"
k8swif "github.com/kubeflow/katib/pkg/manager/worker/kubernetes"
nvdwif "github.com/kubeflow/katib/pkg/manager/worker/nvdocker"

"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
Expand All @@ -42,7 +42,7 @@ type studyCh struct {
addMetricsCh chan string
}
type server struct {
wIF worker_interface.WorkerInterface
wIF worker.Interface
msIf modelstore.ModelStore
StudyChList map[string]studyCh
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/manager/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestCreateStudy(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockDB := mockdb.NewMockVizierDBInterface(ctrl)
mockWif := mockworker.NewMockWorkerInterface(ctrl)
mockWif := mockworker.NewMockInterface(ctrl)
mockModelStore := mockmodelstore.NewMockModelStore(ctrl)
sid := "teststudy"
sc := &api.StudyConfig{
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestGetStudies(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockDB := mockdb.NewMockVizierDBInterface(ctrl)
mockWif := mockworker.NewMockWorkerInterface(ctrl)
mockWif := mockworker.NewMockInterface(ctrl)
mockModelStore := mockmodelstore.NewMockModelStore(ctrl)
sid := []string{"teststudy1", "teststudy2"}
s := &server{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/kubeflow/katib/pkg/db"
dlkapi "github.com/kubeflow/katib/dlk/dlkmanager/api"
"github.com/kubeflow/katib/dlk/dlkmanager/datastore"
wIF "github.com/kubeflow/katib/pkg/manager/worker_interface"
wIF "github.com/kubeflow/katib/pkg/manager/worker"
"io/ioutil"
"log"
"net/http"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package worker_interface
package worker

import (
"errors"
"fmt"
"time"

"github.com/kubeflow/katib/pkg/api"
"github.com/kubeflow/katib/pkg/db"
"time"
)

type WorkerInterface interface {
type Interface interface {
IsTrialComplete(studyId string, tID string) (bool, error)
GetTrialObjValue(studyId string, tID string, objname string) (string, error)
GetTrialEvLogs(studyId string, tID string, metrics []string, sinceTime string) ([]*api.EvaluationLog, error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/kubeflow/katib/pkg/api"
"github.com/kubeflow/katib/pkg/db"
"github.com/kubeflow/katib/pkg/earlystopping"
wIF "github.com/kubeflow/katib/pkg/manager/worker_interface"
wIF "github.com/kubeflow/katib/pkg/manager/worker"
)

type KubernetesWorkerInterface struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
dclient "github.com/docker/docker/client"
"github.com/kubeflow/katib/pkg/api"
"github.com/kubeflow/katib/pkg/db"
wIF "github.com/kubeflow/katib/pkg/manager/worker_interface"
wIF "github.com/kubeflow/katib/pkg/manager/worker"
"io"
"io/ioutil"
"log"
Expand Down
78 changes: 39 additions & 39 deletions pkg/mock/worker/worker.go

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

4 changes: 2 additions & 2 deletions scripts/mockgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ echo "Generating SuggestionClient..."
mockgen -package mock -destination pkg/mock/api/suggestion.go github.com/kubeflow/katib/pkg/api SuggestionClient
echo "Generating VizierDBInterface..."
mockgen -package mock -destination pkg/mock/db/db.go github.com/kubeflow/katib/pkg/db VizierDBInterface
echo "Generating WorkerInterface..."
mockgen -package mock -destination pkg/mock/worker/worker.go github.com/kubeflow/katib/pkg/manager/worker_interface WorkerInterface
echo "Generating worker interface..."
mockgen -package mock -destination pkg/mock/worker/worker.go github.com/kubeflow/katib/pkg/manager/worker Interface
echo "Generating ModelStore..."
mockgen -package mock -destination pkg/mock/modelstore/modelstore.go github.com/kubeflow/katib/pkg/manager/modelstore ModelStore
cd - > /dev/null

0 comments on commit db8e026

Please sign in to comment.