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

Enhanced deploy #220

Merged
merged 33 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8c97085
improve deploy logic - separate dev and prod part 1
DireLines Nov 10, 2023
6ed7f06
reversed branches
DireLines Nov 10, 2023
2b2a7f5
helpers needed for redeploy
DireLines Nov 10, 2023
4146d1e
bug fixes for redeploy
DireLines Nov 10, 2023
47a7c1e
Merge pull request #219 from DireLines/main
justinmerrell Nov 12, 2023
d88a8f1
fix: linting
justinmerrell Nov 12, 2023
63494e0
Update functions.py
justinmerrell Nov 12, 2023
d417e53
Update functions.py
justinmerrell Nov 12, 2023
7b5e714
Update functions.py
justinmerrell Nov 12, 2023
b6fdb38
Update functions.py
justinmerrell Nov 12, 2023
27ede5d
Update test_project_functions.py
justinmerrell Nov 12, 2023
a6d2be5
fix: listing and tests
justinmerrell Nov 12, 2023
5ab5944
fix: tests and linting
justinmerrell Nov 12, 2023
6210655
Update functions.py
justinmerrell Nov 12, 2023
f0ed7b7
Update test_project_functions.py
justinmerrell Nov 12, 2023
1459127
Update test_project_functions.py
justinmerrell Nov 12, 2023
72450b8
Update test_project_functions.py
justinmerrell Nov 12, 2023
76c2f67
Update test_project_functions.py
justinmerrell Nov 13, 2023
0e1a029
Update test_project_functions.py
justinmerrell Nov 13, 2023
a1de81e
fix: add missing tests
justinmerrell Nov 13, 2023
04faade
fix: missing coverage
justinmerrell Nov 13, 2023
c99e408
Update test_project_functions.py
justinmerrell Nov 13, 2023
ee663e2
fix: tests
justinmerrell Nov 13, 2023
703e952
Update test_project_functions.py
justinmerrell Nov 13, 2023
1f062e2
Update test_project_functions.py
justinmerrell Nov 13, 2023
045fef5
Update test_project_functions.py
justinmerrell Nov 13, 2023
20b8136
Update functions.py
justinmerrell Nov 13, 2023
7a95891
Update test_project_functions.py
justinmerrell Nov 13, 2023
f923183
Update test_project_functions.py
justinmerrell Nov 13, 2023
195852c
fix: tests
justinmerrell Nov 13, 2023
a73c21e
fix: tests
justinmerrell Nov 13, 2023
fc2f7bd
Update test_project_functions.py
justinmerrell Nov 13, 2023
70bdf37
Update test_project_functions.py
justinmerrell Nov 13, 2023
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
Prev Previous commit
Next Next commit
bug fixes for redeploy
  • Loading branch information
DireLines committed Nov 10, 2023
commit 4146d1ee3fb0dac3f73a89ffa50d8ce680da6e99
9 changes: 5 additions & 4 deletions runpod/api/mutations/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ def update_endpoint_template_mutation(

# ------------------------------ Required Fields ----------------------------- #
input_fields.append(f'templateId: "{template_id}"')
input_fields.append(f'id: "{endpoint_id}"')
input_fields.append(f'endpointId: "{endpoint_id}"')

# Format the input fields into a string
input_fields_string = ", ".join(input_fields)
return f"""
mutation UpdateEndpointTemplate($input: UpdateEndpointTemplateInput) {{
result = f"""
mutation {{
updateEndpointTemplate(input: {{{input_fields_string}}}) {{
id
templateId
}}
}}
"""
"""
return result
9 changes: 5 additions & 4 deletions runpod/cli/groups/project/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tomlkit
from tomlkit import document, comment, table, nl

from runpod import __version__, get_pod, create_template, create_endpoint, update_endpoint_template
from runpod import __version__, get_pod, create_template, create_endpoint, update_endpoint_template, get_endpoints
from runpod.cli import BASE_DOCKER_IMAGE, GPU_TYPES, ENV_VARS
from runpod.cli.utils.ssh_cmd import SSHConnection
from .helpers import get_project_pod, copy_template_files, attempt_pod_launch, load_project_config, get_project_endpoint
Expand Down Expand Up @@ -300,7 +300,8 @@ def create_project_endpoint():
"""
config = load_project_config()

project_pod_id = get_project_pod(config['project']['uuid'])
project_id = config['project']['uuid']
project_pod_id = get_project_pod(project_id)

# Check if the project pod already exists, if not create it.
if not project_pod_id:
Expand Down Expand Up @@ -348,7 +349,7 @@ def create_project_endpoint():
env=environment_variables, is_serverless=True
)

deployed_endpoint = get_project_endpoint(project_pod_id)
deployed_endpoint = get_project_endpoint(project_id)
if not deployed_endpoint:
deployed_endpoint = create_endpoint(
name=f'{config["project"]["name"]}-endpoint | {config["project"]["uuid"]}',
Expand All @@ -357,7 +358,7 @@ def create_project_endpoint():
)
else:
deployed_endpoint = update_endpoint_template(
id=deployed_endpoint['id'],
endpoint_id=deployed_endpoint['id'],
template_id=project_endpoint_template['id'],
)

Expand Down
2 changes: 1 addition & 1 deletion runpod/cli/groups/project/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_project_endpoint(project_id: str):
"""
for endpoint in get_endpoints():
if project_id in endpoint['name']:
return endpoint['id']
return endpoint

return None

Expand Down