Skip to content

Commit

Permalink
clean files
Browse files Browse the repository at this point in the history
  • Loading branch information
QiJune committed Oct 12, 2020
1 parent aee07ea commit 2f74278
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 5 deletions.
15 changes: 10 additions & 5 deletions api/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ limitations under the License.
// Generate default for pytorch apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/defaulter-gen/main.go -O zz_generated.defaults -i ./pytorch/... -h ../hack/boilerplate.go.txt

// Generate deepcopy for elasticdljob apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/deepcopy-gen/main.go -O zz_generated.deepcopy -i ./elasticdljob/... -h ../hack/boilerplate.go.txt
// Generate default for elasticdljob apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/defaulter-gen/main.go -O zz_generated.defaults -i ./elasticdljob/... -h ../hack/boilerplate.go.txt

// Generate deepcopy for xgboost apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/deepcopy-gen/main.go -O zz_generated.deepcopy -i ./xgboost/... -h ../hack/boilerplate.go.txt
// Generate default for xgboost apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/defaulter-gen/main.go -O zz_generated.defaults -i ./xgboost/... -h ../hack/boilerplate.go.txt

// Generate deepcopy for marsjob apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/deepcopy-gen/main.go -O zz_generated.deepcopy -i ./marsjob/... -h ../hack/boilerplate.go.txt
// Generate default for elasticdljob apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/defaulter-gen/main.go -O zz_generated.defaults -i ./marsjob/... -h ../hack/boilerplate.go.txt

// Generate deepcopy for elasticdljob apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/deepcopy-gen/main.go -O zz_generated.deepcopy -i ./elasticdljob/... -h ../hack/boilerplate.go.txt
// Generate default for elasticdljob apis.
//go:generate go run $GOPATH/src/k8s.io/code-generator/cmd/defaulter-gen/main.go -O zz_generated.defaults -i ./elasticdljob/... -h ../hack/boilerplate.go.txt

package api

import (
Expand Down
108 changes: 108 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services/status
verbs:
- get
- patch
- update
- apiGroups:
- elasticdl.org
resources:
Expand Down Expand Up @@ -58,3 +86,83 @@ rules:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- pytorchjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- pytorchjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- tfjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- tfjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- xdl.kubedl.io
resources:
- xdljobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- xdl.kubedl.io
resources:
- xdljobs/status
verbs:
- get
- patch
- update
- apiGroups:
- xgboostjob.kubeflow.org
resources:
- xgboostjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- xgboostjob.kubeflow.org
resources:
- xgboostjobs/status
verbs:
- get
- patch
- update
1 change: 1 addition & 0 deletions controllers/pytorch/pytorchjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type PytorchJobReconciler struct {
// +kubebuilder:rbac:groups="",resources=services/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kubeflow.org,resources=pytorchjobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=kubeflow.org,resources=pytorchjobs/status,verbs=get;update;patch

func (r *PytorchJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
// Fetch latest pytorch job instance.
sharedPytorchJob := &pytorchv1.PyTorchJob{}
Expand Down
1 change: 1 addition & 0 deletions controllers/tensorflow/tfjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type TFJobReconciler struct {
// +kubebuilder:rbac:groups="",resources=services/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=kubeflow.org,resources=tfjobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=kubeflow.org,resources=tfjobs/status,verbs=get;update;patch

func (r *TFJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
// Fetch the TFJob tfJob
sharedTfJob := &tfv1.TFJob{}
Expand Down
1 change: 1 addition & 0 deletions controllers/xdl/xdljob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type XDLJobReconciler struct {
// +kubebuilder:rbac:groups="",resources=services/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=xdl.kubedl.io,resources=xdljobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=xdl.kubedl.io,resources=xdljobs/status,verbs=get;update;patch

func (r *XDLJobReconciler) Reconcile(request reconcile.Request) (reconcile.Result, error) {
// Fetch the latest xdlJob instance.
sharedXdlJob := &xdlv1alpha1.XDLJob{}
Expand Down
1 change: 1 addition & 0 deletions controllers/xgboost/xgboostjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type XgboostJobReconciler struct {
// +kubebuilder:rbac:groups="",resources=services/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=xgboostjob.kubeflow.org,resources=xgboostjobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=xgboostjob.kubeflow.org,resources=xgboostjobs/status,verbs=get;update;patch

func (r *XgboostJobReconciler) Reconcile(req reconcile.Request) (reconcile.Result, error) {
// Fetch the XGBoostJob instance
xgboostjob := &v1alpha1.XGBoostJob{}
Expand Down

0 comments on commit 2f74278

Please sign in to comment.