Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into tfjobs_iap
Browse files Browse the repository at this point in the history
  • Loading branch information
Kam D Kasravi committed Jul 20, 2018
2 parents e368628 + aae8327 commit 6f91650
Show file tree
Hide file tree
Showing 29 changed files with 9,945 additions and 7,661 deletions.
6 changes: 4 additions & 2 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ approvers:
- wbuchwalter
reviewers:
- ankushagarwal
- cheyang
- codeflitting
- ddysher
- Jimexist
- lluunn
- mitake
- ddysher
- willb
- yph152
173 changes: 0 additions & 173 deletions build/images/tf_operator/build_and_push.py

This file was deleted.

12 changes: 7 additions & 5 deletions cmd/tf-operator.v2/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (

// ServerOption is the main context object for the controller manager.
type ServerOption struct {
Kubeconfig string
MasterURL string
Threadiness int
PrintVersion bool
JSONLogFormat bool
Kubeconfig string
MasterURL string
Threadiness int
PrintVersion bool
JSONLogFormat bool
EnableGangScheduling bool
}

// NewServerOption creates a new CMServer with a default config.
Expand All @@ -46,4 +47,5 @@ func (s *ServerOption) AddFlags(fs *flag.FlagSet) {

fs.BoolVar(&s.JSONLogFormat, "json-log-format", false,
"Set true to use json style log format. Set false to use plaintext style log format")
fs.BoolVar(&s.EnableGangScheduling, "enable-gang-scheduling", false, "Set true to enable gang scheduling by kube-arbitrator.")
}
2 changes: 1 addition & 1 deletion cmd/tf-operator.v2/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func Run(opt *options.ServerOption) error {
unstructuredInformer := controller.NewUnstructuredTFJobInformer(kcfg)

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

// Start informer goroutines.
go kubeInformerFactory.Start(stopCh)
Expand Down
3 changes: 2 additions & 1 deletion dashboard/backend/handler/api_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package handler

import (
"fmt"
"net/http"

"github.com/emicklei/go-restful"
Expand Down Expand Up @@ -159,7 +160,7 @@ func (apiHandler *APIHandler) handleGetTFJobDetail(request *restful.Request, res

// Get associated pods
pods, err := apiHandler.cManager.ClientSet.CoreV1().Pods(namespace).List(metav1.ListOptions{
// LabelSelector: fmt.Sprintf("kubeflow.org=,runtime_id=%s", job.Spec.RuntimeId),
LabelSelector: fmt.Sprintf("group_name=kubeflow.org,tf_job_name=%s", name),
})
if err != nil {
log.Warningf("failed to list pods for TFJob %v under namespace %v: %v", name, namespace, err)
Expand Down
2 changes: 1 addition & 1 deletion developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Or

```bash
# If you are using v1alpha2
cd ./test/e2e/dist-mnist
cd ./examples/v1alpha2/dist-mnist
docker build -f Dockerfile -t kubeflow/tf-dist-mnist-test:1.0 .
kubectl create -f ./tf-job-mnist.yaml
```
Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ ${GOPATH}/bin/defaulter-gen --input-dirs github.com/kubeflow/tf-operator/pkg/ap
cd - > /dev/null

echo "Generating OpenAPI specification for v1alpha2"
${GOPATH}/bin/openapi-gen --input-dirs github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2,k8s.io/api/core/v1 --output-package github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2 --go-header-file hack/boilerplate/boilerplate.go.txt "$@"
${GOPATH}/bin/openapi-gen --input-dirs github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version --output-package github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1alpha2 --go-header-file hack/boilerplate/boilerplate.go.txt "$@"
cd - > /dev/null
2 changes: 1 addition & 1 deletion pkg/apis/tensorflow/v1alpha2/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func setTypeNameToCamelCase(tfJob *TFJob, typ TFReplicaType) {

// SetDefaults_TFJob sets any unspecified values to defaults.
func SetDefaults_TFJob(tfjob *TFJob) {
// Set default cleanpod policy to All.
// Set default cleanpod policy to Running.
if tfjob.Spec.CleanPodPolicy == nil {
running := CleanPodPolicyRunning
tfjob.Spec.CleanPodPolicy = &running
Expand Down
22 changes: 22 additions & 0 deletions pkg/apis/tensorflow/v1alpha2/install.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package v1alpha2

import (
"k8s.io/apimachinery/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
)

// Install registers the API group and adds type to a schema
func Install(groupFactoryRegister announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) error {
return announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: GroupName,
RootScopedKinds: sets.NewString(),
VersionPreferenceOrder: []string{SchemeGroupVersion.Version},
},
announced.VersionToSchemeFunc{
SchemeGroupVersion.Version: AddToScheme,
},
).Announce(groupFactoryRegister).RegisterAndEnable(registry, scheme)
}
Loading

0 comments on commit 6f91650

Please sign in to comment.