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

Deprecate --trusted. #1264

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 7 additions & 10 deletions truss/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ def run_python(script, target_directory):
is_flag=True,
required=False,
default=False,
help="Trust truss with hosted secrets.",
help="[DEPRECATED]Trust truss with hosted secrets.",
)
@click.option(
"--disable-truss-download",
Expand Down Expand Up @@ -1134,15 +1134,12 @@ def push(
tr.spec.config.model_name = model_name
tr.spec.config.write_to_yaml_file(tr.spec.config_path, verbose=False)

# Log a warning if using secrets without --trusted.
# TODO(helen): this could be moved to a separate function that includes more
# config checks.
if tr.spec.config.secrets and not trusted:
not_trusted_text = (
"Warning: your Truss has secrets but was not pushed with --trusted. "
"Please push with --trusted to grant access to secrets."
# Log a warning if using --trusted.
if trusted:
trusted_deprecation_notice = (
"[DEPRECATED] `--trusted` option is deprecated and no longer needed"
)
console.print(not_trusted_text, style="red")
console.print(trusted_deprecation_notice, style="yellow")

# trt-llm engine builder checks
if uses_trt_llm_builder(tr):
Expand Down Expand Up @@ -1182,7 +1179,7 @@ def push(
tr,
model_name=model_name,
publish=publish,
trusted=trusted,
trusted=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be cleaner to strip this parameter/argument out of any functions / APIs and mace a change on the backend that hard-codes it to true.

promote=promote,
preserve_previous_prod_deployment=preserve_previous_production_deployment,
deployment_name=deployment_name,
Expand Down
1 change: 0 additions & 1 deletion truss/templates/shared/secrets_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def _secret_missing_error_message(key: str) -> str:
return f"""
Secret '{key}' not found. Please ensure that:
* Secret '{key}' is defined in the 'secrets' section of the Truss config file
* The model was pushed with the --trusted flag
* Secret '{key}' is defined in the secret manager
Read more about secrets here: {SECRETS_DOC_LINK}.
"""
3 changes: 1 addition & 2 deletions truss/tests/test_model_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ def predict(self, request):

config_with_no_secret = "model_name: secrets-truss"
missing_secret_error_message = """Secret 'secret' not found. Please ensure that:
* Secret 'secret' is defined in the 'secrets' section of the Truss config file
* The model was pushed with the --trusted flag"""
* Secret 'secret' is defined in the 'secrets' section of the Truss config file"""

with ensure_kill_all(), _temp_truss(inspect.getsource(Model), config) as tr:
LocalConfigHandler.set_secret("secret", "secret_value")
Expand Down