microsoft / AIforEarth-API-Development

This is an API Framework for AI models to be hosted locally or on the AI for Earth API Platform (https://github.com/microsoft/AIforEarth-API-Platform).
MIT License
74 stars 46 forks source link

Feature Request: Add tips for quicker interactive app development #78

Open rbavery opened 3 years ago

rbavery commented 3 years ago

Hello, I'm making some updates to my application and am wondering if there are some suggestions that could be made for:

1) hot reloading the application if a python file is changed I need to run docker build -t pytorchapp-prod -f ./Dockerfile-prod . and then docker run -it -p 8081:80 --runtime=nvidia pytorchapp-prod to reload any changes I've made to my app. This isn't so bad but can get a bit cumbersome.

I tried to mount the app folder in my host machine to the docker container with --mount type=bind,source="$(pwd)/pytorch_api",target=/app/pytorch_api and then add py-autoreload=3 in supervisord.conf to monitor for changes to application files (which I make in vscode on my host machine). However this doesn't seem to work and either the files aren't being monitored for changes or the changes are not being propagated to the application.

2) (less important) sending logs from log = AI4EAppInsights to the terminal during development so that messages from calls to log.log_debug are visible. It'd be nice to do local development with the same logging statements that interface with the AppInsights service for easier portability. Right now I'm replacing all these logging statements with print so that I can see them in the terminal logs to debug my app.