[go: up one dir, main page]

0% found this document useful (0 votes)
25 views70 pages

CC Lab

The document outlines assignments related to Google App Engine (GAE) and CloudSim, including installation, application creation, and running simulations. It covers the requirements, theory, directory structures, and steps for creating applications in GAE using Python, as well as simulating cloud scenarios with CloudSim and implementing scheduling algorithms. Additionally, it discusses virtualization concepts and procedures for transferring files between virtual machines.

Uploaded by

deget25201
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views70 pages

CC Lab

The document outlines assignments related to Google App Engine (GAE) and CloudSim, including installation, application creation, and running simulations. It covers the requirements, theory, directory structures, and steps for creating applications in GAE using Python, as well as simulating cloud scenarios with CloudSim and implementing scheduling algorithms. Additionally, it discusses virtualization concepts and procedures for transferring files between virtual machines.

Uploaded by

deget25201
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Assignment 1

Title

Install Google App Engine. Create hello world app and other simple web
applications using Python/Java.

Requirements

1. Google App Engine


2. Python Interpreter (Python2.7.x)
3. Text Editor
4. Browser

Theory

A) Google App Engine

1. Google App Engine (GAE) is a platform-as-a-service product that


provides web app developers and enterprises with access to
Google's scalable hosting and tier 1 internet service.
2. GAE requires that applications be written in Java or Python, store data in
Google Bigtable and use the Google query language.
3. Noncompliant applications require modification to use GAE.
4. GAE provides more infrastructure than other scalable hosting services,
such as Amazon Elastic Compute Cloud (EC2).
5. GAE also eliminates some system administration and development tasks
to make writing scalable applications easier.
6. Google provides GAE free up to a certain amount of use for resources
like CPU, storage, API calls and concurrent requests

B) Google Cloud SDK

1. Google Cloud SDK (Software Development Kit), in simple terms, is a set


of tools that are used to manage applications and resources that are
hosted on the Google Cloud Platform.
2. It is composed of the gsutil, gcloud, and bqcommand line tools.
3. The gcloudtool is automatically downloaded with the Cloud SDK.
4. Google Cloud SDK run on specific platforms – Windows, Linux, and
macOS and requires Python 2.7.x.
5. SDK might have further necessities like Java tools used for the
development of Google App Engine needs Java 1.7 or the later one.
6. It can be used to locally deploy and test web applications.

C) Directory Structure for creating hello world application


1. The web applications to be deployed can be organized in the following
directory structure

root_directory
|_______templates
| |______index.html
|_______static
|_______main.py
|_______app.yaml

2. The templates directory can be used to store the web templates of the
web application (HTML files).
3. The static directory can be used to store the web static files which
contain the styling and the business logic data for the web application
(CSS and JS files).
4. The main.py is used to define the routes, rendering logic, data
acquisition logic.
5. It provides the WSGI abstraction to the application.
6. The app.yaml file provides the runtime environment, URLs for routes
and launch configuration of the application in the form of key value
pairs.

Steps

A) Install Google Cloud SDK on Windows or Linux machines

1. Visit the https://cloud.google.com/sdk/docs/install link to download the


CLI (Command line interface) tool for the Cloud SDK.
2. Select the appropriate operating system from the installation manual
3. Follow the provided instructions in the displayed section
a) For Windows users, the executable downloader is provided for
downloading.
b) For Ubuntu and Fedora users, terminal commands for installation are
provided using apt and dnf repositories respectively.

B) Creating the application

1. The application must be initialized using the above-mentioned directory


structure.
2. It is a recommended format for organization and readability of code.
3. The app.yaml file should contain the following content:

Contents of app.yaml

runtime : python2
api_version : 1
threadsafe : true

handlers
- url : /
script : main.app

4. The logic of the application, i.e. the Web server interaction code of the
application must be placed in the main.py file.
5. A simple code displaying the hello world on a web page is as follows

Contents of main.py for Hello World application

import webapp2

class MainPage(webapp2.RequestHandler) :

def get(self):
self.response.write(“Hello World”)

app = webapp2.WSGIApplication(
[(“/”, MainPage)],
debug=True
)

6. Finally, after saving the above code, the application can be run on the
localhost server using the following command. (The command must be
run on the Google Cloud Shell or the terminal in case of Ubuntu).

Command:
python <path_to_sdk>/bin/devappserver.py
<path_to_application_directory>

Sample Output

1. The application, if no errors are found, is launched on the port 8080 of the
localhost server.
2. The cloud console is visible on port 8000 of the localhost server.
3. The URL of localhost:8080 can be typed in the address bar of the browser
to view the application

4. Screenshots:
a) Application launch at port 8080

b) Terminal / Command Line prompts


c) Cloud Console at port 8000
Assignment 2

Title

Use GAE launcher to launch the web applications.

Requirements

1. Google App Engine


2. Python Interpreter (Python2.7.x)
3. Browser

Theory

A) Google App Engine

7. Google App Engine (GAE) is a platform-as-a-service product that


provides web app developers and enterprises with access to
Google's scalable hosting and tier 1 internet service.
8. GAE requires that applications be written in Java or Python, store data in
Google Bigtable and use the Google query language.
9. Noncompliant applications require modification to use GAE.
10.GAE provides more infrastructure than other scalable hosting services,
such as Amazon Elastic Compute Cloud (EC2).
11.GAE also eliminates some system administration and development tasks
to make writing scalable applications easier.
12.Google provides GAE free up to a certain amount of use for resources
like CPU, storage, API calls and concurrent requests

B) Directory Structure for creating web application


7. The web applications to be deployed can be organized in the following
directory structure

root_directory
|_______templates
| |______index.html
| |______results.html
|_______static
|_______main.py
|_______app.yaml
8. The templates directory can be used to store the web templates of the
web application (HTML files).
9. The static directory can be used to store the web static files which
contain the styling and the business logic data for the web application
(CSS and JS files).
10.The main.py is used to define the routes, rendering logic, data
acquisition logic.
11.It provides the WSGI abstraction to the application.
12.The app.yaml file provides the runtime environment, URLs for routes
and launch configuration of the application in the form of key value
pairs.

Steps

A) Creating the application

1. The application must be initialized using the above-mentioned directory


structure.
2. It is a recommended format for organization and readability of code.
3. Create index.html and results.html as web templates with index.html for
taking user input and results.html for displaying response from the API
call.
4. The app.yaml file should contain the following content:

Contents of app.yaml

runtime : python2
api_version : 1
threadsafe : true

handlers
url : /
script : main.app

5. The logic of the application, i.e. the Web server interaction code of the
application must be placed in the main.py file.
6. The following python code sends request for information to the API and
interprets response from the API (here, World Time API is used).

Contents of main.py for World Time application

import os
import json
import urllib
import webapp2
from google.appengine.ext.webapp import template

class MainPage(webapp2.RequestHandler):
def get(self):
template_values = {}
path = os.path.join(os.path.dirname(__file__), 'templates/index.html')
self.response.out.write(template.render(path, template_values))

def post(self):
region = self.request.get('region')
area = self.request.get('area')
url = "http://worldtimeapi.org/api/timezone/"+ region + "/" + area
data = urllib.urlopen(url).read()
data = json.loads(data)
date = data['datetime'][0:10]
time = data['datetime'][11:19]
week = data['day_of_week']
year = data['day_of_year']
weeknum = data['week_number']
template_values = {
"date": date,
"time": time,
"week": week,
"year": year,
"weeknum": weeknum,
}
path = os.path.join(os.path.dirname(__file__),
'templates/results.html')
self.response.out.write(template.render(path, template_values))

app = webapp2.WSGIApplication([('/', MainPage)], debug=True)


7. Finally, after saving the above code, the application can be run on the
localhost server using the following command.

Command:
python <path_to_sdk>/bin/devappserver.py
<path_to_application_directory>

Sample Output
A) The application, if no errors are found, is launched on the port 8080 of the
localhost server.
B) The cloud console is visible on port 8000 of the localhost server.
C) The URL of localhost:8080 can be typed in the address bar of the browser
to view the application

D) Screenshots:

a) Application launch at port 8080 (Displaying index.html)

b) Displaying results.html to display results from the API call


c) Terminal / Command Line prompts

d) Cloud Console at port 8000


Assignment 3

Title

Simulate a cloud scenario using CloudSim and run a scheduling algorithm that is
not present in CloudSim.

Requirements

1. Java JDK and JRE


2. CloudSim archives (CloudSim4)
3. Eclipse IDE

Theory

A) CloudSim

1. CloudSim is an open-source framework, which is used to simulate cloud


computing infrastructure and services.
2. It is developed by the CLOUDS Lab organization and is written entirely in
Java.
3. It is used for modelling and simulating a cloud computing environment
as a means for evaluating a hypothesis prior to software development in
order to reproduce tests and results.
4. If you were to deploy an application or a website on the cloud and
wanted to test the services and load that your product can handle and
also tune its performance to overcome bottlenecks before risking
deployment, then such evaluations could be performed by simply
coding a simulation of that environment with the help of various flexible
and scalable classes provided by the CloudSim package, free of cost.

B) Benefits of CloudSim

1. No capital investment involved


2. Easy to use and Scalable
3. Risks can be evaluated at an earlier stage
4. No need for try-and-error approaches

C) Architecture

1. CloudSim has a layered architecture which separates the User Code and
the simulation environment.
2. It can be depicted as follows
D) CloudSim Components

 Datacenter: used for modelling the foundational hardware equipment


of any cloud environment, that is the Datacenter. This class provides
methods to specify the functional requirements of the Datacenter as
well as methods to set the allocation policies of the VMs etc.
 Host: this class executes actions related to management of virtual
machines. It also defines policies for provisioning memory and
bandwidth to the virtual machines, as well as allocating CPU cores to
the virtual machines.
 VM: this class represents a virtual machine by providing data members
defining a VM’s bandwidth, RAM, mips (million instructions per
second), size while also providing setter and getter methods for these
parameters.
 Cloudlet: a cloudlet class represents any task that is run on a VM, like a
processing task, or a memory access task, or a file updating task etc. It
stores parameters defining the characteristics of a task such as its
length, size, mi (million instructions) and provides methods similarly to
VM class while also providing methods that define a task’s execution
time, status, cost and history.
 DatacenterBroker: is an entity acting on behalf of the user/customer.
It is responsible for functioning of VMs, including VM creation,
management, destruction and submission of cloudlets to the VM.
 CloudSim: this is the class responsible for initializing and starting the
simulation environment after all the necessary cloud entities have
been defined and later stopping after all the entities have been
destroyed.

E) SJF algorithm
1. SJF stands for Shortest Job First
2. Shortest Job first has the advantage of having a minimum average
waiting time among all scheduling algorithms.
3. It is a Greedy Algorithm.
4. It may cause starvation if shorter processes keep coming. This problem
can be solved using the concept of ageing.
5. It is practically infeasible as Operating System may not know burst
time and therefore may not sort them. While it is not possible to
predict execution time, several methods can be used to estimate the
execution time for a job, such as a weighted average of previous
execution times. SJF can be used in specialized environments where
accurate estimates of running time are available.

Steps

A) Installation of CloudSim and creation of simulation environment

1. Visit https://github.com/Cloudslab/cloudsim/releases to download the


CloudSim archives for CloudSim 4.
2. Extract the archive.
3. The jars folder of the extracted archive should contain the following files:
a) cloudsim-4.0.jar
b) cloudsim-examples.jar
4. Create a new Java Project using the Eclipse IDE.
5. Right click on the project root and select the Build Path option from the
dropdown.
6. Select the Configure Build Path section from the extended dropdown

7. Select the Libraries section and click on Add External JARs field on the pop
up

8. Navigate to the jars directory of the CloudSim archive and include the 2 jars
in the project.
9. Create a new package in the src directory of the project.
10.Copy the code files for the constants, Data Center Creator, Data Center
Broker, Matrix Generator and the SJF scheduler files from the
https://github.com/suyash-more/Cloud-Computing-
Projects/tree/master/Scheduling-Algorithm-in-CloudSim/src link.
11.Make sure that the package name provided in each file is the same as the
previously created package.

B) Execution of code

1. Right click on the project

2. Run the project as a Java Application (option in extended dropdown)

3. The result is displayed on the console


Assignment 4

AIM:-. Find a procedure to transfer the files from one virtual machine to another virtual
Machine
Software Tools : VirtualBox
Theory:
Virtualization :
●​ Virtualization is the process of creating a software-based, or "virtual" version of a
computer, with dedicated amounts of CPU, memory, and storage that are
"borrowed" from a physical host computer—such as your personal computer—
and/or a remote server—such as a server in a cloud provider's datacenter. A virtual
machine is a computer file, typically called an image, that behaves like an actual
computer. It can run in a window as a separate computing environment, often to run
a different operating system—or even to function as the user's entire computer
experience—as is common on many people's work computers. The virtual machine is
partitioned from the rest of the system, meaning that the software inside a VM can't
interfere with the host computer's primary operating system.
Virtual machines: virtual computers within computers
●​ A virtual machine, commonly shortened to just VM, is no different than any other
physical computer like a laptop, smart phone, or server. It has a CPU, memory, disks
to store your files, and can connect to the internet if needed. While the parts that
make up your computer (called hardware) are physical and tangible, VMs are often
thought of as virtual computers or software-defined computers within physical
servers, existing only as code.
●​ A virtual machine (VM) is a digital version of a physical computer. Virtual machine
software can run programs and operating systems, store data, connect to networks,
and do other computing functions, and requires maintenance such as updates and
system monitoring. Multiple VMs can be hosted on a single physical machine, often a
server, and then managed using virtual machine software. This provides flexibility for
compute resources (compute, storage, network) to be distributed among VMs as
needed, increasing overall efficiency. This architecture provides the basic building
blocks for the advanced virtualized resources we use today, including cloud
computing. What are virtual machines used for? VMs are the basic building blocks of
virtualized computing resources and play a primary role in creating any application,
tool, or environment—for virtual machines online and on-premises. Here are a few
of the more common enterprise functions of virtual machines: Consolidate servers
VMs can be set up as servers that host other VMs, which lets organizations reduce
sprawl by concentrating more resources onto a single physical machine. Create
development and test environments VMs can serve as isolated environments for
testing and development that include full functionality but have no impact on the
surrounding infrastructure. Support DevOps VMs can easily be turned off or on,
migrated, and adapted, providing maximum flexibility for development

Advantages of Virtual machines :


Because of their flexibility and portability, virtual machines provide many benefits,
such as:
●​ Cost savings—running multiple virtual environments from one piece of infrastructure
means that you can drastically reduce your physical infrastructure footprint. This
boosts your bottom line—decreasing the need to maintain nearly as many servers
and saving on maintenance costs and electricity.
●​ Agility and speed—Spinning up a VM is relatively easy and quick and is much simpler
than provisioning an entire new environment for your developers. Virtualization
makes the process of running dev-test scenarios a lot quicker.
●​ Lowered downtime—VMs are so portable and easy to move from one hypervisor to
another on a different machine—this means that they are a great solution for
backup, in the event the host goes down unexpectedly.
●​ Scalability—VMs allow you to more easily scale your apps by adding more physical or
virtual servers to distribute the workload across multiple VMs. As a result you can
increase the availability and performance of your apps.
●​ Security benefits— Because virtual machines run in multiple operating systems, using
a guest operating system on a VM allows you to run apps of questionable security
and protects your host operating system. VMs also allow for better security forensics,
and are often used to safely study computer viruses, isolating the viruses to avoid
risking their host computer.
Refer e-source: CC LAB - Google Drive
How to transfer the files from one virtual machine to another virtual machine -
YouTube
Steps:

1.​ Download and install Oracle's Virtual Box. (Reboot needed after installation)

VirtualBox - https://www.virtualbox.org/wiki/Downl...

2.​ Download Ubuntu VMDK Image.

Ubuntu Image - https://drive.google.com/drive/u/0/fo... or


https://app.vagrantup.com/bento/boxes...

3.​ Launch Virtualbox and create a new VM.

4.​ Click on new and mention the Name and the machine folder along with the Type and
Version of the Machine to be created.

5.​ Assign memory size for our VM (1024 MB sufficient for now).

6.​ Select the option Use an existing virtual hard disk file and locate the donwloaded
VMDK image below and create VM.

7.​ Now we have to create a NAT Network so go to File -> Preferences -> Network ->
Add a New NAT Network (Click on +)

8.​ Right click and edit the Network name and CIDR if needed. Example :

Name - My VMbox Network


CIDR - 172.168.2.0/24 and save the changes.

9.​ Repeat the process of launching the VM for 2 instances.

10.​Now go to the setting, go to the network setting and change the adapter to NAT
Network and and select the NAT Network you made ( in our case : My VMbox
Network ) and click ok.

11.​Launch the VM now.

12.​Install the net-tools to know the IP's of the instance.

$ sudo apt install net-tools


$ sudo apt update

13.​To know the IP address


$ ifconfig

Now the IP will be in the range of 172.168.2.*

* - any number in the range of 1 to 254 (total 256 addresses)

14.​Now create a file and write something into it.

$ touch tranfer.txt
$ nano transfer.txt
-> hey, How are you?
ctrl + X and save
Some Commands for Linux Based Distros:

ls - list all the files and directories


cat - show the content inside a file
scp - it will help us to copy files from one vm to other
cd - change directory
mkdir - make a new directory
touch - it makes a new file
nano - nano is a editor inside linux os

15.​If your file is on the VM with IP 172.168.2.4 and the second VM's IP is 172.168.2.5.

16.​Tranfer the file using SCP

$ scp tranfer.txt vagrant@172.168.2.5:/home/vagrant

Put in the password of the 2nd VM and done.

17.​Check for the file in the Second VM under the /home/vagrant directory.

18.​Done..!!!!

Conclusion: Hence we are concluded that we are successfully find a procedure


to transfer the files from one virtual machine to another virtual machine.
Assignment 5
Problem Statement:

Find a procedure to launch virtual machine.

Theory:

Virtual Machine:

 Virtual machines allow you to run an operating system in an app window on your
desktop that behaves like a full, separate computer. You can use them play around with
different operating systems, run software your main operating system can’t, and try out
apps in a safe, sandboxed environment.
 A virtual machine app creates a virtualized environment—called, simply enough, a
virtual machine—that behaves like a separate computer system, complete with virtual
hardware devices. The VM runs as a process in a window on your current operating
system. You can boot an operating system installer disc (or live CD) inside the virtual
machine, and the operating system will be “tricked” into thinking it’s running on a real
computer. It will install and run just as it would on a real, physical machine. Whenever
you want to use the operating system, you can open the virtual machine program and use
it in a window on your current desktop.
 In the VM world, the operating system actually running on your computer is called the
host and any operating systems running inside VMs are called guests.
 The main purpose of VMs is to operate multiple operating systems at the same time, from
the same piece of hardware.

Advantages of VM:

 The multiplicity of Operating Systems Reduced Overhead


 Safety Net for Data – Rapid Disaster Recovery and Auto Backups Scalability
 Centralization

TryStack:

TryStack is a free and easy way for users to try out OpenStack, and set up their own cloud with
networking, storage, and computer instances.

Requirement:

22
Account on

AWS or Azure or Google Cloud.

Steps:

-In the Google Cloud Console, go to the Create an instance page.

-Go to Create an instance

-Specify a Name for your VM. For more information, see Resource naming convention.

-Optional: Change the Zone for this VM. Compute Engine randomizes the list of zones within
each region to encourage use across multiple zones.

 Select a Machine configuration for your VM.


 In the Boot disk section, click Change to configure your boot disk, and then do the
following:

23
 Select the Custom Images tab.

To select the image project, click Select a project, and then do the following:

 Select the project that contains the image. Click Open.


 In the Image list, click the image that you want to import. Select the type and size of your
boot disk. To confirm your boot disk options, click Select.
 To permit HTTP or HTTPS traffic to the VM, in the Firewall section, select Allow HTTP
traffic or Allow HTTPS traffic.

24
-The Cloud Console adds a network tag to your VM and creates the corresponding
ingress firewall rule that allows all incoming traffic on tcp:80 (HTTP) or tcp:443
(HTTPS). The network tag associates the firewall rule with the VM. For more
information, see Firewall rules overview in the Virtual Private Cloud documentation. -To
start and create a VM, click Create.

Conclusion :

Thus, we have studied a procedure to launch virtual machine.

25
Assignment 6

Title

Design and deploy a web application in a PaaS environment.

Objectives

 Launch virtual machine EC2


 Launch a web server with termination protecti
 Monitor Your EC2 instance
 Modify the security group that your web server is using to allow HTTP access
 Resize your EC2 instance to scale

Theory:

Platform as a service (PaaS) It is a cloud computing model where a third-party provider delivers
hardware and software tools to users over the internet. Usually, these tools are needed for
application development. A PaaS provider hosts the hardware and software on its own
infrastructure.

Platform as a service (PaaS) or application platform as a service (aPaaS) or platform-based


service is a category of cloud computing services that allows customers to provision, instantiate,
run, and manage a modular bundle comprising a computing platform and one or more
applications, without the complexity of building and maintaining the infrastructure typically
associated with developing and launching the application(s); and to allow developers to create,
develop, and package such software bundles.

PaaS can be delivered in three ways:

 As a public cloud service from a provider, where the consumer controls software
deployment with minimal configuration options, and the provider provides the networks,
servers, storage, operating system (OS), middleware (e.g. Java runtime, .NET runtime,
integration, etc.), database and other services to host the consumer's application.
 As a private service (software or appliance) behind a firewall.
 As software deployed on public infrastructure as a service

Detailed Steps:-

1. https://www.awseducate.com/registration/s/

2. Register yourself in "Learn Cloud Skills" by entering email id

26
27
28
Accessing the AWS Management Console

1. At the top of these instructions, choose Start Lab to launch your lab.

A Start Lab panel opens, and it displays the lab status.

2. Wait until you see the message Lab status: ready, then close the Start Lab panel by choosing
the X.

29
3. At the top of these instructions, choose AWS .

This opens the AWS Management Console in a new browser tab. The system will automatically
log you in.

Task 1: Launching your EC2 instance

In this task, you launch an EC2 instance with termination protection. Termination protection
prevents you from accidentally terminating an EC2 instance. You deploy your instance with a
user data script in order to deploy a simple web server.

1. In the AWS Management Console on the Services menu, choose EC2.

2. Choose Launch instance, and then select Launch instance.

Step 1: Choose an Amazon Machine Image (AMI)

An AMI provides the information required to launch an instance, which is a virtual server in the
cloud. An AMI includes the following:

A template for the root volume for the instance (for example, an operating system or an
application server with applications)

 Launch permissions that control which AWS accounts can use the AMI to launch
instances
 A block device mapping that specifies the volumes to attach to the instance when it is
launched
 The Quick Start list contains the most commonly used AMIs. You can also create your
own AMI or select an AMI from the AWS Marketplace, an online store where you can
sell or buy software that runs on AWS.

1. At the top of the list, choose Select next to Amazon Linux 2 AMI.

30
Step 2: Choose an instance type

Amazon EC2 provides a wide selection of instance types optimized to fit different use cases.
Instance types comprise varying combinations of CPU, memory, storage, and networking
capacity and give you the flexibility to choose the appropriate mix of resources for your
applications. Each instance type includes one or more instance sizes so that you can scale your
resources to the requirements of your target workload.

Select a t2.micro instance This instance type has 1 virtual CPU and 1 GiB of memory.

1. Choose Next: Configure Instance Details

31
Step 3: Configure instance details

You use this page to configure the instance to suit your requirements. This configuration
includes networking and monitoring settings.

The Network indicates which virtual private cloud (VPC) you want to launch the instance into.
You can have multiple networks, including different ones for development, testing, and
production.

1. For Network, select Lab VPC.

The Lab VPC was created using an AWS CloudFormation template during the setup process of
your lab. This VPC includes two public subnets in two different Availability Zones.

2. For Enable termination protection, select Protect against accidental termination.

When you no longer require an EC2 instance, you can terminate it, which means that the instance
stops, and Amazon EC2 releases the instance's resources. You cannot restart a terminated
instance. If you want to prevent your users from accidentally terminating the instance, you can
enable termination protection for the instance, which prevents users from terminating instances.

3. Scroll down, and then expand Advanced Details.

A field for User data appears.

32
When you launch an instance in Amazon EC2, you have the option of passing user data to the
instance that can be used to perform common automated configuration tasks and even run scripts
after the instance starts.

4. Copy the following web application home page sample code into user data filed.

5. Also code other pages for your web application.

#!/bin/bash

yum -y install httpd

systemctl enable httpd

systemctl start httpd

echo '<html><h1>Hello From Your Web Server!</h1></html>' > /var/www/html/index.html

The script does the following:

o Install an Apache web server (httpd)

o Configure the web server to automatically start on boot

o Activate the Web server o Create a simple web page

1. Choose Next: Add Storage

Step 4: Add storage

Amazon EC2 stores data on a network-attached virtual disk called Amazon Elastic Block Store
(Amazon EBS).

33
You launch the EC2 instance using a default 8 GiB disk volume. This is your root volume (also
known as a boot volume).

1. Choose Next: Add Tags

Step 5: Add tags

Using tags, you can categorize your AWS resources in different ways (for example, by purpose,
owner, or environment). This categorization is useful when you have many resources of the same
type: you can quickly identify a specific resource based on the tags you have assigned to it. Each
tag consists of a key and a value, both of which you define.

1. Choose Add Tag, and then configure the following:

o Key: Name

o Value: Web-Server

Make sure the punctuation for the tags matches exactly as above.

1. Choose Next: Configure Security Group

Note: Notice the "Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance.
We recommend setting security group rules to allow access from known IP addresses only."
While this is true and common best practice, this has been simplified for the sake of this lab.

34
Step 6: Configure a security group

A security group acts as a virtual firewall that controls the traffic for one or more instances.
When you launch an instance, you associate one or more security groups with the instance. You
add rules to each security group that allow traffic to or from its associated instances. You can

35
modify the rules for a security group at any time; the new rules are automatically applied to all
instances that are associated with the security group.

1. On Step 6: Configure Security Group, configure the following:

o Security group name: Web Server security group

o Description: Security group for my web server

In this lab, you do not log in to your instance using SSH. Removing SSH access improves the
security of the instance.

3. Choose Review and Launch

Step 7: Review instance launch

The Review page displays the configuration for the instance that you are about to launch.

1. Choose Launch

A Select an existing key pair or create a new key pair window will appear.

Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. To log in
to your instance, you must create a key pair, specify the name of the key pair when you launch
the instance, and provide the private key when you connect to the instance.

36
In this lab, you do not log in to your instance, so you do not require a key pair.

2. Choose the Choose an existing key pair dropdown list, and select Proceed without a key pair.

3. Select the next to the text I acknowledge that .... 4. Choose Launch Instances

Your instance will now be launched.

5. Choose View Instances

The instance appears in a Pending state, which means it is being launched. It then changes to
Running, which indicates that the instance has started booting. There will be a short time before
you can access the instance.

The instance receives a public DNS name that you can use to contact the instance from the
Internet.

Select the box next to your Web Server. The Details tab displays detailed information about your
instance.

To view more information in the Details tab, drag the window divider upward.

Review the information displayed in the Details, Security and Networking tabs.

6. Wait for your instance to display the following:

Note: Refresh if needed.

o Instance State: Running

o Status Checks: 2/2 checks passed

37
Task 2: Monitoring your instance

Monitoring is an important part of maintaining the reliability, availability, and performance of


your EC2 instances and your AWS solutions.

1. Choose the Status checks tab.

With instance status monitoring, you can quickly determine whether Amazon EC2 has detected
any problems that might prevent your instances from running applications. Amazon EC2
performs automated checks on every running EC2 instance to identify hardware and software
issues.

Notice that both the System reachability and Instance reachability checks have passed.

2. Choose the Monitoring tab.

This tab displays Amazon CloudWatch metrics for your instance. Currently, there are not many
metrics to display because the instance was recently launched.

You can chose a graph to see an expanded view.

Amazon EC2 sends metrics to Amazon CloudWatch for your EC2 instances. Basic (5 minute)
monitoring is enabled by default. You can enable detailed (1 minute) monitoring.

38
3. At the top of the page, choose the Actions dropdown menu. Select Monitor and troubleshoot
Get system log.

The system log displays the console output of the instance, which is a valuable tool for problem
diagnosis. It is especially useful for troubleshooting kernel problems and service configuration
issues that could cause an instance to terminate or become unreachable before its SSH daemon
can be started. If you do not see a system log, wait a few minutes and then try again.

1. Scroll through the output, and note that the HTTP package was installed from the user data
that you added when you created the instance.

2. Choose Cancel to return to the Amazon EC2 dashboard.

3. With your web server selected, choose the Actions dropdown menu, and select Monitor and
troubleshoot Get instance screenshot.

This option shows you what your EC2 instance console would look like if a screen were attached
to it. Notice it is essentially a command line interface.

If you are unable to reach your instance via SSH or RDP, you can capture a screenshot of your
instance and view it as an image. This option provides visibility about the status of the instance
and allows for quicker troubleshooting.

4. At the bottom of the page, choose Cancel.

Task 3: Updating your security group and accessing the web server

When you launched the EC2 instance, you provided a script that installed a web server and
created a simple web page. In this task, you access content from the web server.

1. Select box next to the EC2 web server you created, and then choose the Details tab.

2. Copy the Public IPv4 address of your instance to your clipboard.

3. In your web browser, open a new tab, paste the IP address you just copied, and then press
Enter.

Question: Are you able to access your web server? Why not?

You are not currently able to access your web server because the security group is not permitting
inbound traffic on port 80, which is used for HTTP web requests. This is a demonstration of how
to use a security group as a firewall to restrict the network traffic that is allowed in and out of an
instance.

To correct this issue, you now update the security group to permit web traffic on port 80.

4. Keep the browser tab open, but return to the EC2 Management Console tab.

5. In the left navigation pane, choose Security Groups.

39
6. Select the check box next to the Web Server security group. 7. Choose the Inbound rules tab.

The security group currently has no rules.

8. Choose Edit inbound rules and then choose Add rule and configure the following:

o Type: Choose HTTP.

o Source: Choose Anywhere.

9. Choose Save rules

10. Return to the web server tab that you previously opened, and choose to refresh the page.

You should see the message Hello From Your Web Server!

40
41
42
lOMoAR cPSD| 20576580

lOMoAR cPSD| 20576580

Assignment 7

• Problem Definition: Design and develop custom Application (Mini Project) using
Salesforce Cloud.

• Objective: To create an custom application on Salesforce Lightning platform.

• Software / Hardware Requirements: OS - Windows / Ubuntu, Google Chrome.

• Theory:

1. Salesforce:

Salesforce is a cloud computing service as a software (SaaS) company that specializes in


customer relationship management (CRM). Salesforce's services allow businesses to use
cloud technology to better connect with customers, partners and potential customers. The
software has become the number one for customer success and helps businesses
track customer activity, market to customers and many more services. Salesforce is a
customer relationship management solution that brings companies and customers together. It
is one integrated CRM platform that gives all your departments — including marketing,
sales, commerce, and service — a single, shared view of every customer.

2. Salesforce Lightning Experience:

Salesforce Lightning Experience is simply referred to as “Lightning”. When working with


lightning Salesforce we will learn about different Salesforce lightning topics like Lightning
Login, Lightning App Builder, Lightning for Outlook, Salesforce Lightning Components,
Lightning Sync and many more. Some of them are applicable in Lightning Experience only,
but some others will work in both Lightning Experience and older Classic user interfaces.
Lightning Sync is used to sync your user contacts and events between your email server with
Salesforce.

43
lOMoAR cPSD| 20576580

Step 1: Log into Salesforce Developer account.

Step 2: Open Salesforce Lightning platform and click on Object Manager => Create => Custom
Object.

44
lOMoAR cPSD| 20576580

Step 3: Fill in the required fields and under Optional Features, select Allow Reports and Allow
Activities. Click Save.

45
lOMoAR cPSD| 20576580

Step 4: Now, Click on Fields & Relations => New.

Step 5: Then select option “Email” and click Next-> Next -> Save.

46
lOMoAR cPSD| 20576580

Step 6: Similarly. Repeat steps 4 and 5 to add more fields like Phone, Date of Birth. This is how
the custom object will have the various fields.

Step 7: Now go to Home => search for “Tabs”. Click on New.

47
lOMoAR cPSD| 20576580

Step 8: Enter the Object name and select any icon for tab style. Leave all defaults as it is. Click
Next, Next, and Save.

Step 9: In Setup, click Home. Enter “App Manager” in Quick Find and select App Manager.
Click New Lightning App.

48
lOMoAR cPSD| 20576580

Step 10: Define the new Lightning app as follows:

App Name: Student Details Manager

Developer Name: Student_Details_Manager. Click Next.

Step 11: On the App Options screen, leave the defaults as is and click Next. On the Utility Items
screen, leave the defaults as is and click Next. On the Navigation Items screen, select
Student_Detail and move them to the Selected Items box. Then click Next.

49
lOMoAR cPSD| 20576580

Step 12: On the Assign to User Profiles screen, select System Administrator and move it to
Selected Profiles. Then click Save & Finish.

Step 13: Click on App launcher and Open the custom application created.

50
lOMoAR cPSD| 20576580

Step 14: Click on Student_Details => New => fill the specified details and copy the URL.

51
lOMoAR cPSD| 20576580

Step 15: Open Google Chrome new Tab => More Tools => Developer Tools and then paste the
URL of the application, copied in the previous step.

52
lOMoAR cPSD| 20576580

Conclusion: We have learnt to create custom application using salesforce Lightning platform.

53
Assignment 8
Title

Design an Assignment to retrieve, verify, and store user credentials using Firebase
Authentication, the Google App Engine standard environment, and Google Cloud Data store.

Requirements

1. Google App Engine 2. Firebase 3. Google Cloud 4. Text Editor 5. Browser

Theory

A) Firebase:

1. Google Firebase is a mobile application development platform from Google with powerful
features for developing, handling, and enhancing applications. Firebase is a backend platform for
building web and mobile applications.

2. Firebase is fundamentally a collection of tools developers can rely on, creating applications
and expanding them based on demand.

3. Firebase aims to solve three main problems for developers:

a. Build an app, fast b. Release and monitor an app with confidence c. Engage users,

4. Developers relying on this platform get access to services that they would have to develop
themselves, and it enables them to lay focus on delivering robust application experiences.

5. Some of the Google Firebase platform’s standout features include databases, authentication,
push messages, analytics, file storage, and much more.

6. Since the services are cloud-hosted, developers can smoothly perform ondemand scaling
without any hassle. Firebase is currently among the top app development platforms relied upon
by developers across the globe.

B) Firebase Key Features:

1. Authentication: It supports authentication using passwords, phone numbers, Google,


Facebook, Twitter, and more. The Firebase Authentication (SDK) can be used to manually
integrate one or more sign-in methods into an app.

2. Realtime database: Data is synced across all clients in real-time and remains available even
when an app goes offline.

54
3. File Storage: Firebase Storage provides a simple way to save binary files — most often
images, but it could be anything — to Google Cloud Storage directly from the client. Firebase
Storage has it’s own system of security rules to protect your GCloud bucket from the masses,
while granting detailed write privileges to your authenticated clients.

4. Hosting: Firebase Hosting provides fast hosting for a web app; content is cached into content
delivery networks worldwide.

5. Test lab:

The application is tested on virtual and physical devices located in

Google’s data centers. 6. Notifications: Notifications can be sent with firebase with no additional
coding. Users can get started with firebase for free; more details can be found on the official
website.

C) Firebase Uses:

Steps

1. Initial Setup:

a. Install and configure Google App Engine:

b. Signup and Login to Google Cloud platform:

55
c. Login to Firebase:

2. Creation of project in Google Cloud:

a. Create a new project in Google Cloud platform:

56
b. You can view the created project in the dashboard:

3. Setup Google App Engine:

a. Open the GAE SDK shell and type the command ‘gcloud init’. Then select appropriate
configuration an account:

b. From the list that appears select the appropriate project that we created in

57
4. Adding Firebase to the project:

a. Go to the Firebase console and click on Create a project:

58
b. In the next window, add the project name that we created in Google Cloud:

c. Confirm Firebase billing plan:

59
d. The next window shows some instructions. Read those and click Continue:

e. Enable Google Analytics for the project:

60
f. Configure Google Analytics by selecting Default Account for Firebase:

g. We have successfully added Firebase to our project.

61
5. Adding an App to the Firebase project:

a. From the console, go to your project and click ‘</>’ to add your app:

b. Add a nickname for your app and click Register app:

c. You will receive further configuration details then click Continue to console:

d. You will see the app on the console, click on it to view all its details.

62
63
6. Authentication in Firebase:

64
a. Go to the project’s console and select Authentication:

b. In the Sign-in methods you will see various options, select any one option:

c. Perform appropriate configuration for that platform. You can also add domains:

65
d. Then you can see the added sign-in methods and the domains:

e. Also, when the users login to your application, their details will be visible at the Users tab:

7. Installing dependencies and Running application locally:

66
a. Go to the backend directory of your application. By using the command ‘pip install -t lib -r
requirements.txt’ install the dependencies:

b. The requirements will be installed at specified location:

67
c. Run ‘py dev_appserver.py frontend/app.yaml backend/app.yaml’ to run your application on
localhost

68
8. Deploying your app:

a. Enter ‘gcloud app deploy’ command to deploy your application as shown below:

b. Select appropriate region if prompted.

69
c. The backend and the frontend of your application will be deployed:

70

You might also like