[AWS] Fill-in AMI if not provided (#13808)

* fill in default ami if not provided

* lint fix

* quick test

* Update python/ray/tests/aws/test_autoscaler_aws.py

* Update python/ray/tests/aws/test_autoscaler_aws.py

* fix test

* fix tests

* fix lint

* remove bad test

Co-authored-by: Ameer Haj Ali <ameerh@berkeley.edu>
This commit is contained in:
Ian Rodney
2021-02-01 14:30:48 -08:00
committed by GitHub
co-authored by Ameer Haj Ali
parent 55566bc797
commit 1ee5d5faff
2 changed files with 34 additions and 3 deletions
+4 -2
View File
@@ -496,11 +496,13 @@ def _check_ami(config):
# If we do not provide a default AMI for the given region, noop.
return
if config["head_node"].get("ImageId", "").lower() == "latest_dlami":
head_ami = config["head_node"].get("ImageId", "").lower()
if head_ami in ["", "latest_dlami"]:
config["head_node"]["ImageId"] = default_ami
_set_config_info(head_ami_src="dlami")
if config["worker_nodes"].get("ImageId", "").lower() == "latest_dlami":
worker_ami = config["worker_nodes"].get("ImageId", "").lower()
if worker_ami in ["", "latest_dlami"]:
config["worker_nodes"]["ImageId"] = default_ami
_set_config_info(workers_ami_src="dlami")