Test applications for Google Cloud and Azure locally - python

Is there any way to test applications for Google Cloud or Azure locally in a computer, similar to the Localstack Docker image for AWS?
Thank you!

To test you application locally you can use Google App Engine Local Devolopment server to simulate your app running on app engine externally.
Demo python application via app engine
As you mentioned docker you may want to test your images locally you can also do this by following these instructions.

You can see this post. Here are some useful links, you will find
https://www.testcontainers.org/modules/gcloud/

Related

How to deploy opencv application into google cloud VM

I want to deploy my OpenCV application into google cloud. This application is written in python and I need to deploy it into Google Cloud server. It could be run on any os(MAC, Windows, Linux, etc.)
How can I solve this problem?
There are many options to deploy an application on Google Cloud.
If you developed your application using Python 3.7 or 3.8 you could explore the use of App Engine Standard or Cloud Functions, but in order to have more flexibility and if you used any other versions of Python take a look at Cloud Run or App Engine Flexible.
If you are not interested in the serverless aspect of Cloud Computing you could simply deploy your application in a Compute Engine Instance.

Python Flask as a Cloud Foundry app vs as a container

I'm new to IBM Cloud and cloud platforms in general and wanted to start my Flask app on IBM Cloud, I just started with this Getting started with Python but I'm very confused with how it will work.
Is Cloud Foundry working the same way as containers work?
How the platform handle the dependencies in order to Flask use them in both deployment ways?
Your question is (almost) too broad. I can give you some basic answers, but everything else should be separate questions when you run into specific problems. You are referring to the Getting Started with Python and Cloud Foundry on IBM Cloud (this is the IBM Cloud docs, not the GitHub repo).
When working with Cloud Foundry (CF), the CF environment and buildpack takes care of the dependencies. For Python, they are specified in the file requirements.txt and there is the file manifest.yml to configure the app, its name, memory usage, domain and more. When you push the app (either cf push or ibmcloud cf push) the two files are taken into account and everything else is done automatically. That's the appeal of Cloud Foundry.
With containers, you would write a Dockerfile, then build the container image, push the image to a container registry, deploy the container to Kubernetes. When you build the container, your script would need to take care of resolving the dependencies (based on requirements.txt) and include the necessary modules into the image.
I recommend reading the Deploy an Application Cloud Foundry doc as a starter to give some more background. There is also a simple IBM Cloud solution tutorial that walks you through the steps of deploying a Flask app with a Db2 database. That same site with IBM Cloud solution tutorials also has an overview of tutorials by deployment option (Cloud Foundry, Kubernetes, Cloud Functions, etc.).

Deploy django application on Microsoft Azure or Amazon Elastic Besanstalk

I'm deploying a django (python) application. I wondered what is the best way to deploy it. With microsoft azure or Amazon Elastic Beanstalk ?
The application just needs to view data from a database. What are (dis)advantages of azure or elastic beanstalk?
I'm using OSX 10.9.5 and Python 3.4.3
As Gaurav Mantri said, you need to provide more details - atleast the OS you are using. Some more surfing could lead you here :
What's the recommended way to deploy a Django app on IIS?
For web apps, Azure has Azure App Service. Deployment can be done through a variety of ways, including FTP, git, or from Visual Studio. Since you're using Mac, I would recommend deploying via git.
To do so, first create a web app in the Azure portal, and then follow the steps here:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
The advantages of Azure App Service, is that you can easily scale your app to many machines, and everything is taken care for you. Note that depending on how you've configured your database, you would have to deploy that separately.
Also, if you want to test Azure App Service, you can easily create a small sample Django application, using the Azure gallery. See the screen shot below.
Azure Web Apps provide a volume of ways for deployment your web applications. We can leverage tools/IDEs including FTP tools , Visual Studio and WebMatrix on Windows for remoting and modifying your web site code, and leverage repository for continuous deployment including local GIT, GITHUB, Visual Studio Online, Dropbox, Bitbucket.
It depends which way you prefer to.
As # theadriangreen mentioned, Azure Web Apps provide Django template for a quick start, you can simply create a Django application and pull the code to local leveraging the methods above.
Beside Continuous deployment using GIT in Azure App Service, you also can refer to Creating web apps with Django in Azure for more information.

Can one source code be deployed to Openshift, Heroku and Google App Engine at once?

As subject, is is possible with just one source code, we can deploy our code to Openshift or Google App Engine? Heroku is not necessarily in my case.
My application is using Python Flask + PostgreSQL 9.1. I love the easiness in Openshift when I configure my technology stack, but is the case will be same with GAE?
Thanks!
I work on Openshift and at this time I'm not aware of anything that will deploy your code to GAE and Openshift at the same time.
You might be able to write your own script for it.
PostgreSQL is not available on GAE, so this code will definitely not run there.

Move from google app engine to virtual machine

I had as an assignement to create a website. I did it on google app engine. I use jinja2 and google database.
Now, my proffesor ask to move it from google app engine to a virtual machine. Probably, I have to rewrite the part of google database with a mySQL for example.
How exactly I setup the libraries, files and templates in the virtual machine? Do you know any tutorial?
The simplest method would be to install the AppEngine SDK on the virtual machine and run your AppEngine app on the local dev server. See:
https://developers.google.com/appengine/docs/python/tools/devserver
I had success with the TyphoonAE image and ran it on VMware
https://code.google.com/p/typhoonae/
Worked with the mongoDB out of the box.

Categories

Resources