Skip to content

Commit 8c44fd7

Browse files
yehudit1987Yehudit Kerido
andauthored
refactor: move common component into each controller (#702)
- Delete common component (OWNERS, go.mod, reconcilehelper/) - Copy reconcilehelper/util.go to both notebook-controller and tensorboard-controller - Update imports in both controllers to use local reconcilehelper - Remove common dependency from go.mod files - Update Dockerfiles to remove common component references Signed-off-by: Yehudit Kerido <ykerido@ykerido-thinkpadp1gen7.raanaii.csb> Co-authored-by: Yehudit Kerido <ykerido@ykerido-thinkpadp1gen7.raanaii.csb>
1 parent ed23dc5 commit 8c44fd7

File tree

13 files changed

+221
-21
lines changed

13 files changed

+221
-21
lines changed

components/common/OWNERS

Lines changed: 0 additions & 3 deletions
This file was deleted.

components/common/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

components/notebook-controller/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
#
55
# ${PATH_TO_KUBEFLOW/KUBEFLOW repo}/components
66
#
7-
# This is necessary because the Jupyter controller now depends on
8-
# components/common
97
ARG GOLANG_VERSION=1.17
108
FROM golang:${GOLANG_VERSION} as builder
119

1210
WORKDIR /workspace
1311

1412
# Copy the Go Modules manifests
1513
COPY notebook-controller /workspace/notebook-controller
16-
COPY common /workspace/common
1714

1815
# cache deps before building and copying source so that we don't need to re-download as much
1916
# and so that source changes don't invalidate our downloaded layer

components/notebook-controller/controllers/notebook_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"time"
2626

2727
"github.com/go-logr/logr"
28-
reconcilehelper "github.com/kubeflow/kubeflow/components/common/reconcilehelper"
28+
reconcilehelper "github.com/kubeflow/kubeflow/components/notebook-controller/reconcilehelper"
2929
"github.com/kubeflow/kubeflow/components/notebook-controller/api/v1beta1"
3030
"github.com/kubeflow/kubeflow/components/notebook-controller/pkg/metrics"
3131
appsv1 "k8s.io/api/apps/v1"

components/notebook-controller/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ go 1.17
44

55
require (
66
github.com/go-logr/logr v1.2.0
7-
github.com/kubeflow/kubeflow/components/common v0.0.0-20220218084159-4ad0158e955e
87
github.com/onsi/ginkgo v1.16.5
98
github.com/onsi/gomega v1.17.0
109
github.com/prometheus/client_golang v1.11.1

components/notebook-controller/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
314314
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
315315
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
316316
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
317-
github.com/kubeflow/kubeflow/components/common v0.0.0-20220218084159-4ad0158e955e h1:Ud6a+mkZ5pj+QqZnsIPPBk1WrABz1wYcd1n9CYjMMBA=
318-
github.com/kubeflow/kubeflow/components/common v0.0.0-20220218084159-4ad0158e955e/go.mod h1:uj1ImonZ+hHqWKfzZGWjuxl1uODjubBNrg4W8c38/ts=
319317
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
320318
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
321319
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=

components/notebook-controller/third_party/dep.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ github.com/kr/logfmt
147147
github.com/kr/pretty
148148
github.com/kr/pty
149149
github.com/kr/text
150-
github.com/kubeflow/kubeflow/components/common
151150
github.com/magiconair/properties
152151
github.com/mailru/easyjson
153152
github.com/mattn/go-colorable

components/tensorboard-controller/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
#
44
# ${PATH_TO_KUBEFLOW/KUBEFLOW repo}/components
55
#
6-
# This is necessary because the Jupyter controller now depends on
7-
# components/common
86
FROM golang:1.17 as builder
97

108
WORKDIR /workspace
119
# Copy the Go Modules manifests
1210
COPY tensorboard-controller /workspace/tensorboard-controller
13-
COPY common /workspace/common
1411
# cache deps before building and copying source so that we don't need to re-download as much
1512
# and so that source changes don't invalidate our downloaded layer
1613
RUN cd /workspace/tensorboard-controller && go mod download

components/tensorboard-controller/controllers/tensorboard_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"sigs.k8s.io/controller-runtime/pkg/client"
3838
"sigs.k8s.io/controller-runtime/pkg/reconcile"
3939

40-
reconcilehelper "github.com/kubeflow/kubeflow/components/common/reconcilehelper"
40+
reconcilehelper "github.com/kubeflow/kubeflow/components/tensorboard-controller/reconcilehelper"
4141
tensorboardv1alpha1 "github.com/kubeflow/kubeflow/components/tensorboard-controller/api/v1alpha1"
4242
)
4343

0 commit comments

Comments
 (0)