Skip to content

Commit

Permalink
Merge pull request #193 from DireLines/networkVolumeDropdown
Browse files Browse the repository at this point in the history
Network volume dropdown
  • Loading branch information
justinmerrell authored Oct 30, 2023
2 parents 0bc655f + 6503413 commit 91eae84
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions runpod/cli/groups/project/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,26 @@ def new_project_wizard(project_name, model_type, model_name, init_current_dir):
validate_project_name(project_name)

network_volumes = get_user()['networkVolumes']
def print_net_vol(vol):
return {'name':f"{vol['id']}: {vol['name']} ({vol['size']} GB, {vol['dataCenterId']})",
'value':vol['id']}
network_volumes = list(map(print_net_vol,network_volumes))
questions = [
{
'type': 'rawlist',
'name': 'volume-id',
'qmark': '',
'amark': '',
'message': ' > Select a Network Volume:',
'choices': network_volumes
}
]
runpod_volume_id = prompt(questions)['volume-id']
runpod_volume_id = ''
if len(network_volumes) == 0:
runpod_volume_id = click.prompt(
" > Create a network volume (https://runpod.io/console/user/storage), then paste its id here", type=str)
else:
def print_net_vol(vol):
return {'name':f"{vol['id']}: {vol['name']} ({vol['size']} GB, {vol['dataCenterId']})",
'value':vol['id']}
network_volumes = list(map(print_net_vol,network_volumes))
questions = [
{
'type': 'rawlist',
'name': 'volume-id',
'qmark': '',
'amark': '',
'message': ' > Select a Network Volume:',
'choices': network_volumes
}
]
runpod_volume_id = prompt(questions)['volume-id']

python_version = click.prompt(
" > Select a Python version, or press enter to use the default",
Expand Down

0 comments on commit 91eae84

Please sign in to comment.