Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ FROM golang:1.13.6 AS build

ADD . /go/src/github.com/kubeflow/mpi-operator
WORKDIR /go/src/github.com/kubeflow/mpi-operator
RUN go build -o mpi-operator github.com/kubeflow/mpi-operator/cmd/mpi-operator.v1alpha2
RUN make

FROM gcr.io/distroless/base-debian10:latest
COPY --from=build /go/src/github.com/kubeflow/mpi-operator/mpi-operator /opt/
COPY --from=build /go/src/github.com/kubeflow/mpi-operator/mpi-operator.* /opt/
COPY third_party/library/license.txt /opt/license.txt

ENTRYPOINT ["/opt/mpi-operator"]
ENTRYPOINT ["/opt/mpi-operator.v1alpha2"]
CMD ["--help"]
3 changes: 1 addition & 2 deletions cmd/mpi-operator.v1/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ func Run(opt *options.ServerOption) error {
kubeInformerFactory.Core().V1().ServiceAccounts(),
kubeInformerFactory.Rbac().V1().Roles(),
kubeInformerFactory.Rbac().V1().RoleBindings(),
kubeInformerFactory.Apps().V1().StatefulSets(),
kubeInformerFactory.Batch().V1().Jobs(),
kubeInformerFactory.Core().V1().Pods(),
podgroupsInformer,
kubeflowInformerFactory.Kubeflow().V1().MPIJobs(),
opt.KubectlDeliveryImage,
Expand Down
27 changes: 9 additions & 18 deletions deploy/mpi-operator-v1.yaml → deploy/v1/mpi-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ spec:
replicas:
type: integer
minimum: 1
additionalPrinterColumns:
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
---
apiVersion: v1
kind: Namespace
Expand All @@ -71,9 +75,13 @@ rules:
resources:
- pods
verbs:
- create
- get
- list
- watch
- delete
- update
- patch
# This is needed for the launcher Role.
- apiGroups:
- ""
Expand Down Expand Up @@ -114,24 +122,6 @@ rules:
- list
- update
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- list
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- list
- update
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
Expand Down Expand Up @@ -197,6 +187,7 @@ spec:
containers:
- name: mpi-operator
image: mpioperator/mpi-operator:latest
command: ["/opt/mpi-operator.v1"]
args: [
"-alsologtostderr",
"--kubectl-delivery-image",
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions pkg/apis/kubeflow/v1/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

package v1

import common "github.com/kubeflow/common/pkg/apis/common/v1"

const (
// EnvKubeflowNamespace is ENV for kubeflow namespace specified by user.
EnvKubeflowNamespace = "KUBEFLOW_NAMESPACE"
// DefaultRestartPolicy is default RestartPolicy for ReplicaSpec.
DefaultRestartPolicy = common.RestartPolicyNever
)
10 changes: 5 additions & 5 deletions pkg/apis/kubeflow/v1/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {

// setDefaultsTypeLauncher sets the default value to launcher.
func setDefaultsTypeLauncher(spec *common.ReplicaSpec) {
if spec != nil {
// Only a `RestartPolicy` equal to `Never` or `OnFailure` is allowed for `Job`.
if spec.RestartPolicy != common.RestartPolicyNever {
spec.RestartPolicy = common.RestartPolicyOnFailure
}
if spec != nil && spec.RestartPolicy == "" {
spec.RestartPolicy = DefaultRestartPolicy
}
}

// setDefaultsTypeWorker sets the default value to worker.
func setDefaultsTypeWorker(spec *common.ReplicaSpec) {
if spec != nil && spec.RestartPolicy == "" {
spec.RestartPolicy = DefaultRestartPolicy
}
}

func SetDefaults_MPIJob(mpiJob *MPIJob) {
Expand Down
Loading