-
Notifications
You must be signed in to change notification settings - Fork 77
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
Warn when using secrets without --trusted
#719
Warn when using secrets without --trusted
#719
Conversation
BT-8704 Add warning when using secrets without trusted
The
Some additional contextWhat is the --trusted flag?When deploying a model with Baseten, there's often a need to have secrets. Check out the baseten guide on how to use Secrets: https://docs.baseten.co/observability/secrets https://truss.baseten.co/guides/secrets Code PointersThe change to make here is in the Truss CLI (See Repo: https://github.com/basetenlabs/truss). This file is the entrypoint to the CLI: https://github.com/basetenlabs/truss/blob/main/truss/cli/cli.py how to print a warning: https://github.com/basetenlabs/truss/pull/717/files The easiest path to developing in this repo is to use Github Codespaces. |
truss/cli/cli.py
Outdated
not_trusted_text = """ | ||
Warning: your Truss has secrets but was not pushed with --trusted. | ||
Please push with --trusted to grant access to secrets. | ||
""" | ||
click.echo(not_trusted_text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback on messaging, formatting, etc. welcome!
I could also stack this PR on top of #717 and use console.print(not_trusted_text, style=yellow)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just merged #717, so you can merge master and use the colors
One other thought here, how does this look if we put it after the "Model was successfully pushed" copy? I worry that it gets lost if it's above the big block of development model text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I think both changes help!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, awesome work @helenlyang! one small note, from the screenshot, the yellow might be a little subtle, it might be better as red.
another non-blocking this is that it might be good to pull the check into a config_warnings
function that we could add more warnings too, but I think it's ok to run without that
Thanks @squidarth! Made the readability changes and updated the screenshot. I added a TODO for the |
agreed |
Summary
This updates the CLI to print a warning if a Truss has secrets defined in its config but is pushed without
--trusted
.Testing
truss push
Commands below were for pushing a Truss with a dummy secret in
config.yaml
:Without
--trusted
:poetry run truss push
With
--trusted
:poetry run truss push --trusted
Output: