mirror of
https://github.com/clearml/clearml
synced 2025-05-15 18:05:40 +00:00
Update Auto Scaler default values and configuration format
This commit is contained in:
parent
12d51dae92
commit
71c45fcdd3
@ -33,7 +33,8 @@ class AutoScaler(object):
|
|||||||
class Configuration(object):
|
class Configuration(object):
|
||||||
resource_configurations = attr.ib(default=None)
|
resource_configurations = attr.ib(default=None)
|
||||||
queues = attr.ib(default=None)
|
queues = attr.ib(default=None)
|
||||||
extra_trains_conf = attr.ib(default="")
|
extra_trains_conf = attr.ib(default="") # Backwards compatibility
|
||||||
|
extra_clearml_conf = attr.ib(default="")
|
||||||
extra_vm_bash_script = attr.ib(default="")
|
extra_vm_bash_script = attr.ib(default="")
|
||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self):
|
||||||
@ -61,7 +62,7 @@ class AutoScaler(object):
|
|||||||
self.cloud_credentials_region = settings.cloud_credentials_region
|
self.cloud_credentials_region = settings.cloud_credentials_region
|
||||||
self.default_docker_image = settings.default_docker_image
|
self.default_docker_image = settings.default_docker_image
|
||||||
|
|
||||||
self.extra_trains_conf = configuration.extra_trains_conf
|
self.extra_clearml_conf = configuration.extra_clearml_conf or configuration.extra_trains_conf
|
||||||
self.extra_vm_bash_script = configuration.extra_vm_bash_script
|
self.extra_vm_bash_script = configuration.extra_vm_bash_script
|
||||||
self.resource_configurations = configuration.resource_configurations
|
self.resource_configurations = configuration.resource_configurations
|
||||||
self.queues = configuration.queues
|
self.queues = configuration.queues
|
||||||
|
@ -87,7 +87,7 @@ class AwsAutoScaler(AutoScaler):
|
|||||||
queue=queue_name,
|
queue=queue_name,
|
||||||
git_user=self.git_user or "",
|
git_user=self.git_user or "",
|
||||||
git_pass=self.git_pass or "",
|
git_pass=self.git_pass or "",
|
||||||
clearml_conf='\\"'.join(self.extra_trains_conf.split('"')),
|
clearml_conf='\\"'.join(self.extra_clearml_conf.split('"')),
|
||||||
bash_script=self.extra_vm_bash_script,
|
bash_script=self.extra_vm_bash_script,
|
||||||
docker="--docker '{}'".format(self.default_docker_image)
|
docker="--docker '{}'".format(self.default_docker_image)
|
||||||
if self.default_docker_image
|
if self.default_docker_image
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import json
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
@ -80,7 +81,8 @@ def main():
|
|||||||
# from here on everything is logged automatically
|
# from here on everything is logged automatically
|
||||||
task = Task.init(project_name="DevOps", task_name="AWS Auto-Scaler", task_type=Task.TaskTypes.service)
|
task = Task.init(project_name="DevOps", task_name="AWS Auto-Scaler", task_type=Task.TaskTypes.service)
|
||||||
task.connect(hyper_params)
|
task.connect(hyper_params)
|
||||||
task.connect_configuration(configurations)
|
configurations.update(json.loads(task.get_configuration_object(name="General") or "{}"))
|
||||||
|
task.set_configuration_object(name="General", config_text=json.dumps(configurations, indent=2))
|
||||||
|
|
||||||
if args.remote or args.run:
|
if args.remote or args.run:
|
||||||
print("Running AWS auto-scaler as a service\nExecution log {}".format(task.get_output_log_web_page()))
|
print("Running AWS auto-scaler as a service\nExecution log {}".format(task.get_output_log_web_page()))
|
||||||
@ -159,14 +161,14 @@ def run_wizard():
|
|||||||
),
|
),
|
||||||
"ami_id": get_input(
|
"ami_id": get_input(
|
||||||
"the Amazon Machine Image id",
|
"the Amazon Machine Image id",
|
||||||
"['ami-07c95cafbb788face']",
|
"['ami-04c0416d6bd8e4b1f']",
|
||||||
question='Select',
|
question='Select',
|
||||||
default="ami-07c95cafbb788face",
|
default="ami-04c0416d6bd8e4b1f",
|
||||||
),
|
),
|
||||||
"ebs_device_name": get_input(
|
"ebs_device_name": get_input(
|
||||||
"the Amazon EBS device",
|
"the Amazon EBS device",
|
||||||
"['/dev/xvda']",
|
"['/dev/sda1']",
|
||||||
default="/dev/xvda",
|
default="/dev/sda1",
|
||||||
),
|
),
|
||||||
"ebs_volume_size": input_int(
|
"ebs_volume_size": input_int(
|
||||||
"the Amazon EBS volume size",
|
"the Amazon EBS volume size",
|
||||||
@ -175,8 +177,8 @@ def run_wizard():
|
|||||||
),
|
),
|
||||||
"ebs_volume_type": get_input(
|
"ebs_volume_type": get_input(
|
||||||
"the Amazon EBS volume type",
|
"the Amazon EBS volume type",
|
||||||
"['gp2']",
|
"['gp3']",
|
||||||
default="gp2",
|
default="gp3",
|
||||||
),
|
),
|
||||||
"key_name": get_input(
|
"key_name": get_input(
|
||||||
"the Amazon Key Pair name",
|
"the Amazon Key Pair name",
|
||||||
@ -209,10 +211,10 @@ def run_wizard():
|
|||||||
)
|
)
|
||||||
print("Entered {} lines of pre-execution bash script".format(num_lines_bash_script))
|
print("Entered {} lines of pre-execution bash script".format(num_lines_bash_script))
|
||||||
|
|
||||||
configurations.extra_trains_conf, num_lines_trains_conf = multiline_input(
|
configurations.extra_clearml_conf, num_lines_clearml_conf = multiline_input(
|
||||||
"\nEnter anything you'd like to include in your trains.conf file []"
|
"\nEnter anything you'd like to include in your clearml.conf file []"
|
||||||
)
|
)
|
||||||
print("Entered {} extra lines for trains.conf file".format(num_lines_trains_conf))
|
print("Entered {} extra lines for clearml.conf file".format(num_lines_clearml_conf))
|
||||||
|
|
||||||
print("\nDefine the machines budget:")
|
print("\nDefine the machines budget:")
|
||||||
print("-----------------------------")
|
print("-----------------------------")
|
||||||
@ -274,7 +276,7 @@ def run_wizard():
|
|||||||
|
|
||||||
if not input_bool("Do you wish to add another instance type to queue? [y/N]: "):
|
if not input_bool("Do you wish to add another instance type to queue? [y/N]: "):
|
||||||
break
|
break
|
||||||
if not input_bool("\nAdd another queue? [y/N]: "):
|
if not input_bool("\nAdd another queue? [y/N]"):
|
||||||
break
|
break
|
||||||
configurations.queues = dict(queues)
|
configurations.queues = dict(queues)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user