ANNA UNIVERSITY,CHENNAI .
GKM
COLLEGE OF ENGINEERING AND TECHNOLOGY
(SPONSPERED BY SUGANTHI EDUCATIONAL TRUST)
(AN ISO ISO: 9001 :2005 CERTIFIDE, APPROVED BY AICTE ,AFFLIATED TO ANNA UNIVERSITY)
G.K.M NAGAR,New Perungalathur(Near Tambaram) Chennai-600 063.
(BACHELOR OF TECHNOLOGY)
ARTIFICIAL INTELLIGENCE AND DATA
SCIENCE
LABORATORY RECORD
NAME : …………………………………….
REGISTER NUMBER :…………………………………….
SEMESTER :…………………………………….
YEAR :…………………………………….
BRANCH : …………………………………….
1
GKM
COLLEGE OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE
REG NO:
Name of the lab
Department of Certified that this is a bonafide record
of the work done by of Class
in the Laboratory during the Year
Signature of Staff-in-Charge Head of the Department
Internal Examiner External Examiner
Name of the Examination : ………………………….
Register No : …………………………..
Date of the Examination : ………………………….
2
INDEX
[Link] Date Name of the Experiment Page Marks Sign
No
Completed / Incomplete Staff-in-Charge
3
[Link] CREATE MAVEN BUILD PIPELINE IN AZURE
Date:
AIM:
To create maven build pipeline in Azure
PROCEDURE:
Step 1: Install Apache Maven Zip file
Step 2: Go to folder where apache maven downloaded
4
Step 3: Right Click & Extract the Zip file
Step 4: Click the Extracted file
5
Step 5: Select bin folder
Step 6: Copy bin folder path
6
Step 7: Open Environmental Variable
Step 8: Select path and click edit
7
Step 9: Click New and paste the copied path
Step 10: Click ok
Step 11: Open Command Prompt
>> mvn --version
8
Step 12: Maven Verified
9
RESULT:
Thus, creating maven build pipeline in Azure done successfully.
10
[Link]: 2 RUN REGRESSION TESTS USING MAVEN BUILD PIPELINE IN AZURE
Date:
AIM:
To run regression tests using Maven Build pipeline in Azure.
PROCEDURE:
Step 1: Download Eclipse and install Eclipse IDE for java Developers
Step 2: Open file select new and create maven project
11
Step 3: Just Click next
Step 4: New Maven project select Maven-archetype-webapp Version 1.4 .
Step 5: Click Next
12
Step 6: Creating maven-archetype-webapp At 33%
completion it will ask Y :: y type y and it
will continue the process
13
Step 7: It Shows Build Success
Step 8: Click app1 -> src -> main -> webapp -> WEB –INF
14
Step 9: Right click on WEB-INF select new and click on file
Step 10: create new file and click finish
15
Step 11: Create a simple HTML program
Step 12: Run html program in web browser
16
17
RESULT:
Thus regression tests using Maven Build pipeline in Azure done successfully.
18
[Link] INSTALL JENKINS IN CLOUD
Date:
AIM:
To install Jenkins in Cloud.
PROCEDURE:
Step:1 Download Jenkins from jenkins official page
Note: Java JDK version must be 11 / 17/ 21 to install Jenkins on windows
Step:2 Click the downloaded file and run as administrator
19
Step:3 Click next to install
Step:4 Enter service credentials for the service and click next.
20
Step:5 Choose a port for the service and click next
Step:6 Select java home directory and click next
21
Step:7 Select the features to be installed and click
Step:8 Click install to begin the installation
22
Step:9 Click finish the button to exit the setup
Step:10 Goto google and search locolhost 8080
23
Step:11 Opening localhost 8080
Step:12 Unlock jenkins
24
Step:13 Goto jenkins folder and search for intial admin password
Step:14 Copy the password
25
Step:15 To unlock jenkins paste the password and click continue
Step:16 Click install suggested plugins
26
Step:17 plugins installation
Step:18 Create Admin User & click save and continue
27
Step:19 Configure jenkins & click save and continue
Step:20 Jenkins setup is complete & click start using jenkins
28
29
RESULT:
Thus installing Jenkins in Cloud done successfully.
30
D
31
[Link] CREATE CI PIPELINE USING JENKINS
Date:
AIM:
To create CI pipeline using Jenkins.
PROCEDURE:
Step1:Go to jenkins page using localhost 8080
Step 2: Enter an item name as Build and Click Freestyle project& click ok.
32
Step 3: From Configure click Build steps and scroll down the page.
Step 4: Click Execute windows batch command as shown below
33
Step 5: In command window give a message using echo and click apply and save.
Step 6: The below page will be generated after apply and save.
34
Step 7: The same PROCEDURE will be followed for creating Deploy [refer step 2 to step 6].
After creating Deploy the below page will be generated and click on the new item.
Step 8: Enter an item name as Test &click on freestyle project and click ok.
35
Step 9: Click apply and save.
Step 10: The below page will be generated after apply and save
36
Step 11: The same PROCEDURE will be followed for creating Release [refer test step 9, 10].
After creating Deploy the below page will be generated and click on the new item
Step 12: Click the Build item and Click on the Configure.
37
Step 13: Click the Build Steps in Execute Window batch command and click the Build other Projects on
drop down list.
Step 14: Click on the Post build actions in Build other project enter the Deploy as in next item name to
connect here and click the Trigger only if build is stable, Click apply and save.
38
Step 15: In Build item –>Downstream project ->Click Deploy.
Step 16: After clicking on the Deploy the below page will be displayed Upstream projects as Build.
39
Step 17: The same PROCEDURE will be followed for connecting the Test [refer step 12 to 16]. After
creating Deploy the below page will be generated and click on the new item, connecting the
below page is displayed. It shows Upstream project as Build and Downstream project as Test.
Step 18: After connecting all these items with each other the below page is display. Click the Release
item.
40
Step 19: Go to configure & click the Build Triggers ->Build after projects are built, Now in
“project to match” give the Test and click on the “Trigger only if build is stable”, Click apply and
save.
Step 20: After clicking the below page will be displayed the Test as upstream project. Click on the Test.
41
Step 21: After connecting all the items together below image will display. If we run the Build item the
connecting Deploy item will display on the Build Queue.
42
Step 22: Go to Mange Jenkins scroll down the page and click on plugins.
Step 23: Click on the Installed plugins and check the Pipeline and enable it.
43
Step 24: Go to Available plugins and install the Lockable Resources.
Step 25: After installing, the Pipeline Click on New item and Enter an item name as MyPipeline &
click on the Pipeline and click ok to finish.
44
Step 26 : After Creating the below page will displayed and click on the Pipeline in side bar
and Choose the Pipeline Script as Definition and Choose the Script default select the Hello world Program in
the drop down menu.
Step 27: After Clicking it the below page is display, Click on the Use Groovy Sandbox and Click Apply
and Save.
45
Step 28: After creating the Pipeline the below page is display and click on the run button to
run the program and open it.
Step 29: After opening the page the below page will display and Click on the Hello.
46
Step 30: After Clicking Hello the below page will displayed and click on the Logs.
Step 31: By clicking on the Logs the OUTPUT will display on the top of the screen like below image.
47
RESULT:
Thus, Creating CI pipelines using Jenkins done successfully.
48
[Link] CREATE A CD PIPELINE IN JENKINS AND DEPLOY IN CLOUD
Date:
AIM :
To create a Continuous Deployment (CD) pipeline using Jenkins for automating the deployment
of applications on a cloud platform, ensuring faster and reliable delivery of updates.
PROCEDURE :
Step 1: Set Up Jenkins
Install Jenkins on a server or use a cloud-hosted Jenkins instance.
Configure Jenkins by installing necessary plugins (e.g., Git, Pipeline, Cloud-
specific deployment plugins).
Create a Jenkins user with appropriate permissions. Step 2:
Prepare the Cloud Environment
Choose a cloud provider (e.g., AWS, Azure, GCP).
Set up the infrastructure required for deployment (e.g., virtual machines, Kubernetes
clusters, or app services).
Generate and securely store the cloud credentials (API keys, access tokens).
Step 3: Create a Jenkins Pipeline
Navigate to Jenkins and create a new pipeline project.
Define the pipeline stages in a Jenkinsfile using the following typical structure:
o Checkout Code: Pull code from the version control system (e.g., GitHub).
o Build: Compile and build the application (e.g., Maven, Gradle).
o Test: Run automated tests.
o Deploy: Deploy the application to the cloud environment. Step 4:
Write the Jenkinsfile
49
Example structure: pipeline {
agent any stages
{
stage('Checkout Code') { steps
{
git branch: 'main', url: '[Link]
}
}
stage('Build') { steps
{
sh 'mvn clean package'
}
}
stage('Test') {
steps {
sh 'mvn test'
}
}
stage('Deploy') {
steps {
sh 'aws deploy push --application-name AppName --s3-location
s3://bucket-name/'
}
}
}
}
Step 5: Integrate Jenkins with Cloud
50
Configure cloud provider plugins in Jenkins (e.g., AWS CLI, Azure DevOps).
Store the cloud credentials in Jenkins using the Credentials Manager.
Test connectivity between Jenkins and the cloud environment. Step 6 :
Trigger and Monitor the Pipeline
Start the pipeline manually or configure it to trigger on code commits or schedule.
Monitor each stage in the Jenkins dashboard for successful execution. Step 7:
Verify Deployment
Access the deployed application in the cloud environment.
Perform manual or automated tests to confirm the deployment was successful.
51
RESULT :
The experiment successfully demonstrates the creation of a Continuous Deployment
pipeline using Jenkins and its integration with a cloud platform.
52
[Link] CREATE AN EXPANSIBLE PLAYBOOK FOR A SIMPLE WEB
APPLICATION INFRASTRUCTURE
Date:
AIM :
To create an Ansible playbook for provisioning and configuring a basic web application
infrastructure, including a web server and database server, ensuring consistency and
automation in deployment.
PROCEDURE :
Step 1: Set Up Ansible
Install Ansible on a control node (e.g., Linux system).
Configure SSH access to managed nodes (web server and database server) by
setting up passwordless authentication using SSH keys.
Define the inventory file (hosts) to list the target nodes. Step 2:
Define the Infrastructure
Decide the components of the infrastructure:
o A web server (e.g., Nginx or Apache).
o A database server (e.g., MySQL).
Identify required software packages and configurations. Step 3:
Create an Inventory File
Example hosts file:
[web]
[Link]
[db]
[Link]
Step 4: Write the Ansible Playbook
Create a YAML file (e.g., web_app_playbook.yml).
Example playbook:
53
- name: Set up a simple web application infrastructure hosts:
all
become: yes tasks:
- name: Update the system apt:
update_cache: yes
upgrade: dist
- name: Install web server when:
"'web' in group_names" apt:
name: apache2 state:
present
- name: Copy website files when:
"'web' in group_names" copy:
src: /path/to/website/
dest: /var/www/html/
owner: www-data group:
www-data mode: '0644'
- name: Install database server
when: "'db' in group_names" apt:
-name: mysql-server state: present
- name: Start services service:
name: "{{ item }}" state:
started enabled: yes
with_items:
- apache2
- mysql Step 5:
54
Execute the Playbook
Run the playbook using the following command:
bash ansible-playbook -i hosts web_app_playbook.yml Step
6: Verify the Infrastructure
Check the web server by accessing the application in a browser using the web server’s
IP address.
Verify the database server by logging into MySQL and ensuring it is functional.
Step 7: Test and Validate
Test the web application for functionality.
Confirm the infrastructure meets the requirements and is consistent across the nodes.
55
RESULT :
The Ansible playbook successfully provisions and configures a simple web application
infrastructure.
56
[Link] BUILD A SIMPLE APPLICATION USING GRADLE
Date:
AIM:
Build a simple application using Gradle
PROCEDURE:
Step 1: Download gradle from official website
Step 2: Go to downloads and extract the gradle folder
57
Step 3: Extracted gradle folder
Step 4: Copy the bin path from gradle folder
58
Step 5: Search environment variable to edit the path
Step 6: Click environment variable
59
Step 7: Click new and paste the variable name & variable value as below
60
Step 8: In path click edit and paste gradle path
61
Step 9: Create a new folder in gradle
Step 10: Open command prompt in that folder refer below picture
62
Step 11: Command prompt opened
Step 12: Type the command gradle init and press enter .Now Select the type of project to generate and
we choose number 2 [application]
63
Step 13: Select the implementation language and we choose number 3 [Java]
Step 14: Type NO to generate multiple subprojects for application
64
Step 15: Select build script DSL and we choose 2 [Groovy]
Step16: Select test framework and we choose number 3 [Spock]
65
Step 17: Give project name as sample and enter
66
Step 18: Type NO to generate build using new APIs and it gives the Task: init and
display the message as BUILD SUCCESSFUL
Step 19: Now run gradle using the command gradle run
67
Step 20: It gives the OUTPUT as Hello World!
68
RESULT:
Thus, a simple application using Gradle was Build successfully.
69
Ex.N0:8 INSTALL ANSIBLE AND CONFIGURE ANSIBLE ROLES AND
Date: TO WRITE PLAYBOOKS
AIM:
To install Ansible ,Configure Ansible roles and to write playbooks
PROCEDURE:
Step 1: Install Cygwin64 Terminal:
Step 2: Cygwin Net Release setup program
70
Step 3: Here we choose the source
Step 4: Select root to install directory
71
Step 5: Select the local package directory
Step 6: Here select the your internet connection
72
Step 7: Choose a downloaded site
Step 8: Select packages to install
73
Step 9: Review and confirm changes
Step 10: Downloading
74
Step 11: installation complete
Step 12: The cygwin was installed successfully.
75
INSTALL ANSIBLE:
Step 13: Install Ansible in cygwin command prompt as pip install ansible
Step 14: Create Ansible roles Directory
Step 15: Using change directory command Create ansible roles
76
Step 16: Organize the role Structure
Step 17: Write Tasks And Handlers
Step 18: Create Ansible Playbooks Directory
77
Step 20: Run the program and we get the OUTPUT
78
RESULT:
Thus, installing ansible ,configure ansible roles and to write playbooks done successfully.
79
80