Skip to content

Commit 49927dc

Browse files
authored
Merge pull request #82 from Paperspace/PS-11173-Add-vpc-instances
Add VPC machine types
2 parents 63681af + 6b492dc commit 49927dc

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

gradient/cli/deployments.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import collections
22

33
import click
4-
from gradient.cli import common
54

65
from gradient import exceptions, logger
76
from gradient.api_sdk import DeploymentsClient
7+
from gradient.cli import common
88
from gradient.cli.cli import cli
99
from gradient.cli.cli_types import ChoiceType
1010
from gradient.cli.common import api_key_option, del_if_value_is_none, ClickGroup
@@ -23,8 +23,13 @@ def deployments():
2323
)
2424
)
2525

26-
DEPLOYMENT_MACHINE_TYPES = ("G1", "G6", "G12",
27-
"K80", "P100", "GV100")
26+
DEPLOYMENT_MACHINE_TYPES = (
27+
"G1", "G6", "G12",
28+
"K80", "P100", "GV100",
29+
# VPC machine types
30+
"c5.xlarge", "c5.4xlarge", "c5.12xlarge",
31+
"p2.xlarge", "p3.2xlarge", "p3.16xlarge",
32+
)
2833

2934

3035
def get_deployment_client(api_key):
@@ -58,7 +63,6 @@ def get_deployment_client(api_key):
5863
@click.option(
5964
"--machineType",
6065
"machine_type",
61-
type=click.Choice(DEPLOYMENT_MACHINE_TYPES),
6266
required=True,
6367
help="Type of machine for new deployment",
6468
cls=common.OptionReadValueFromConfigFile,

gradient/cli/machines.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def machines_group():
4141
@click.option(
4242
"--machineType",
4343
"machine_type",
44-
type=click.Choice(constants.MACHINE_TYPES),
4544
required=True,
4645
help="Machine type",
4746
cls=common.OptionReadValueFromConfigFile,
@@ -72,7 +71,6 @@ def check_machine_availability(region, machine_type, api_key, options_file):
7271
@click.option(
7372
"--machineType",
7473
"machine_type",
75-
type=click.Choice(constants.MACHINE_TYPES),
7674
required=True,
7775
help="Machine type",
7876
cls=common.OptionReadValueFromConfigFile,

gradient/constants.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ class Region(object):
5656
AMS1 = "Europe (AMS1)"
5757

5858

59-
MACHINE_TYPES = ("Air", "Standard", "Pro", "Advanced", "GPU+",
60-
"P4000", "P5000", "P6000", "V100",
61-
"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10")
59+
MACHINE_TYPES = (
60+
"Air", "Standard", "Pro", "Advanced", "GPU+",
61+
"P4000", "P5000", "P6000", "V100",
62+
"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10",
63+
)
6264

6365
BILLING_TYPES = ["hourly", "monthly"]
6466

0 commit comments

Comments
 (0)