Skip to content

Commit

Permalink
Make it easy to disable the GPU pool. (#1810)
Browse files Browse the repository at this point in the history
* Cluster deployment will fail in regions with no GPUs.
* To support deploying in regions with no GPUs we don't create a GPU
  node pool by setting max GPU nodes to 0.

* Disable GPUs by default since GCP projects by default don't have GPU quota.
  • Loading branch information
jlewi authored and k8s-ci-robot committed Oct 26, 2018
1 parent 7bf044c commit 23ba533
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ resources:
cpu-pool-enable-autoscaling: true
cpu-pool-min-nodes: 0
cpu-pool-max-nodes: 10
# GPUs are not enabled by default. To add GPUs
# set gpu-pool-max-nodes to a none-zero value.
gpu-pool-enable-autoscaling: true
gpu-pool-min-nodes: 0
gpu-pool-max-nodes: 10
gpu-pool-max-nodes: 0
gpu-type: nvidia-tesla-k80
# Whether to enable TPUs
enable_tpu: false
securityConfig:
Expand Down
4 changes: 3 additions & 1 deletion deployment/gke/deployment_manager_configs/cluster.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ resources:
# We do this so that if we want to make changes we can delete the existing resource and then recreate it.
# Updating doesn't work so well because we are limited in what changes GKE's update method supports.

{% if properties['gpu-pool-max-nodes'] > 0 %}
- name: {{ GPU_POOL }}
{% if properties['gkeApiVersion'] == 'v1beta1' %}
type: gcp-types/container-v1beta1:projects.locations.clusters.nodePools
Expand Down Expand Up @@ -157,12 +158,13 @@ resources:
minCpuPlatform: 'Intel Broadwell'
accelerators:
- acceleratorCount: 1
acceleratorType: nvidia-tesla-k80
acceleratorType: {{ properties['gpu-type'] }}

metadata:
dependsOn:
# We can only create 1 node pool at a time.
- {{ CLUSTER_NAME }}
{% endif %}

{# Project defaults to the project of the deployment. #}
- name: {{ properties['ipName'] }}
Expand Down

0 comments on commit 23ba533

Please sign in to comment.