Skip to content

Commit

Permalink
fix bug: make sure et-operator is installed in arena-system namespace (
Browse files Browse the repository at this point in the history
  • Loading branch information
happy2048 authored Jan 27, 2021
1 parent 386e37b commit 3559f56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
18 changes: 6 additions & 12 deletions kubernetes-artifacts/et-operator/et-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app: et-operator
name: kube-ai
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -7694,13 +7688,13 @@ metadata:
labels:
app: et-operator
name: et-operator
namespace: kube-ai
namespace: arena-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: et-operator-leader-election
namespace: kube-ai
namespace: arena-system
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -7918,15 +7912,15 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: et-operator-leader-election
namespace: kube-ai
namespace: arena-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: et-operator-leader-election
subjects:
- kind: ServiceAccount
name: et-operator
namespace: kube-ai
namespace: arena-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -7939,15 +7933,15 @@ roleRef:
subjects:
- kind: ServiceAccount
name: et-operator
namespace: kube-ai
namespace: arena-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: et-operator
name: et-operator
namespace: kube-ai
namespace: arena-system
spec:
replicas: 1
selector:
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/training/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewGetCommand() *cobra.Command {
LogLevel: viper.GetString("loglevel"),
Namespace: viper.GetString("namespace"),
ArenaNamespace: viper.GetString("arena-namespace"),
IsDaemonMode: true,
IsDaemonMode: false,
})
if err != nil {
return fmt.Errorf("failed to create arena client: %v", err)
Expand Down
2 changes: 0 additions & 2 deletions pkg/training/trainer_volcano.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,11 @@ func (st *VolcanoJobTrainer) GetTrainingJob(name, namespace string) (TrainingJob
if config.GetArenaConfiger().IsDaemonMode() {
err = arenacache.GetCacheClient().Get(context.Background(), client.ObjectKey{Namespace: namespace, Name: name}, volcanoJob)
if err != nil {
log.Errorf("%v", err)
if strings.Contains(err.Error(), fmt.Sprintf(`Job.batch.volcano.sh "%v" not found`, name)) {
return nil, types.ErrTrainingJobNotFound
}
return nil, fmt.Errorf("failed to find volcanojob %v from cache,reason: %v", name, err)
}

} else {
volcanoJob, err = st.volcanoJobClient.BatchV1alpha1().Jobs(namespace).Get(name, metav1.GetOptions{})
if err != nil {
Expand Down

0 comments on commit 3559f56

Please sign in to comment.