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

Allow for uvicorn reload option for development workflow #832

Open
edbarnard opened this issue Dec 17, 2024 · 2 comments
Open

Allow for uvicorn reload option for development workflow #832

edbarnard opened this issue Dec 17, 2024 · 2 comments

Comments

@edbarnard
Copy link
Contributor

It would be nice to run the server in reload mode for debugging. It is possible to do this with FastAPI and uvicorn with the uvicorn --reload option. It is possible to send uvicorn this option via the config.yml as follows:

uvicorn:
  reload: true

However, tiled serve is not setup correctly to allow for this to work. Here is the error returned when uvicorn:reload:true:

[-] WARNING:  You must pass the application as an import string to enable 'reload' or 'workers'.
@edbarnard
Copy link
Contributor Author

Looking at the tiled.commandline._serve file, this may be more complex to change, due to the creation of the custom web_app object being dynamically generated with build_app rather than a direct import

@danielballan
Copy link
Member

Actually, this can work. You have to use a config file, as there is no way to route CLI args to tiled (they go to uvicorn):

TILED_CONFIG=... uvicorn tiled.server.app:app

The app object uses module __getattr__ to dynamically build an app instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants