From 56cf623c904eab18c51291193d02abd040c5a24a Mon Sep 17 00:00:00 2001 From: BartoszCki Date: Wed, 4 Sep 2019 13:38:48 +0200 Subject: [PATCH 1/3] Add VPC machine types --- gradient/constants.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gradient/constants.py b/gradient/constants.py index abd9b65c..36d2d0b5 100644 --- a/gradient/constants.py +++ b/gradient/constants.py @@ -56,9 +56,14 @@ class Region(object): AMS1 = "Europe (AMS1)" -MACHINE_TYPES = ("Air", "Standard", "Pro", "Advanced", "GPU+", - "P4000", "P5000", "P6000", "V100", - "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10") +MACHINE_TYPES = ( + "Air", "Standard", "Pro", "Advanced", "GPU+", + "P4000", "P5000", "P6000", "V100", + "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", + # VPC machine types + "c5.large", "c5.xlarge", "c5.2xlarge", "c5.4xlarge", "c5.12xlarge", + "p2.xlarge", "p3.2xlarge", "p3.16xlarge", +) BILLING_TYPES = ["hourly", "monthly"] From a465f2663804c31ca94ee87ec291776fab7270a0 Mon Sep 17 00:00:00 2001 From: BartoszCki Date: Wed, 4 Sep 2019 14:16:29 +0200 Subject: [PATCH 2/3] Fix machines list --- gradient/cli/deployments.py | 11 ++++++++--- gradient/constants.py | 3 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gradient/cli/deployments.py b/gradient/cli/deployments.py index 6551d64a..b563dd14 100644 --- a/gradient/cli/deployments.py +++ b/gradient/cli/deployments.py @@ -1,10 +1,10 @@ import collections import click -from gradient.cli import common from gradient import exceptions, logger from gradient.api_sdk import DeploymentsClient +from gradient.cli import common from gradient.cli.cli import cli from gradient.cli.cli_types import ChoiceType from gradient.cli.common import api_key_option, del_if_value_is_none, ClickGroup @@ -23,8 +23,13 @@ def deployments(): ) ) -DEPLOYMENT_MACHINE_TYPES = ("G1", "G6", "G12", - "K80", "P100", "GV100") +DEPLOYMENT_MACHINE_TYPES = ( + "G1", "G6", "G12", + "K80", "P100", "GV100", + # VPC machine types + "c5.xlarge", "c5.4xlarge", "c5.12xlarge", + "p2.xlarge", "p3.2xlarge", "p3.16xlarge", +) def get_deployment_client(api_key): diff --git a/gradient/constants.py b/gradient/constants.py index 36d2d0b5..b141dcb7 100644 --- a/gradient/constants.py +++ b/gradient/constants.py @@ -60,9 +60,6 @@ class Region(object): "Air", "Standard", "Pro", "Advanced", "GPU+", "P4000", "P5000", "P6000", "V100", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", - # VPC machine types - "c5.large", "c5.xlarge", "c5.2xlarge", "c5.4xlarge", "c5.12xlarge", - "p2.xlarge", "p3.2xlarge", "p3.16xlarge", ) BILLING_TYPES = ["hourly", "monthly"] From 6b492dcf31b370ceb701d123e5720601bbaef947 Mon Sep 17 00:00:00 2001 From: BartoszCki Date: Wed, 4 Sep 2019 14:37:32 +0200 Subject: [PATCH 3/3] Remove hardcoded machineType choices --- gradient/cli/deployments.py | 1 - gradient/cli/machines.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/gradient/cli/deployments.py b/gradient/cli/deployments.py index b563dd14..f36c3154 100644 --- a/gradient/cli/deployments.py +++ b/gradient/cli/deployments.py @@ -63,7 +63,6 @@ def get_deployment_client(api_key): @click.option( "--machineType", "machine_type", - type=click.Choice(DEPLOYMENT_MACHINE_TYPES), required=True, help="Type of machine for new deployment", cls=common.OptionReadValueFromConfigFile, diff --git a/gradient/cli/machines.py b/gradient/cli/machines.py index 3291990b..d0ccd587 100644 --- a/gradient/cli/machines.py +++ b/gradient/cli/machines.py @@ -41,7 +41,6 @@ def machines_group(): @click.option( "--machineType", "machine_type", - type=click.Choice(constants.MACHINE_TYPES), required=True, help="Machine type", cls=common.OptionReadValueFromConfigFile, @@ -72,7 +71,6 @@ def check_machine_availability(region, machine_type, api_key, options_file): @click.option( "--machineType", "machine_type", - type=click.Choice(constants.MACHINE_TYPES), required=True, help="Machine type", cls=common.OptionReadValueFromConfigFile,