-
Notifications
You must be signed in to change notification settings - Fork 881
hide clusters from dashboard when API server SKYPILOT_DEBUG is set #8339
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -149,6 +149,17 @@ class RequestBody(BasePayload): | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, **data): | ||||||||||||||||||||||||||||||||||||||||||||||||
| data['env_vars'] = data.get('env_vars', request_body_env_vars()) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if data.get('from_dashboard', False): | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Limit the env vars to avoid leaking other API server env vars like | ||||||||||||||||||||||||||||||||||||||||||||||||
| # SKYPILOT_DEBUG to the request. | ||||||||||||||||||||||||||||||||||||||||||||||||
| data['env_vars'] = { | ||||||||||||||||||||||||||||||||||||||||||||||||
| constants.USER_ID_ENV_VAR: data['env_vars'] | ||||||||||||||||||||||||||||||||||||||||||||||||
| [constants.USER_ID_ENV_VAR], | ||||||||||||||||||||||||||||||||||||||||||||||||
| constants.USER_ENV_VAR: data['env_vars'] | ||||||||||||||||||||||||||||||||||||||||||||||||
| [constants.USER_ENV_VAR], | ||||||||||||||||||||||||||||||||||||||||||||||||
| usage_constants.USAGE_RUN_ID_ENV_VAR: data['env_vars'][ | ||||||||||||||||||||||||||||||||||||||||||||||||
| usage_constants.USAGE_RUN_ID_ENV_VAR], | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+152
to
+162
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current implementation for filtering To make this more robust, it's safer to avoid assumptions about the structure of
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| usage_lib_entrypoint = usage_lib.messages.usage.entrypoint | ||||||||||||||||||||||||||||||||||||||||||||||||
| if usage_lib_entrypoint is None: | ||||||||||||||||||||||||||||||||||||||||||||||||
| usage_lib_entrypoint = '' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
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.
IIUC, the js client will not set
env_varsin json body so it get populated with the server's env var in https://github.com/skypilot-org/skypilot/pull/8339/changes#diff-5ca880f8b68852cc1918d53ec44bc5741ee58013ed94ab3ed71266c5af1f916bL151The dashboard does have no way to access ordinary env vars, but I think we may reuse the env_vars field in dashboard request to reflect client infos like USAGE_RUN_ID. Initiate a request to include a no-op env var (SKYPILOT_IS_FROM_DASHBOARD: true) might be a good beginning I think