Cas Lab
Cas Lab
LABORATORY
LAB MANUAL
DEPARTMENT OF ARTIFICIAL
INTELLIGENCE AND MACHINE LEARNING
Page
SNO. Date PARTICULARS Remarks
No.
Create an word document of your class time table and
1 28/11/2023
store locally and on cloud with doc and pdf format
Implementation of Virtualization in Cloud Computing
to Learn Virtualization Basics, Benefits of
2 12/12/2023
Virtualization in Cloud using Open Source Operating
System
Install Virtual box/VMware Workstation with different
3 19/12/2023 flavours of linux or windows OS on top of windows7
or 8.
Install a C compiler in the virtual machine created
4 26/12/2023
using virtual box and execute Simple Programs.
Write a Google app engine program to generate n even
5 09/01/2024
numbers and deploy it to Google cloud.
6 23/01/2024 Google app engine program multiply two matrices.
Google app engine program to validate user; create a
7 27/02/2024 database login(username, password)in mysql and
deploy to cloud.
Write a Google app engine program to display nth
8 29/02/2024 largest no from the given list of numbers and deploy it
in Google cloud.
Google app engine program to validate the user use
9 05/03/2024
mysql to store user info and deploy on to cloud.
10 12/03/2024 Implement prog1-5 using Microsoft Azure.
Establish an AWS account. Use the AWS Management
11 19/03/2024
Console to launch an EC2 instance and connect to it.
EXPERIMENT-1
1.Create an word document of your class time table and store locally and on cloud with
doc and pdf format
AIM:
The objective of this lab experiment is to create a class timetable using a word processing
application, save the document locally, and then store it on a cloud platform in both DOC and
PDF formats. Participants will gain hands-on experience in document creation, file storage,
and document format conversion.
EXPERIMENT STEPS:
Step 1: Document Creation
● Open your preferred word processing application (e.g., Microsoft Word).
● Create a new document and format it to represent your class timetable.
● Include details such as class names, instructors, and time slots.
AIM:
The objective of this lab experiment is to gain hands-on experience in implementing
virtualization in cloud computing using an open-source operating system. Participants will
learn the basics of virtualization, understand the benefits of virtualization in the cloud, and
work with relevant tools to create virtual machines.
EXPERIMENT STEPS:
Step 1: What is Virtualization Software
Virtualization is technology that you can use to create virtual representations of servers,
storage, networks, and other physical machines. Virtual software mimics the functions of
physical hardware to run multiple virtual machines simultaneously on a single physical
machine.
The tool used for virtualization is virtualization software e.g VirtualBox.
● Emulation
Guest programs run within a controlled virtualization layer, allowing the emulation of
diverse environments. This enables the execution of guest programs with specific
characteristics not present in the physical host.
● Sharing
Virtualization enables the creation of separate computing environments within the
same host, reducing the number of active servers and limiting power consumption.
● Aggregation
Virtualization allows the grouping of separate hosts, presented to guests as a single
virtual host. Cluster management software facilitates this, utilizing the resources of
multiple machines as a unified entity.
● Isolation
Virtualization provides guests with a separate environment, interacting through an
abstraction layer. The virtual machine filters and prevents harmful operations,
ensuring secure execution.
CONCLUSION:
This lab experiment provides hands-on experience in implementing virtualization in cloud
computing using an open-source operating system. Participants gain practical insights into the
basics of virtualization, understand the benefits of virtualization in the cloud, and learn to
work with relevant tools to create and manage virtual machines.
EXPERIMENT-3
3.Install Virtual box/VMware Workstation with different flavours of linux or windows
OS on top of windows7 or 8.
AIM:
The objective of this lab experiment is to gain hands-on experience in virtualization by
installing VirtualBox or VMware Workstation on a Windows 7 or 8 host machine.
Participants will further install different flavours of Linux and Windows operating systems as
virtual machines to understand the virtualization process.
EXPERIMENT STEPS:
Step 1: Install Virtualization Software
● Download and install either VirtualBox or VMware Workstation on the Windows 7 or
8 host machine.
● Follow the installation wizard and configure settings as needed.
CONCLUSION:
This lab experiment provides practical experience in virtualization by installing VirtualBox or
VMware Workstation on a Windows 7 or 8 host machine and creating virtual machines with
different flavours of Linux and Windows operating systems. Participants gain insights into
the configuration and management of virtualized environments.
EXPERIMENT-4
4.Install a C compiler in the virtual machine created using virtual box and execute
Simple Programs.
AIM:
The objective of this lab experiment is to install a C compiler in a virtual machine created
using VirtualBox and execute simple C programs. Participants will gain hands-on experience
in setting up a development environment for C programming within a virtualized
environment.
EXPERIMENT STEPS:
CONCLUSION:
This lab experiment provides practical experience in setting up a C programming
environment by installing the GCC compiler in a virtual machine created using VirtualBox.
Participants gain hands-on experience in compiling and executing simple C programs, laying
the foundation for further programming exploration.
EXPERIMENT-5
5.Write a Google app engine program to generate n even numbers and deploy it to
Google cloud.
AIM:
The objective of this lab is to create a simple Google App Engine (GAE) program using
Python and Flask to generate n even numbers and deploy it to Google Cloud.
Prerequisites:
● Google Cloud Platform (GCP) account
● Google Cloud SDK installed on your local machine
EXPERIMENT STEPS:
2. Create `requirements.txt`:
Create a file named `requirements.txt` in your project directory:
#requirements.txt
Flask==3.0.0
4. Create `app.yaml`:
Create a file named `app.yaml` in your project directory:
#app.yaml
runtime: python39
app = Flask(__name__)
@app.route('/generate_even_numbers/<int:n>', methods=['GET'])
def generate_even_numbers(n):
even_numbers = [i * 2 for i in range(n)]
return jsonify({'even_numbers': even_numbers})
if __name__ == '__main__':
app.run()
OUTPUT:
python main.py
`http://localhost:5000/generate_even_numbers/5`
{‘even_numbers’: 0,2,4,6,8}
CONCLUSION:
From this experiment we have created a Google App Engine program to generate n even
numbers and deployed it to Google Cloud.
EXPERIMENT-6
6.Google app engine program multiply two matrices.
AIM
To create a Google App Engine program in Python to multiply two matrices and deploy it to
Google Cloud.
Prerequisites:
● Google Cloud Platform (GCP) account
● Google Cloud SDK installed on your local machine
EXPERIMENT STEPS:
4. Create `app.yaml`: Create a file named `app.yaml` in your project directory:
#app.yaml
runtime: python39
5. Write the Flask App:
Create a file named `main.py` with the following code:
app = Flask(__name__)
def matrix_multiply(matrix_a, matrix_b):
result = [[0] * len(matrix_b[0]) for _ in range(len(matrix_a))]
for i in range(len(matrix_a)):
for j in range(len(matrix_b[0])):
for k in range(len(matrix_b)):
result[i][j] += matrix_a[i][k] * matrix_b[k][j]
return result
@app.route('/multiply', methods=['POST'])
def multiply_matrices():
data = request.get_json()
matrix_a = data['matrix_a']
matrix_b = data['matrix_b']
if __name__ == '__main__':
app.run(debug=True)
OUTPUT:
python main.py
CONCLUSION:
From this experiment we have created a Google App Engine program to multiply two
matrices and deployed it to Google Cloud.
EXPERIMENT-7
7.Google app engine program to validate user; create a database login(username,
password)in mysql and deploy to the cloud.
AIM
To create a Google App Engine program in Python to validate user; create a database
login(username, password)in mysql and deploy it to Google Cloud.
Prerequisites:
● Google Cloud Platform (GCP) account
● Google Cloud SDK installed on your local machine
EXPERIMENT STEPS:
# app.py
import os
from flask import Flask, request, jsonify
import pymysql
db_config = {
'host': os.environ.get('MYSQL_HOST'),
'user': os.environ.get('SQL_USERNAME'),
'database': os.environ.get('SQL_DATABASE_NAME','users'),
}
app = Flask(__name__)
cnx = pymysql.connect(**db_config)
cursor = cnx.cursor()
if not user:
return jsonify({'error': 'User not found'}), 404
if __name__ == '__main__':
app.run(debug=True)
OUTPUT
python main.py
CONCLUSION:
Google app engine program to validation of user by using mysql is performed
EXPERIMENT-8
8.Write a Google app engine program to display nth largest no from the given list of
numbers and deploy it in Google cloud.
AIM
To create a Google App Engine program in Python to to display nth largest no from the given
list of numbers and deploy it in Google cloud.
Prerequisites:
● Google Cloud Platform (GCP) account
● Google Cloud SDK installed on your local machine
EXPERIMENT STEPS:
2. Create `requirements.txt`:
Create a file named `requirements.txt` in your project directory:
#requirements.txt
Flask==3.0.0
4. Create `app.yaml`:
Create a file named `app.yaml` in your project directory:
#app.yaml
runtime: python39
app = Flask(__name__)
@app.route('/')
def display_nth_largest():
numbers = [int(x) for x in request.args.get('numbers').split(',')]
n = int(request.args.get('n'))
nth_largest = sorted(numbers, reverse=True)[n-1]
return f'The {n}th largest number is: {nth_largest}'
if __name__ == '__main__':
app.run()
OUTPUT
python main.py
http://localhost:5000/?numbers=10,2,4,3,5&n=2
The 2th largest number is 5
CONCLUSION:
From this experiment we have created a Google App Engine program to display nth largest
no from the given list of numbers and deploy it in Google cloud.
EXPERIMENT-9
9.Google app engine program to validate the user use mysql to store user info and
deploy on to cloud.
AIM
Google app engine program to validate the user use mysql to store user info and deploy on to
cloud.
Prerequisites:
● Google Cloud Platform (GCP) account
● Google Cloud SDK installed on your local machine
EXPERIMENT STEPS:
2. Create `requirements.txt`:
Create a file named `requirements.txt` in your project directory:
#requirements.txt
Flask==3.0.0
PyMySQL==1.0.3
4. Create `app.yaml`:
Create a file named `app.yaml` in your project directory:
#app.yaml
runtime: python39
env_variables:
MYSQL_HOST: 'localhost'
SQL_USERNAME: 'CseLab2'
# app.py
import os
from flask import Flask, request, jsonify
import pymysql
db_config = {
'host': os.environ.get('MYSQL_HOST'),
'user': os.environ.get('SQL_USERNAME'),
'database': os.environ.get('SQL_DATABASE_NAME','users'),
}
app = Flask(__name__)
cnx = pymysql.connect(**db_config)
cursor = cnx.cursor()
OUTPUT
python main.py
CONCLUSION:
From this experiment we created a Google app engine program we performed the registration
of the user to validate the user by using mysql to store user info and deployed on to cloud.
EXPERIMENT-10
10.Implement prog1-5 using Microsoft Azure.
AIM
Implement prog1-5 using Microsoft Azure.
Prerequisites:
● Microsoft Azure account
EXPERIMENT STEPS:
CONCLUSION:
Hence The prog1-5 (exp4,exp5,exp6,exp7,exp8,exp9) are deployed using Microsoft Azure
Function in the Microsoft Azure Cloud.
.
EXPERIMENT-11
11.Establish an AWS account. Use the AWS Management Console to launch an EC2
instance and connect to it.
AIM
Establish an AWS account. Use the AWS Management Console to launch an EC2 instance
and connect to it.
Prerequisites:
● AWS cloud account
EXPERIMENT STEPS:
1. Sign up for an AWS Account:Visit the AWS website (https://aws.amazon.com/) and
sign up for an AWS account if you haven't already done so. Follow the prompts to
provide necessary information and create your account.
2. Access AWS Management Console:After creating your account, log in to the AWS
Management Console using your credentials.
3. Navigate to EC2 Dashboard:Once logged in, navigate to the EC2 Dashboard. You
can find it under the "Compute" section or by searching for "EC2" in the AWS
Management Console search bar.
4. Launch an EC2 Instance:In the EC2 Dashboard, click on the "Launch Instance"
button to initiate the instance creation process.
Follow the steps provided in the instance creation wizard:
● Choose an Amazon Machine Image (AMI): Select the operating system and
configuration for your EC2 instance.
● Choose an Instance Type: Select the type of EC2 instance based on your
requirements and workload.
● Review and Launch: Review the configuration settings for your instance and
launch it.
5. Connect to the EC2 Instance:
● Once the instance is launched, select it from the EC2 Dashboard.
● Under the "Connect" tab, you'll find instructions on how to connect to your
instance. Depending on your operating system and preferences, you can either
connect via SSH (for Linux instances) or RDP (for Windows instances).
● Follow the provided instructions to establish a connection to your EC2
instance.
CONCLUSION:
In this experiment, we successfully established an AWS account, utilized the AWS
Management Console to launch an EC2 instance, and connected to it. This process
demonstrates the fundamental steps involved in provisioning and accessing compute
resources in the AWS cloud environment.