mirror of
https://github.com/wassname/ray.git
synced 2026-08-07 11:27:43 +08:00
[hotfix] [autoscaler] Address remaining comments on renaming instance => node (#10229)
* more renaming * fix import
This commit is contained in:
@@ -28,7 +28,7 @@ SECURITY_GROUP_TEMPLATE = RAY + "-{}"
|
||||
|
||||
# Mapping from the node type tag to the section of the autoscaler yaml that
|
||||
# contains the config for the node type.
|
||||
NODE_TYPE_CONFIG_KEYS = {
|
||||
NODE_KIND_CONFIG_KEYS = {
|
||||
NODE_KIND_WORKER: "worker_nodes",
|
||||
NODE_KIND_HEAD: "head_node",
|
||||
}
|
||||
@@ -426,8 +426,8 @@ def _configure_security_group(config):
|
||||
head_security_group_src="config", workers_security_group_src="config")
|
||||
|
||||
node_types_to_configure = [
|
||||
node_type for node_type, config_key in NODE_TYPE_CONFIG_KEYS.items()
|
||||
if "SecurityGroupIds" not in config[NODE_TYPE_CONFIG_KEYS[node_type]]
|
||||
node_type for node_type, config_key in NODE_KIND_CONFIG_KEYS.items()
|
||||
if "SecurityGroupIds" not in config[NODE_KIND_CONFIG_KEYS[node_type]]
|
||||
]
|
||||
if not node_types_to_configure:
|
||||
return config # have user-defined groups
|
||||
@@ -506,7 +506,7 @@ def _get_or_create_vpc_security_groups(conf, node_types):
|
||||
node_type_to_vpc = {
|
||||
node_type: _get_vpc_id_or_die(
|
||||
ec2,
|
||||
conf[NODE_TYPE_CONFIG_KEYS[node_type]]["SubnetIds"][0],
|
||||
conf[NODE_KIND_CONFIG_KEYS[node_type]]["SubnetIds"][0],
|
||||
)
|
||||
for node_type in node_types
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ from botocore.config import Config
|
||||
from ray.autoscaler.node_provider import NodeProvider
|
||||
from ray.autoscaler.aws.config import bootstrap_aws
|
||||
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, TAG_RAY_NODE_NAME, \
|
||||
TAG_RAY_LAUNCH_CONFIG, TAG_RAY_NODE_KIND, TAG_RAY_INSTANCE_TYPE
|
||||
TAG_RAY_LAUNCH_CONFIG, TAG_RAY_NODE_KIND, TAG_RAY_USER_NODE_TYPE
|
||||
from ray.ray_constants import BOTO_MAX_RETRIES, BOTO_CREATE_MAX_RETRIES
|
||||
from ray.autoscaler.log_timer import LogTimer
|
||||
|
||||
@@ -218,10 +218,10 @@ class AWSNodeProvider(NodeProvider):
|
||||
},
|
||||
]
|
||||
# This tag may not always be present.
|
||||
if TAG_RAY_INSTANCE_TYPE in tags:
|
||||
if TAG_RAY_USER_NODE_TYPE in tags:
|
||||
filters.append({
|
||||
"Name": "tag:{}".format(TAG_RAY_INSTANCE_TYPE),
|
||||
"Values": [tags[TAG_RAY_INSTANCE_TYPE]],
|
||||
"Name": "tag:{}".format(TAG_RAY_USER_NODE_TYPE),
|
||||
"Values": [tags[TAG_RAY_USER_NODE_TYPE]],
|
||||
})
|
||||
|
||||
reuse_nodes = list(
|
||||
|
||||
Reference in New Issue
Block a user