FASTAPI app not working with GCP APP engine - python

I am trying to deploy a fastAPI app with python 7 to the GCP app engine. After configuring the app.yaml file app is working fine with dev_server while using the command dev_server app.yaml. But after deploying the app using gcloud app deploy and followed by gcloud app browser I am getting an access URL.
After hitting the URL I am facing an error as below
Note - I am using a quick lab for learning the deployment. And things are working fine with flask app but not working with the FastApi app.

Since you already used the devapp_server command in order to test your application and it works, as a suggestion in order to check why you are facing this issue, you can try to see your App’s logs in the Developer Console from GCP.
Also, can be checked with the Logs Viewer and the console using the command line:
gcloud app logs tail
Check this documentation for further information about writing and viewing logs from your app.
Moreover I could find a tutorial about Deploying FastAPI in AppEngine. Maybe it could help you to develop it through this way also.

Related

Heroku deployment of Flask NLP Application

I deployed a Flask application on Heroku, I was able to deploy it via GitHub, however, when I am trying to run the app (Sentiment Analysis) I am getting an error, see the log:
I do not know how to add this command to the repository, should it be added to requeriments.txt or directly to the app.py - I am quite confused about how to fix this.
GitHub repository with the code: https://github.com/JaroslavKotrba/AppPredictionSentiment
Link to the app: https://apppredictionsentiment.herokuapp.com/

How to deploy a flask application on Azure?

I am working on a Flask application and I need to deploy it on Azure.
I am totally new to Azure and I have built a project using Python Flask and HTML. In the application, I have one main Flask app and two HTML pages. I need to deploy the whole project to an Azure app service.
Can anyone please let me know how to do it on Windows?
Thanks.
As PGHE said, at present, Python is supported on Azure App Service for Linux.
You can refer to this article about Deploy Python apps to Azure App Service on Linux from Visual Studio Code.
If you still want to publish python application to azure webapp on windows you can refer to this article while the features about publishing to Azure App Service on Windows are deprecated but continue to work.

How to run python app on server through browser

I just started using PYTHON and now i want to run a google vision cloud app on the server but I'm not sure how to start.
I do have a server up and running at http://18.217.137.107 and the app source code looks like https://cloud.google.com/vision/docs/detecting-landmarks#vision-landmark-detection-python.
Any help would be greatly appreciated.
What you need is a webapp built on some framework like django/flask. You can find a basic app example in the following link:
Create a basic GCP app using Flask
Please refer to this documentation about deploying Python application using Cloud Storage to App Engine Flex. Also, you might find this documentation to make an HTTP Request to Google Cloud Vision API useful, but this is based on Java and not Python.

Am I using Python Flasks built in server?

I am building a back end in python via the python flask application from IBM Cloud/Bluemix. I have heard/read a lot about people complaining regarding that Flasks built in server isn’t good for production. But how do I know if the application uses the Flask built in server or if IBM sets something else? Is there a simple way to see this in the code?
Deploying the Flask boilerplate app from the IBM cloud catalogue will indeed deploy a Flask application running on the Flask dev webserver.
You will need to alter the application if you want to run a production WSGI server.
I work for IBM and am in this stuff all day every day.
If you want to verify this, SSH into your application container on Cloud Foundry with the bash command
cf ssh <yourappnamehere>
You will need to have either the bluemix or cloud foundry CLIs installed and be logged in to the relevant endpoint before submitting this command.
It will open a bash shell in your application container, and you can cd around and open and/or download your project files for inspection.
This line:
app = Flask(__name__)
is a sure fire way to know that you are running a Flask web server application.
If you are concerned with which WSGI server your application is running under, checking your procfile (you should see this when SSHing int your container) will show you which command starts your application. If the command is
python <yourapp>.py
then you are running the dev server. Otherwise, you would be running some other python file, most likely via the server's command rather than the python command, that would import your application as a dependency.
You can also take a look at whether or not any WSGI server libraries were downloaded during the compilation of your droplet, and what command was used to start your application with
cf logs <yourappname> --recent
after deploying it.
Or, you can just believe me that the boilerplate deploys a Flask app under a Flask dev server.
A tutorial on running Flask on a different WSGI server:
https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-14-04

Not able to deploy my website on google App Engine

I have made a website which is working on localhost.
But I am unable to deploy it on the server with google app engine. I don't use Eclipse. In google app Engine there is a tab for deploy on top. But when I press that deploy nothing happens.
When I go to the webpage of the server it shows server not found.
I also tried to deploy with command line argument
appcfg.py -A simplegraph-007 update app.yaml
But it just one the appcfg.py file and my website is not deployed.

Categories