Practical Assignment 2 Cloud Computing
Title: Installation and configure Google App Engine.
Objectives:
● To learn basic of Google App Engine.
● To install and configure Google App Engine.
Hardware Requirements :
● Pentium IV with latest configuration
Software Requirements :
● Ubuntu 20.04, Web application i.e. Google App Engine
Theory:
A scalable runtime environment, Google App Engine is mostly used to run Web applications. These
dynamic scales as demand change over time because of Google’s vast computing infrastructure.
Because it offers a secure execution environment in addition to a number of services, App Engine
makes it easier to develop scalable and high-performance Web apps. Google’s applications will scale up
and down in response to shifting demand. Croon tasks, communications, scalable data stores, work
queues, and in-memory caching are some of these services.
The App Engine SDK facilitates the testing and professionalization of applications by emulating the
production runtime environment and allowing developers to design and test applications on their own
PCs. When an application is finished being produced, developers can quickly migrate it to App Engine,
put in place quotas to control the cost that is generated, and make the programmer available to
everyone. Python, Java, and Go are among the languages that are currently supported.
The development and hosting platform Google App Engine, which powers anything from web
programming for huge enterprises to mobile apps, uses the same infrastructure as Google’s large-scale
internet services. It is a fully managed PaaS (platform as a service) cloud computing platform that uses
in-built services to run your apps. You can start creating almost immediately after receiving the
software development kit (SDK). You may immediately access the Google app developer’s manual
once you’ve chosen the language you wish to use to build your app.
After creating a Cloud account, you may Start Building your App
● Using the Go template/HTML package
● Python-based webapp2 with Jinja2
● PHP and Cloud SQL
● using Java’s Maven
Features of App Engine
Runtimes and Languages
To create an application for an app engine, you can use Go, Java, PHP, or Python. You can develop and
test an app locally using the SDK’s deployment toolkit. Each language’s SDK and nun time are unique.
Your program is run in a:
● Java Run Time Environment version 7
● Python Run Time environment version 2.7
● PHP runtime’s PHP 5.4 environment
● Go runtime 1.2 environment
Generally Usable Features
These are protected by the service-level agreement and depreciation policy of the app engine. The
implementation of such a feature is often stable, and any changes made to it are backward-compatible.
These include communications, process management, computing, data storage, retrieval, and search, as
well as app configuration and management. Features like the HRD migration tool, Google Cloud SQL,
logs, datastore, dedicated Memcached, blob store, Memcached, and search are included in the
categories of data storage, retrieval, and search.
Features in Preview
In a later iteration of the app engine, these functions will undoubtedly be made broadly accessible.
However, because they are in the preview, their implementation may change in ways that are
backward-incompatible. Sockets, MapReduce, and the Google Cloud Storage Client Library are a few
of them.
Experimental Features
These might or might not be made broadly accessible in the next app engine updates. They might be
changed in ways that are irreconcilable with the past. The “trusted tester” features, however, are only
accessible to a limited user base and require registration in order to utilize them. The experimental
features include Prospective Search, Page Speed, OpenID, Restore/Backup/Datastore Admin, Task
Queue Tagging, MapReduce, and Task Queue REST API. App metrics analytics, datastore
admin/backup/restore, task queue tagging, MapReduce, task queue REST API, OAuth, prospective
search, OpenID, and Page Speed are some of the experimental features.
Third-Party Services
As Google provides documentation and helper libraries to expand the capabilities of the app engine
platform, your app can perform tasks that are not built into the core product you are familiar with as
app engine. To do this, Google collaborates with other organizations. Along with the helper libraries,
the partners frequently provide exclusive deals to app engine users.
Advantages of Google App Engine
The Google App Engine has a lot of benefits that can help you advance your app ideas. This comprises:
1. Infrastructure for Security: The Internet infrastructure that Google uses is arguably the safest
in the entire world. Since the application data and code are hosted on extremely secure servers, there
has rarely been any kind of illegal access to date.
2. Faster Time to Market: For every organization, getting a product or service to market quickly
is crucial. When it comes to quickly releasing the product, encouraging the development and
maintenance of an app is essential. A firm can grow swiftly with Google Cloud App Engine’s
assistance.
3. Quick to Start: You don’t need to spend a lot of time prototyping or deploying the app to users
because there is no hardware or product to buy and maintain.
4. Easy to Use: The tools that you need to create, test, launch, and update the applications are
included in Google App Engine (GAE).
5. Rich set of APIs & Services: A number of built-in APIs and services in Google App Engine
enable developers to create strong, feature-rich apps.
6. Scalability: This is one of the deciding variables for the success of any software. When using
the Google app engine to construct apps, you may access technologies like GFS, Big Table, and others
that Google uses to build its own apps.
7. Performance and Reliability: Among international brands, Google ranks among the top ones.
Therefore, you must bear that in mind while talking about performance and reliability.
8. Cost Savings: To administer your servers, you don’t need to employ engineers or even do it
yourself. The money you save might be put toward developing other areas of your company.
9. Platform Independence: Since the app engine platform only has a few dependencies, you can
easily relocate all of your data to another environment.
STEPS TO INSTALL & CONFIGURE :
Before begin
1. Create a Google Cloud Platform project, if you don't have one already.
2. Make sure that Python 2.7 is installed on your system: python -V
Note: As of Cloud SDK version 206.0.0, the gcloud CLI has experimental support for running using
a Python 3.4+ interpreter (run gcloud topic startup for exclusions and more information on
configuring your Python interpreter). All other Cloud SDK tools still requires Python 2.7 interpreter.
3. Download the archive file best suited to your operating system. Most machines will run the 64-bit
package. If you'd like to check, run uname -m to verify if you're running a 64-bit system.
Platform Package Size SHA256 Checksum Linux
For 64-bit
google-cloud-sdk25.6 b1c87fc9451598a76cf66978dd8aa06482bfced639b56cf31559dc2c7f8b7b90
229.0.0-linuxMB
For 32-bit
google-cloud-sdk25.2 ee8c45f8018d0fee92b07c32cc6d8c891241da0b88bfe289d4e58e6746c3f668
229.0.0-linuxMB
(x86) x86.tar.gz
Alternatively, to download the Linux 64-bit archive file from your command-line, run:
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloudsdk-
229.0.0-linux-x86_64.tar.gz
For the 32-bit archive file, run:
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloudsdk-
229.0.0-linux-x86.tar.gz
4. Extract the archive to any location on your file system; preferably, your Home folder. On Linux,
you can extract the archive file by running this command:
tar zxvf [ARCHIVE_FILE] google-cloud-sdk
5. If you're having trouble getting the gcloud command to work, ensure your $PATH is defined
appropriately. Use the install script to add Cloud SDK tools to your path. You will also be able to
opt-in to command-completion for your bash shell and usage statistics collection during the
installation process. Run the script using this command:
./google-cloud-sdk/install.sh
Restart your terminal for the changes to take effect.
Alternatively, you can call Cloud SDK after extracting the downloaded archive by invoking its
executables via the full path.
Initialize the SDK
Use the gcloud init command to perform several common SDK setup tasks. These include
authorizing the SDK tools to access Google Cloud Platform using your user account credentials and
setting up the default SDK configuration.
To initialize the SDK:
1. Run the following at a command
prompt: gcloud init
Note: To prevent the command from launching a web browser, use gcloud init – console-
only instead. To authorize without a web browser and non-interactively, create a service account
with the appropriate scopes using the Google Cloud Platform Console and use gcloud auth
activate-service-account with the corresponding JSON key file.
2. Accept the option to log in using your Google user account:
To continue, you must log in. Would you like to log in (Y/n)? Y
3. In your browser, log in to your Google user account when prompted and click Allow to
grant permission to access Google Cloud Platform resources.
4. At the command prompt, select a Cloud Platform project from the list of those where
you have Owner, Editor or Viewer permissions:
Pick cloud project to use:
[1] [my-project-1]
[2] [my-project-2]
...
Please enter your numeric choice:
If you only have one project, gcloud init selects it for you.
5. If you have the Google Compute Engine API enabled, gcloud init allows you to
choose adefault Compute Engine zone:
Which compute zone would you like to use as project default?
[1] [asia-east1-a]
[2] [asia-east1-b]
...
[14] Do not use default zone
Please enter your numeric
choice:
gcloud init confirms that you have complete the setup steps successfully:gcloud
has now been configured!
You can use [gcloud config] to change more gcloud settings.
Your active configuration is: [default]
Run core gcloud commands
Run these gcloud commands to view information about your SDK installation:
1. To list accounts whose credentials are stored on the local
system:gcloud auth list
gcloud displays a list of credentialed accounts:
Credentialed
Accounts ACTIVE
ACCO
UNT
*
[email protected] [email protected]2. To list the properties in your active SDK configuration:
gcloud config list
gcloud displays the list of properties:
[core]
account =
[email protected]disable_usage_reporting = False
project = example-project
3. To view information about your Cloud SDK installation and the active SDK
configuration: gcloud info
gcloud displays a summary of information about your Cloud SDK installation. This includes
information about your system, the installed SDK components, the active user account and current
project, and the properties in the active SDK configuration.
4. To view information about gcloud commands and other topics from the command
line: gcloud help
For example, to view the help for gcloud compute instances create:
gcloud help compute instances create
gcloud displays a help topic that contains a description of the command, a list of
commandflags and arguments, and examples of how to use it.
How to Run Program:
Now as we have finished installing app engine, now it’s time to create and upload an app. In
this case we will be taking example of a “HELLO WORLD” app in python.
1. As we already have made sure that we have python installed in our system, It will be easier
for us to clone existing code and deploy it rather than creating our own so we will use python
docs- sample. Run the command “git clone https://github.com/GoogleCloudPlatform/pythondocs-
samples”.
2. cd python docs- samples/appengine/standard/hello_world
3. dev_appserver.py app.yaml
It will run and give you the url of default and admin. If you go to the link of default
you see the text hello world like this.
Output :
OR
Google App Engine, Installing it the right way in ubuntu.
1. Make sure you have python installed in your ubuntu system. run
the command “python -V” and most probably you will get
“Python 2.7.6” or above.
2. Crul https://sdk.cloud.google.com and use bash to run the
commands by typing this command curl
https://sdk.cloud.google.com | bash
3. Whenever you get to choose directories just hit enter, “YEAH IT WILL BE FINE”.
4. Follow the instructions in the installation process.
5. Then run gcloud init
6. Follow the installation instructions as they are very straight forward.
7. Choose the account you want to use for google app engine.
8. Choose the project with numeric choice (don’t use textual, you might make mistake). If you do
not already have a google app engine project create a app engine project by following this link.
https://console.cloud.google.com/start
9. Enable google api by pressing Y in the command line prompt.
Now as we have finished installing appengine, now it’s time to create and upload an app. In
this case we will be taking example of a “HELLO WORLD” app in python.
1. As we already have made sure that we have python installed in our system, It will be easier for us
to clone existing code and deploy it rather than creating our own so we will use pythondocs-sample.
Run the command “gitclone https://github.com/GoogleCloudPlatform/python-docssamples”.
2. cd to hello world sample by typing the command “ cd
pythondocs-samples/appengine/standard/hello_world”.
3. Then run the command “dev_appserver.py app.yml”. It will run and give you the url of default
and admin. If you go to the link of default you see the text hello world like this.
This is how you run the python app in your local server. But what we have to do is hosting the
app in google app engine. To do so Now let’s follow the following instructions.
1. Run the command Ctrl + C .
2. Being in the same working directory hello-world runt the command
gcloud app deploy
3. Select the project you want to deploy the app , press Y and enter to continue. after that you will
get the console output “Deployed service[default] to [Your web url for appengine] ”
4. If you copy and paste the url, you will see the hello world in the browser too.
Conclusion : Thus, We have installed and Configured Google App Engine.