Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Informer: Use unstructured #610

Merged
merged 3 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 16 additions & 21 deletions Gopkg.lock

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

10 changes: 5 additions & 5 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ required = [

[[constraint]]
name = "k8s.io/client-go"
version = "~5.0.0"
version = "~6.0.0"

[[constraint]]
name = "k8s.io/kubernetes"
version = "~v1.8.9"
version = "~v1.9.0"

[[constraint]]
branch = "release-1.8"
branch = "release-1.9"
name = "k8s.io/api"

[[constraint]]
branch = "release-1.8"
branch = "release-1.9"
name = "k8s.io/apimachinery"

[[constraint]]
Expand All @@ -43,4 +43,4 @@ required = [

[[constraint]]
name = "k8s.io/apiserver"
version = "~kubernetes-1.8.5"
version = "~kubernetes-1.9"
15 changes: 11 additions & 4 deletions cmd/tf-operator.v2/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
leaseDuration = 15 * time.Second
renewDuration = 5 * time.Second
retryPeriod = 3 * time.Second
resyncPeriod = 30 * time.Second
)

const RecommendedKubeConfigPathEnv = "KUBECONFIG"
Expand Down Expand Up @@ -91,15 +92,21 @@ func Run(opt *options.ServerOption) error {
}

// Create informer factory.
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClientSet, time.Second*30)
tfJobInformerFactory := tfjobinformers.NewSharedInformerFactory(tfJobClientSet, time.Second*30)
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClientSet, resyncPeriod)
tfJobInformerFactory := tfjobinformers.NewSharedInformerFactory(tfJobClientSet, resyncPeriod)

unstructuredInformer := controller.NewUnstructuredTFJobInformer(kcfg)

// Create tf controller.
tc := controller.NewTFJobController(kubeClientSet, tfJobClientSet, kubeInformerFactory, tfJobInformerFactory)
tc := controller.NewTFJobController(unstructuredInformer, kubeClientSet, tfJobClientSet, kubeInformerFactory, tfJobInformerFactory)

// Start informer goroutines.
go kubeInformerFactory.Start(stopCh)
go tfJobInformerFactory.Start(stopCh)

// We do not use the generated informer because of
// https://github.com/kubeflow/tf-operator/issues/561
// go tfJobInformerFactory.Start(stopCh)
go unstructuredInformer.Informer().Run(stopCh)

// Set leader election start function.
run := func(<-chan struct{}) {
Expand Down
8 changes: 6 additions & 2 deletions pkg/apis/tensorflow/v1alpha2/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ var (
const (
// GroupName is the group name use in this package.
GroupName = "kubeflow.org"
// TFJobResourceKind is the kind name.
TFJobResourceKind = "TFJob"
// Kind is the kind name.
Kind = "TFJob"
// GroupVersion is the version.
GroupVersion = "v1alpha2"
// Plural is the Plural for TFJob.
Plural = "tfjobs"
// Singular is the singular for TFJob.
Singular = "tfjob"
)

// SchemeGroupVersion is the group version used to register these objects.
Expand Down
Loading