Skip to content

Commit

Permalink
openmpi: support custom resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
everpeace committed May 9, 2018
1 parent 18b670d commit 664e5a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions kubeflow/openmpi/prototypes/openmpi.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// @optionalParam gpu number 0 Number of GPUs per worker.
// @optionalParam cpu string null CPU limits per worker.
// @optionalParam memory string null Memory limits per worker.
// @optionalParam customResources string null Comma-delimited list of "resourceName=amount" pairs which you want to limit per worker.
// @optionalParam serviceAccountName string null the service account name to run pods. The service account should have clusterRoleBinding for "view" ClusterRole. If it was not set, service account and its role binding will be created automatically.
// @optionalParam schedulerName string default-scheduler scheduler name to use for the components.
// @optionalParam controllerImage string jiez/openmpi-controller:0.0.1 Docker image of the openmpi-controller.
Expand Down
7 changes: 6 additions & 1 deletion kubeflow/openmpi/workloads.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ local ROLE_WORKER = "worker";
name: "openmpi-job",
image: params.image,
imagePullPolicy: params.imagePullPolicy,
resources: $.resources(params, role),
resources: std.mergePatch($.resources(params, role), $.customResources(params, role)),
terminationMessagePath: "/dev/termination-log",
terminationMessagePolicy: "File",
workingDir: "/kubeflow/openmpi/data",
Expand Down Expand Up @@ -173,4 +173,9 @@ local ROLE_WORKER = "worker";

nodeSelector(params, role)::
if role == ROLE_WORKER then util.toObject(params.nodeSelector) else {},

customResources(params, role)::
if role == ROLE_WORKER then {
limits: util.toObject(params.customResources),
} else {},
}

0 comments on commit 664e5a3

Please sign in to comment.