-
Notifications
You must be signed in to change notification settings - Fork 140
Let FastAPI perform pydantic validation of EverestConfig objects #14326
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: main
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 |
|---|---|---|
|
|
@@ -120,6 +120,7 @@ def start_experiment( | |
| retries: int = 5, | ||
| ) -> str: | ||
| url, cert, auth = server_context | ||
| last_error: str | None = None | ||
|
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. Why do we only want the last error message? Would it be better if we appended the messages?
Contributor
Author
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. I think they are very likely to be identical. All error message can be found in the logs if needed. |
||
| for retry in range(retries): | ||
| try: | ||
| start_endpoint = f"{url}/{EverEndpoints.START_EXPERIMENT}" | ||
|
|
@@ -132,10 +133,20 @@ def start_experiment( | |
| ) | ||
| response.raise_for_status() | ||
| return response.json()["experiment_id"] | ||
| except Exception: | ||
| except requests.HTTPError: | ||
| last_error = response.text | ||
| logger.debug(traceback.format_exc()) | ||
| if 400 <= response.status_code < 500: | ||
| break # 4xx should not trigger retries | ||
| time.sleep(retry) | ||
| except Exception: | ||
| last_error = traceback.format_exc() | ||
| logger.debug(last_error) | ||
| time.sleep(retry) | ||
| raise RuntimeError("Failed to start experiment") | ||
| message = "Failed to start experiment" | ||
| if last_error: | ||
| message += f": {last_error}" | ||
| raise RuntimeError(message) | ||
|
|
||
|
|
||
| def extract_errors_from_file(path: str) -> list[str]: | ||
|
|
||
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.
Should we folow the pattern of
authenticated = [Depends(verify_auth)]forDepends(_with_runtime_plugins)as well?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 am not sure it will add anything good, a little bit skeptical to the existing pattern of having a 1-member list for
authenticated- I guess it can make sense in case this list can grow. I don't think the list of dependencies for runtime_plugins can grow.