From 528bb3afd92cc0f93a0a8308713186adc9815727 Mon Sep 17 00:00:00 2001 From: James Casbon Date: Sat, 12 Jan 2019 22:02:20 +0000 Subject: [PATCH] gcp allow manual network configuration (#3748) --- python/ray/autoscaler/gcp/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/ray/autoscaler/gcp/config.py b/python/ray/autoscaler/gcp/config.py index d6ae2edeb..619c493e7 100644 --- a/python/ray/autoscaler/gcp/config.py +++ b/python/ray/autoscaler/gcp/config.py @@ -267,6 +267,12 @@ def _configure_key_pair(config): def _configure_subnet(config): """Pick a reasonable subnet if not specified by the config.""" + # Rationale: avoid subnet lookup if the network is already + # completely manually configured + if ("networkInterfaces" in config["head_node"] + and "networkInterfaces" in config["worker_nodes"]): + return config + subnets = _list_subnets(config) if not subnets: