AIforEarth-API-Development
AIforEarth-API-Development copied to clipboard
Feature Request: Add tips for quicker interactive app development
Hello, I'm making some updates to my application and am wondering if there are some suggestions that could be made for:
- hot reloading the application if a python file is changed
I need to run
docker build -t pytorchapp-prod -f ./Dockerfile-prod .and thendocker run -it -p 8081:80 --runtime=nvidia pytorchapp-prodto 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.
- (less important) sending logs from
log = AI4EAppInsightsto the terminal during development so that messages from calls tolog.log_debugare 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 withprintso that I can see them in the terminal logs to debug my app.