Open
Conversation
jl-wynen
reviewed
Mar 11, 2025
src/sciwyrm/main.py
Outdated
Comment on lines
+32
to
+37
| @app.get("/alive", response_description="The service is alive") | ||
| async def list_templates( | ||
| config: Annotated[AppConfig, Depends(app_config)] | ||
| ) -> bool: | ||
| """Return a list of available notebook templates.""" | ||
| return True |
Collaborator
There was a problem hiding this comment.
Suggested change
| @app.get("/alive", response_description="The service is alive") | |
| async def list_templates( | |
| config: Annotated[AppConfig, Depends(app_config)] | |
| ) -> bool: | |
| """Return a list of available notebook templates.""" | |
| return True | |
| @app.get("/alive", response_description="The service is alive") | |
| async def is_alive() -> bool: | |
| """Return True to indicate that the service is running.""" | |
| return True |
Contributor
There was a problem hiding this comment.
How about using the more conventional name live(z) and returning the string ok
src/sciwyrm/main.py
Outdated
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| uvicorn.run(app, host="0.0.0.0", port=8000) No newline at end of file |
Collaborator
There was a problem hiding this comment.
What is this good for? I don't like that it has a fixed address and port. Doesn't this just lead to conflicts?
Contributor
There was a problem hiding this comment.
It is the typical way to run it standalone in dev, but yes making the port configurable would be a nice addition
Collaborator
There was a problem hiding this comment.
Is it? Judging by the documentation, you are supposed to use uvicorn sciwyrm.main:app. Plus, this way, you can use uvicorn sciwyrm.main:app --reload which auto reloads the app when files are changed.
2ced623 to
4522331
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the
aliveendpoint which is useful when deploying with an orchestration tool like kubernetes and docker and renamed thenotebook/templatesto justtemplates