Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Change CLI and constants #8593

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions harness/determined/deploy/aws/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_deployment_class(deployment_type: str) -> Type[base.DeterminedDeployment
constants.deployment_types.EFS: vpc.EFS,
constants.deployment_types.FSX: vpc.FSx,
constants.deployment_types.GOVCLOUD: govcloud.Govcloud,
constants.deployment_types.LORE: vpc.Lore,
constants.deployment_types.GENAI: vpc.Lore,
} # type: Dict[str, Type[base.DeterminedDeployment]]
return deployment_type_map[deployment_type]

Expand Down Expand Up @@ -176,29 +176,29 @@ def deploy_aws(command: str, args: argparse.Namespace) -> None:
if args.db_size is not None and args.db_size < 20:
raise ValueError("--db-size must be greater than or equal to 20 GB")

if args.deployment_type != constants.deployment_types.LORE:
if args.lore_version is not None:
raise ValueError("--lore-version can only be specified for 'lore' deployments")
if args.deployment_type != constants.deployment_types.GENAI:
if args.genai_version is not None:
raise ValueError("--genai-version can only be specified for 'genai' deployments")
else:
print(
colored(
"Lore deployment type is experimental and not ready for production use.",
"GenAI deployment type is experimental and not ready for production use.",
"yellow",
)
)
if args.lore_version is not None and is_full_git_commit_hash(args.lore_version):
short_hash = args.lore_version[:7]
if args.genai_version is not None and is_full_git_commit_hash(args.genai_version):
short_hash = args.genai_version[:7]
print(
colored(
f"Lore tags are not full commit hashes. Using {short_hash} instead.",
f"GenAI tags are not full commit hashes. Using {short_hash} instead.",
"yellow",
)
)
args.lore_version = short_hash
args.genai_version = short_hash

if args.deployment_type not in {
constants.deployment_types.EFS,
constants.deployment_types.LORE,
constants.deployment_types.GENAI,
}:
if args.efs_id is not None:
raise ValueError("--efs-id can only be specified for 'efs' deployments")
Expand Down Expand Up @@ -267,7 +267,7 @@ def deploy_aws(command: str, args: argparse.Namespace) -> None:
constants.cloudformation.DOCKER_USER: args.docker_user,
constants.cloudformation.DOCKER_PASS: args.docker_pass,
constants.cloudformation.NOTEBOOK_TIMEOUT: args.notebook_timeout,
constants.cloudformation.LORE_VERSION: args.lore_version,
constants.cloudformation.LORE_VERSION: args.genai_version,
}

if args.master_config_template_path:
Expand Down Expand Up @@ -453,7 +453,7 @@ def handle_dump_master_config_template(args: argparse.Namespace) -> None:
type=str,
choices=constants.deployment_types.DEPLOYMENT_TYPES,
default=constants.defaults.DEPLOYMENT_TYPE,
help="deployment type. Lore support is experimental.",
help="deployment type. GenAI support is experimental.",
),
Arg(
"--inbound-cidr",
Expand Down Expand Up @@ -648,10 +648,10 @@ def handle_dump_master_config_template(args: argparse.Namespace) -> None:
"are automatically terminated",
),
Arg(
"--lore-version",
"--genai-version",
type=str,
help="Specifies the version of Lore to install. The value must be a valid"
+ " Lore tag available on Docker Hub.",
help="Specifies the version of GenAI to install. The value must be a valid"
+ " GenAI tag available on Docker Hub.",
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions harness/determined/deploy/aws/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ class deployment_types:
SIMPLE_RDS = "simple-rds"
SECURE = "secure"
EFS = "efs"
LORE = "lore"
GENAI = "genai"
FSX = "fsx"
GOVCLOUD = "govcloud"
DEPLOYMENT_TYPES = [SIMPLE, SECURE, EFS, FSX, GOVCLOUD, SIMPLE_RDS, LORE]
DEPLOYMENT_TYPES = [SIMPLE, SECURE, EFS, FSX, GOVCLOUD, SIMPLE_RDS, GENAI]
TYPE_TAG_KEY = "deployment-type"


Expand Down
8 changes: 5 additions & 3 deletions harness/determined/deploy/aws/deployment_types/vpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ class EFS(VPCBase):

class Lore(VPCBase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this classname be changed too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an internal reference, we are doing the naming migration in phases and focusing on user facing noes first.

template = "lore.yaml"
deployment_type = constants.deployment_types.LORE
deployment_type = constants.deployment_types.GENAI

def before_deploy_print(self) -> None:
super().before_deploy_print()
lore_tag = self.parameters[constants.cloudformation.LORE_VERSION] or "latest"
print(f"Lore Version: {lore_tag}")
print(f"Lore Image: determinedai/environments-dev:lore-backend-image-{lore_tag}")
# Lore is renamed to GenAI and we are changing the user visible text to GenAI
# Interal references will be updated in a later stage if prioritized
print(f"GenAI Version: {lore_tag}")
print(f"GenAI Image: determinedai/environments-dev:lore-backend-image-{lore_tag}")
Loading