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

added remote_base_domain as an optional param #975

Closed
wants to merge 0 commits into from

Conversation

anupreet
Copy link

🚀 What

Added a way to set a domain for predict calls for Baseten.
If remote_base_domain is set in the truss.rc then it adds this to the predict url before making the inference request

💻 How

Added a way to configure the remote_base_domain through cli and through truss.rc

🔬 Testing

Tested it locally!
Screenshot 2024-06-13 at 2 35 43 PM

@anupreet anupreet requested a review from squidarth June 13, 2024 22:27
@anupreet anupreet changed the title added base_domain as an optional param added remote_base_domain as an optional param Jun 13, 2024
truss/cli/cli.py Outdated
@@ -226,6 +226,12 @@ def run(target_directory: str, build_dir: Path, tag, port, attach) -> None:
required=False,
help="Name of the remote in .trussrc to patch changes to",
)
@click.option(
Copy link
Author

@anupreet anupreet Jun 13, 2024

Choose a reason for hiding this comment

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

[Revert this file]

@@ -24,11 +24,19 @@
remote_provider=test_remote
"""

SAMPLE_TRUSSRC_WITH_REMOTE_BASE_DOMAIN = """
[test]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is missing

remote_provider = baseten

truss/cli/cli.py Outdated
@@ -464,6 +470,12 @@ def _extract_request_data(data: Optional[str], file: Optional[Path]):
required=False,
help="Name of the remote in .trussrc to push to",
)
@click.option(
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need these extra CLI commands. The base domain will automatically get pulled out from remote.

truss/cli/cli.py Outdated
@@ -510,6 +522,7 @@ def _extract_request_data(data: Optional[str], file: Optional[Path]):
def predict(
target_directory: str,
remote: str,
remote_base_domain: str,
Copy link
Collaborator

Choose a reason for hiding this comment

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

covert by your revert comment, but this won't be needed.

self,
remote_url: str,
api_key: str,
remote_base_domain: Optional[str] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should rename this to invocation_domain. remote_base seems indistinguishable from the remote_url so it's somewhat confusing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed that remote and remote_base_domain are too similar, one nit would be to have this be predict_domain just to be consistent w/ the name of the endpoint

Copy link
Author

Choose a reason for hiding this comment

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

yeah.. I think "base domain" covers the "xyz.com" may be remote_inference_base_domain might be more accurate...

url = _add_model_domain(
self._api.rest_api_url, f"model-{self.model_id}", self.remote_base_domain
)
print(url)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: drop print

@anupreet anupreet force-pushed the aw-add-domain-truss branch from befca55 to 4190940 Compare August 27, 2024 23:06
@anupreet anupreet closed this Aug 28, 2024
@anupreet anupreet force-pushed the aw-add-domain-truss branch from 4190940 to 7a7e4ab Compare August 28, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants