Deploying a Flask Application on App Engine.

Google Cloud Platform is a suite of public services offered by Google. The platform includes a range of hosted services for compute, storage and application development that run on Google hardware.

App Engine is a compute service lets customers focus on their applications, leaving most infrastructure and provisioning to Google, while still offering various choices of runtime.

To avoid losing/outspending your coupon/free credits: • It’s critical for you to request your coupon using your “utexas.edu” or “cs.utexas.edu” email. • After receiving your coupon and before redeeming it in GCP, you **must** logout all email accounts and login to your “gmail” account”. Otherwise, your coupon will be lost and you won’t be able to get the free credits back. • It is your responsibility to not outspend the free credits. To do so, after deploying your website on AppEngine, it’s critical to go to “Settings” > “Disable” application when you're not actually running the test/experiment. App Engine Flex has NO free tier. You also need to stop any database instances when you're not using them.

Deploying your flask application on App Engine of (GCP).

1. The following link leads you to a page within GCP that allows you to add in coupons to get more balance within your GCP account as the longer you host your site; the more money it will require. https://console.cloud.google.com/education

2. Login to GCP console using a gmail account to create a project: https://console.cloud.google.com/

3. The following link has a quick tutorial on how to start up a sample project to understand the basics of hosting applications on GCP using programs in python.

https://cloud.google.com/appengine/docs/flexible/python

4. Before you start, you will have to create a project on App Engine (make sure you’re logging in using your gmail account). i. Go to the top left of the GCP console, select “Navigation Menu” and from that menu select “App Engine”.

ii. Next, you need to create a new project. But, since you are a new user, you may receive the following message “My first project”. You just need to give it a name, in my case I used “cs373-idb”.

Note: In my case, I have already created the project. So, on my screen, next to the “Navigation Menu”, I see a drop down menu that has my project.

iii. If you want to create another project, you need to click on the drop down menu. Then, you may see a screen as follows. Select “NEW PROJECT”

iv. Type in the project name and hit create

. v. To check that you project was successfully created, hit the drop down menu (next to Navigate Menu at the top left of the console) and you’ll see your project.

vi. You may need to enable billing for your project.  Go to the ‘Google Cloud Platform’ Console.  From the projects list, select the project to re-enable billing for.  Open the console left side menu and select Billing .  Click Link a billing account.  Select a billing account, then click Set account.

5. In order to successfully deploy your website, the folder where your files are located should also have a app.yaml (It is similar to the .gitlab-ci.yml). Clone my example application from GitLab (https://gitlab.com/fareszf/cs373-idb- gcp.git) in the GCP Shell  Click on Google Cloud Shell, ->, on the top-right corner of the GCP console.  While inside the shell, clone your repo that has the application files.

$ git clone https://gitlab.com/fareszf/cs373-idb-gcp.git $ cd cs373-idb-gcp

Note: Alternatively, you can download the cloud SDK, a set of command-line tools for developing with Google Cloud, to access AppEngine other Google Cloud services directly from the command line on your personal machine.

6. To test your application, type in the following command. $ gcloud app deploy You might be asked to enter a choice number that represents your time zone. It might be “12” for US central. Then you might be also asked whether you want to continue. Type in “Y” to continue.

7. If the application is successfully deployed, you will see by the end of the output a link where you can navigate to your application. e.g., Deployed service [default] to [https://cs373-idb- 278822.uc.r..appspot.com]