Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
147 views

SEPM Lab Manual Without Code

The document discusses three experiments related to DevOps principles and practices. Experiment 1 defines DevOps as the merging of development and operations teams and processes. It lists advantages like quicker development and deployment. Experiment 2 discusses version control systems like Git and setting up a local Git repository and GitHub account. Experiment 3 describes performing Git operations locally and remotely like add, commit, push and pull.

Uploaded by

heena.sheikh22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
147 views

SEPM Lab Manual Without Code

The document discusses three experiments related to DevOps principles and practices. Experiment 1 defines DevOps as the merging of development and operations teams and processes. It lists advantages like quicker development and deployment. Experiment 2 discusses version control systems like Git and setting up a local Git repository and GitHub account. Experiment 3 describes performing Git operations locally and remotely like add, commit, push and pull.

Uploaded by

heena.sheikh22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Department of Computer College of

Science & Engineering in SɅRɅSWɅTI Engineering


AIML

EXPERIMENT NO- 1

AIM: To understand DevOps: Principles, Practices, and DevOps Engineer Role and
Responsibilities.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, and Printout
Stationary

THEORY:

• Software development comprises of 2 departments.

1. Development team-plan, design and builds system.

2. Operations team-test and deployment

• Operations team gives feedback to development team of any bugs present in s/w.

• Development team -idle waiting for feedback from Operations team.

Problems-

-May extend timeline & delay entire software development cycle.

-May need weeks or months for final product

to be closed and final software to be developed.

Solution is DevOps-

• Dev (Software Development )+Ops (IT Operations).

1
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• a practice that aims at merging development, quality assurance, and operations into a
single, continuous set of processes.

• Advantages-

• excellent approach for quick development and deployment of applications.

• escalates business profit by decreasing software delivery time and transportation costs.

• improves customer experience and satisfaction.

• Examples of some of the tech-giants who have opted for DevOps-

1. Amazon

2. Netflix

2
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

3. Walmart

4. Facebook

5. Adobe

CONCLUSION: Thus, we have studied the DevOps: Principles, Practices, and DevOps Engineer
Role and Responsibilities.

MCQS/ VIVA QUESTIONS :

1. What is DevOps?

a) Developers performing operations

b) A small team of people that own everything related to a particular service

c) Developers and Operations team members working together

d) None of the above

2. When was DevOps introduced?

a) 1999 and 2000

b) 2003 and 2004

c) 2007 and 2008

d) 2010 and 2011

3. Who is the father of DevOps?

3
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a) Patrick Debois

b) Gene Kim

c) David Farley

d) Bridget Kravchenko

4. What is the full form of Devops?

a) Drive and Operations

b) Digital and Operations

c) Development And Operations

d) None of the above

5. What are the key components of DevOps?

a) Continuous Testing

b) Continuous Integration

c) Continuous Delivery & Monitoring

d) All of the above

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

4
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

EXPERIMENT NO- 2

AIM: To understand Version Control System / Source Code Management, install git and
create a GitHub account.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

Version Control System-

• Version Control System (VCS) is a software that helps software developers to work
together and maintain a complete history of their work.

• Ex- Git, Mercurial, CVS (Concurrent Version System)

• Purpose-

• Allow developers to work simultaneously.

• Does not overwrite each other’s changes.

5
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Maintain history of every version of everything. Previous version can be easily rolled
back.

CONCLUSION: Thus, we understood Version Control System / Source Code Management,


install git and create a GitHub account.

MCQS/ VIVA QUESTIONS :


1. Which of the following systems record changes to a file over time?
a) Record Control
b) Version Control
c) Forecast Control
d) None of the mentioned
2. Which of the following command line environment is used for interacting with Git?
a) GitHub
b) Git Bash
c) Git Boot
d) All of the mentioned
3. Git is a _____
a) Distributed version control system
b) Centralized version control system
c) Localized version control system
d) All of the above.

4. A repository is a file structure where git stores all the project-based files.
a) TRUE
b) FALSE

6
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

c) Can be true or false


d) Can not say

5. What is true about GIT?


a)Git is open-source
b) Git is an example of distributed version control system
c) Used for handling the development of small and large projects
d) All of the above

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

EXPERIMENT NO- 3

AIM: To perform various Git operations on Local and Remote repositories using Git Cheat-
sheet.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

• Working Directory- File in working directory can be :

1. Tracked-files that Git knows about

7
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

2. Untracked- a new file.

• Staging area-

changes to be included in

next commit.

• Local repository

• Remote repository

• Check version- $git --version

• User is defined by-

$ git config --global user.name “mitrakshi”

$ git config --global user.email “mitrakshi.patil@it.sce.edu.in”

$ mkdir Firstrepo

$ cd Firstrepo

8
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

$ git init

touch a.txt

$ notepad a.txt OR $ cat>>a.txt

$ git status //displays status of working directory & staging area.

$ git add a.txt // adds a file to the staging area

$ git commit –m “added a.txt”

$ git log //history of all events

Open GitHub account

Create a new directory “FirstRepo”

9
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Copy the ‘git remote add origin URL

10
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• $ git remote add origin https://github.com/Mitrakshi/ FirstRepo.git

$ git push –u origin master

• ext, Refresh the GitHub page and u can find all commits here. Each commit has a hash
ID.

• GIT PULL- used to download Remote repository into Local one.

• Make a new directory.

$mkdir GitDemoPulled

$cd GitDemoPulled

$git init

11
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Go to your GitHub, go to the repository and then to the clone or download option, and
copy the URL.

• paste the URL with Git pull command.

$ git pull https://github.com/mitrakshipatil/GitDemo.git

CONCLUSION: Thus, we have performed various Git operations on Local and Remote
repositories using Git Cheat-sheet.

MCQS/ VIVA QUESTIONS :

1. Which of the following command line environment is used for interacting with Git?
a) GitHub
b) Git Bash
c) Git Boot
d) All of the mentioned

2. Which of the following command allows you to change directory to one level above
your parent directory?
a) cd
b) cd.
c) cd..
d) none of the mentioned

3. Which of the following is not true about git?

12
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a) By default Bit has a master branch.


b) Git clone operation creates the instance of the repository.
c) Pull operation copies the changes from a local repository to remote repository.
d) All of the above.

4. The files that are committed are always present in git


a) Working directory
b) Staging area
c) Unstages area
d) Anywhere.
a) The _________ command is a convenient way to set configuration options for defining
the behavior of the repository, user information and preferences, git installation-
based configurations, and many such things
a) git head
b) git conflict
c) git status
d) git config

REFERENCES :

4. https://nptel.ac.in/courses/128106012
5. https://www.edureka.co/devops-certification-training
6. https://www.coursera.org/professional-certificates/devops-and-software-engineering

EXPERIMENT NO- 4

AIM: To understand Continuous Integration, install Jenkins.

13
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

• Continuous Integration-In a large project with many developers, commits are made
many times during a day.

• With each commit, code is built and tested.

• If the test is passed, build is tested for deployment.

• If the deployment is a success, the code is pushed to Production.

• This commit, build, test, and deploy is a continuous process, and hence the name
continuous integration/deployment.
• Open source, Continuous integration DevOps Tool

• Written in Java

• Jenkins-

• Jenkins installation Steps-


1. In Google, type install jdk 11. Click on the first link.
2. Set environment variables for jdk.
• Go to system properties, under Advanced tab, click environment variables.
3.Add new variable java_jdk and set its path.

14
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• 5.Open command prompt, Type java -version.

• Java is successfully installed.

6. Install Jenkins on windows.


• Open Google, type install Jenkins. Click on the first link.

15
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Complete the installation process.

16
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

17
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

7. Open web browser.

Type localhost:8080 to open Jenkins.


Enter the administrative password.
Administrative password can be found after following the path mentioned.

8. Install suggested plugins.

18
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

CONCLUSION: Thus, we have understood Continuous Integration, install Jenkins.

MCQS/ VIVA QUESTIONS :

1. What are the advantages of Jenkins?

19
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a) At integration stage, build failures are cached


b) For each code commit changes an automatic build report notification
generates
c) To notify developers about build report success or failure, it is integrated with
LDAP mail server
d) All of the above

2. What are the useful plugins in Jenkin?

a) Maven 2 project

b) Amazon EC2

c) HTML publisher

d) All

3. Which of below is not a dependency management tool?


a) Ant
b) Maven
c) Gradle
d) Jenkins

4. What is the use of Jenkins ?


a) Continuous Monitoring tool
b) Continuous Integration tool
c) Version Control System tool
d) Continuous Testing tool

20
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

5. Mention some of the useful plugins in Jenkin___________


a) Copy artifact
b) HTML publisher
c) All of the above
d) None of the above

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

EXPERIMENT NO- 5

AIM: To create & build a job and integrate Github with Jenkins.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

21
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

1. Run Jenkins on localhost-

Open browser & type “localhost:8080”

2. Enter the credentials & log in.

3. Jenkins Server interface will be opened.

• New Item- Create new project

• Build History- Check status of the builds.

• Manage system- configuration of the system.

Select New Item. Name it.

Choose Freestyle Project & click OK.

4. . Build & run a job on Jenkins-

Give description & then in Build Steps -add build step-Execute Windows batch command.

5. Apply and Save.

CONCLUSION: Thus, we have created & built a job and integrate Github with Jenkins.

MCQS/ VIVA QUESTIONS :

1. Which programming language is used to write Jenkins?

a. Java

b. Python

22
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

c. Ruby

d. JavaScript

2. Which of the following is not a core component of Jenkins?

a.Jenkins Master

b. Jenkins Slave

c. Jenkins Node

d. Jenkins Client

3.What is a Jenkinsfile?

a. A file that defines the build process in Jenkins

b. A file that contains the code for a Jenkins plugin

c. A file that contains the Jenkins configuration

d. A file that contains the results of a Jenkins build

4. What is the Jenkins workspace?

23
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a. The directory where Jenkins is installed

b. The directory where Jenkins stores configuration data

c. The directory where Jenkins stores build artifacts

d. The directory where Jenkins stores log files

5. Which of the following is not a Jenkins plugin?

a. Git

b. Maven

c. Jenkinsfile

d. Slack

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

24
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

EXPERIMENT NO- 6

AIM: To build the pipeline of jobs using Jenkins & to configure Jenkins with Maven to set up
a build job.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

• Jenkins Pipeline-
• Pipeline - a series of events or tasks which are interconnected in a particular order.

• Instead of creating multiple jobs for each process, it allows us to code the entire
workflow and place it in a Jenkins file.
• How to create pipeline in Jenkins


• Enter job name in Description.

25
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML


• Under pipeline tab, enter the following code.

pipeline {

agent any

stages {

stage('Build') {

steps {

//

stage('Test') {

steps {

//

stage('Deploy') {

26
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

steps {

//

}
• 3 main attributes of Jenkins pipeline -

• Pipeline: pipeline declaration must be written on the top level of the program. The
pipeline syntax will start from here.

• Agent: just below the pipeline. It (agent any) tells that the current build is going to
execute on any of the Jenkins agents.

• Stages: Inside the stages, we can define several stages with the name, which consist of
steps regarding jobs. Usually, there are 3-stages, which are as follows:

• Build

• Test

• Deploy

27
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

CONCLUSION: Thus, we have built the pipeline of jobs using Jenkins & to configure Jenkins with
Maven to set up a build job.

MCQS/ VIVA QUESTIONS :

1. Which environment variable is used to specify the path to maven?


a) JAVA_HOME
b) PATH
c) MAVEN_HOME
d) CLASSPATH
2. Which command can be used to check maven version?
a) mvn -ver
b) maven -ver
c) maven -version
d) mvn –version
3. What is a pipeline in Jenkins?

a. A set of plugins that provide additional functionality to Jenkins

b. A series of automated steps that build, test, and deploy software

c. A graphical user interface for managing Jenkins

d. A feature that allows users to create and manage Jenkins jobs

4. What is the Jenkins Global Tool Configuration?

28
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a. A feature that allows users to configure global settings in Jenkins


b. A plugin that provides additional functionality to Jenkins
c. A tool used to manage the installation of software on Jenkins nodes
d. A tool used to manage the distribution of work to Jenkins slaves

5. What is the Jenkins Pipeline Syntax?

a. A syntax used to define the build process in Jenkins

b. A syntax used to define the configuration of Jenkins

c. A syntax used to define the structure of Jenkins plugins

d. A syntax used to define the communication protocols used by Jenkins

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

29
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

EXPERIMENT NO- 7

AIM: To understand Docker Architecture and Container Life Cycle, install Docker.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

Docker-

• OS-level virtualization software platform that helps users in building and managing
applications in the Docker environment with all its library dependencies.

• Used to easily develop applications, ship them into containers which can then be
deployed anywhere.

• Advantages -

• Docker containers are lightweight.

• uses less memory.

30
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Docker containers can be deployed anywhere, on any physical and virtual machines and
even on the cloud.

Architecture-

• Client server archi.

• 3 main components that are Docker Client, Docker Host, and Docker Registry.

1. Docker Client

• uses commands and REST (Representational State Transfer) APIs to communicate with
Docker Daemon (Server).

• Docker Client uses Command Line Interface (CLI) to run the following commands -
• docker build
• docker pull
• docker run
2. Docker Host

• used to provide an environment to execute and run applications.

31
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

Docker daemon –Listens for Docker API requests & manages Docker objects like images,
containers etc. Daemon can also communicate with other daemons to manage Docker services.

Docker Image-

• In Docker, everything is based on Images.

• An image is a read-only binary template with instructions for creating a Docker


container.

• Docker uses a private container registry to share container images within the enterprise
and also uses public container registry to share container images within the whole world.
Container-

• The basic purpose of Docker is to run containers.

• A container is a runnable instance of an image that can be run using the Docker run
command.

• A container packages up code and its dependencies so the application runs quickly and
reliably from one computing environment to another.

• A Docker container image is a lightweight, standalone, executable package of software


that includes everything needed to run an application: code, runtime, system tools,
system libraries and settings.

3. Docker Registry- manages and stores the Docker images.

• 2 types of registries –

• Pubic Registry - also called as Docker hub.

• Private Registry -used to share images within the enterprise.

32
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Press ‘Windows+R’ or open ‘Run’.

• Type ‘winver’

33
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Right click on Windows Toolbar(horizontal bar) & click on ‘Task Manager’

• Click on ‘Performance’

34
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

35
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

CONCLUSION: Thus, we have understood Docker Architecture and Container Life Cycle, install
Docker.

MCQS/ VIVA QUESTIONS :

1. What is Docker?
a) A containerization platform

36
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

b) A virtual machine platform


c) A cloud computing platform
d) A programming language
2.What is the primary advantage of using Docker?

a) Improved application security

b) Improved application performance

c) Improved application portability

d) Improved application scalability

3.What is a Docker image?

a)A running container

b) A snapshot of a container

c) A blueprint for a container

d) A configuration file for a container

4. What is a Docker container?

37
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a) A running instance of a Docker image

b) A snapshot of a Docker image

c) A blueprint for a Docker image

d) A configuration file for a Docker image

5. What is the purpose of Docker Desktop?

A) To provide an easy-to-install Docker environment for Windows and Mac OS

B) To manage Docker images

C) To manage Docker containers

D) To manage Docker networks

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

38
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

EXPERIMENT NO- 8

AIM: To execute docker commands to manage images and interact with containers.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

Docker Commands-

Example-

$ docker run hello-world

cmd-3 parts.

1) docker: It is docker engine and used to run docker program. It tells to the operating system
that you are running docker program.

2) run: This subcommand is used to create and run a docker container.

3) hello-world: It is a name of an image. You need to specify the name of an image which is to
load into the container.

39
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

1. docker –version

This command is used to get the currently installed version of docker

2. docker pull

Usage: docker pull <image name>

This command is used to pull images from the docker repository(hub.docker.com)


3. docker run- runs a command in a new container, pulling the image if needed and starting
the container.

4. docker ps

This command is used to list the running containers

5. docker ps -a

This command is used to show all the running and exited containers
6. docker exec

Usage: docker exec -it <container id> bash

This command is used to access the running container

Get out of docker-CTRL+D

7. docker stop

Usage: docker stop <container id>

This command stops a running container


8. docker kill

Usage: docker kill <container id>

This command kills the container by stopping its execution immediately. The difference
between ‘docker kill’ and ‘docker stop’ is that ‘docker stop’ gives the container time to

40
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

shutdown gracefully, in situations when it is taking too much time for getting the container to
stop, one can opt to kill it

9. docker commit

Usage: docker commit <conatainer id> <username/imagename>

This command creates a new image of an edited container on the local system

10. docker login

This command is used to login to the docker hub repository


11. docker push

Usage: docker push <username/image name>

This command is used to push an image to the docker hub repository

12. docker images

This command lists all the locally stored docker images


13. docker rm

Usage: docker rm <container id>

This command is used to delete a stopped container

14. docker rmi

Usage: docker rmi <image-id>

This command is used to delete an image from local storage

15. docker build

Usage: docker build <path to docker file>

This command is used to build an image from a specified docker file.

CONCLUSION: Thus, we have executed docker commands to manage images and interact with
containers.

41
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

MCQS/ VIVA QUESTIONS :

1.What is the purpose of a Docker registry?

a) To store Docker images

b) To store Docker containers

c) To manage Docker networks

d) To manage Docker volumes

2.What is Docker Compose?

a) A tool for managing multiple Docker containers

b) A tool for managing Docker images

c) A tool for managing Docker networks

d) A tool for managing Docker volumes

3.What is the default Docker registry?

42
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a) Docker Hub

b) Docker Store

c) Docker Cloud

d) Docker Repository

4.What is the difference between a Docker image and a Docker container?

a) A Docker image is a blueprint for a container, while a container is a running instance of

an image.

b) A Docker image is smaller than a container.

c) A Docker image is faster than a container.

d) A Docker image is used for temporary data, while a container is used for persistent data)

5. What is the purpose of Docker Hub?

a) To store and distribute Docker images

b) To manage Docker containers

c) To manage Docker networks

d) To manage Docker volumes

43
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

EXPERIMENT NO- 9

44
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

AIM: To learn Dockerfile instructions, build an image for a sample Java application using
Dockerfile.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

Docker Dockerfile

A Dockerfile is a text document that contains commands that are used to assemble an image.
We can use any command that call on the command line. Docker builds images automatically
by reading the instructions from the Dockerfile.

Dockerfile Instructions

-not case-sensitive but recommended to use uppercase.

1. FROM - used to set the Base Image for the subsequent instructions.

A valid Dockerfile must have FROM as its first instruction.

FROM <image name>:<tag name>

2. RUN - used to run specified commands. used to execute any command of the current image.

3. CMD-used to execute application by the image.

CMD ["executable", "param1", "param2"?]

There can be only one CMD in a Dockerfile. If we use more than one CMD, only last one will
execute.

45
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

4. WORKDIR- We can specify our working directory inside the container using the WORKDIR
instruction. Any other instruction after that in the dockerfile, will be executed on that particular
working directory only.

WORKDIR /usr/src/app

Sets the working directory to /usr/src/app inside the container.

5.COPY - allows to copy a directory to the docker container.

Let us create a Java application & build an image for the same-.

6. Create a java Program.

7. Execute it.

8. Check whether openjdk is provided by docker by searching in docker hub.

9. Create a Dockerfile (text file) at same location.

10. Build the Dockerfile -

• Go to cmd promt.

• Type-

docker build –f Dockerfile.txt –t <image-name> .

CONCLUSION: Thus, we have learnt Dockerfile instructions, build an image for a sample Java
application using Dockerfile.

46
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

MCQS/ VIVA QUESTIONS :

1.What is a Dockerfile?

a) A configuration file for a Docker container

b) A configuration file for a Docker image

c) A configuration file for a Docker network

d) A configuration file for a Docker volume

2.What is the purpose of a Dockerfile?

a) To define a Docker image

b) To define a Docker container

c) To manage Docker volumes

d) To manage Docker networks

3.What is the purpose of the ENTRYPOINT instruction in a Dockerfile?

47
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a) To specify the command that should be run when a container is started

b) To specify the base image for the Dockerfile

c) To specify the user that should run the container

d) To specify the working directory for the container

4. What is the purpose of the CMD instruction in a Dockerfile?


a) To provide default arguments for the ENTRYPOINT command
b) To specify the base image for the Dockerfile
c) To specify the user that should run the container
d) To specify the working directory for the container

5. What is the purpose of Docker exec?

a) To run a command inside a running Docker container

b) To manage Docker images

c) To manage Docker containers

d) To manage Docker networks

REFERENCES :

1. https://nptel.ac.in/courses/128106012

48
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

EXPERIMENT NO- 10

AIM: To understand Configuration Management & to study various Configuration


Management tools.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

Configuration Management-

• System administrators regularly & repeatedly do many tasks like- Installing OS, setting
up users, copying files, installing packages, etc.

• Process of maintaining software and computer systems like networks, servers, storage
in configured, desired, and consistent state.

49
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

• Works on- Infrastructure as a code-writing code that allows us to state what we want
to happen. The infrastructure-as-code is written once and can be run on hundreds of
thousands of servers and each machine will be setup exactly as the same as all the
others.

• 2 types of Confi. Mgmt approaches-

1. Push Approach

2. Pull Approach

• 4 famous confi. Mgmt tools -

Ansible, Saltstack-Push based confi. Mgmt tools

Chef & Puppet -Pull Confi. Based tool

Difference among Puppet, Ansible, Chef & Saltstack-

CONCLUSION: Thus, we have understood Configuration Management & to study various


Configuration Management tools.

50
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

MCQS/ VIVA QUESTIONS :


1. Ansible is a?
a) Configuration Management and Deployment tool
b) Configuration Deployment tools
c) Continuous Integration tool
d) Continuous Monitoring tool

2. Ansible is written in which language?

a) Ruby
b) Python
c) Perl
d) Java

a) The task that is not a part of Software Configuration Management (SCM) is ______
a) Change control
b) Version control
c.)Configuration status reporting
d ) None of the above

3. Which of the following combines procedures and tools to manage different versions of
configuration objects that are created during the software process?
a) Configuration status reporting.
b) Version control
c) Change control
d) None of the above
e) None of these

51
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

4. What is the difference between Ansible and Puppet?

a) Ansible is written in Python, while Puppet is written in Ruby

b) Ansible uses push-based configuration management, while Puppet uses pull-based

configuration management

c) Ansible has a smaller learning curve, while Puppet has a steeper learning curve

d) All of the above

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

EXPERIMENT NO- 11

AIM: Content Beyond Syllabus- Install Bit Install Bitbucket Server on Windows.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

52
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

THEORY:

• Install Bitbucket Server-

1. Download Bitbucket Server

Download the installer - www.atlassian.com/software/bitbucket/download.

2. Run the installer

1. Run the installer. We recommend using a Windows administrator account.


2. Follow the prompts to install Bitbucket. You'll be asked for the following info:
a. Type of Bitbucket instance - the type of installation, for these instructions
select Standard.
b. Installation directory - where Bitbucket will be installed.
c. Home directory - where Bitbucket application data will be stored.
d. TCP ports - the HTTP connector port and control port Bitbucket will run on.
3. Once the installer completes launch Bitbucket in a browser.

• Set up Bitbucket

The Setup Wizard runs automatically when you visit Bitbucket Server in your browser the first
time.

3. Connect to your database

1. If you've not already done so, it's time to create your database.

Select External as your database, then choose a Database Type from the dropdown menu and
enter the details of your database.

53
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

4. Add your license key

5. Create your administrator account

1. Enter details for the administrator account.


2. Select either Go to Bitbucket to go straight to the Bitbucket interface or Integrate with
Jira to create your connection with an existing Jira application.

6. Start using Bitbucket Server


That's it! Your Bitbucket site is accessible from a URL like this:
http://<computer_name_or_IP_address>:<port>

CONCLUSION: Thus, we have installed Bit Install Bitbucket Server on Windows.

MCQS/ VIVA QUESTIONS :

1. Bitbucket is a?

a) Centralized VCS

b) Distributed VCS

c) web-based version control repository hosting service

d) None of the above

2. Which is better GitHub or BitBucket?

54
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

a)GitHub

b) BitBucket

c)Both

d)None

3. Is bitbucket a DevOps tool?

a) Yes

b) No

4. Why bitbucket is used?

a)gives you a central place to manage git repositories

b)collaborate on your source code and guides us through the development flow

c)All of the above

d) None of the above

5. Bitbucket provides _______

a) Public repositories

b)Private repositories

c) Public & Private repositories

55
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

d)None

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

56
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

EXPERIMENT NO- 12

AIM: Virtual Lab on Estimation of Project Metrics.

RESOURCES REQUIRED: Pentium IV & above, Browser, Internet, Printer, Printout Stationary

THEORY:

57
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

58
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

59
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

CONCLUSION: Thus, we have studied the estimation of project metrics.

MCQS/ VIVA QUESTIONS :

1. In size oriented metrics, metrics are developed based on the


___________________
a) number of Functions
b) number of user inputs
c) number of lines of code
d) amount of memory usage

2. Which of the following is not an information domain required for determining


function point in FPA ?
a) Number of user Input
b) Number of user Inquiries

60
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

c) Number of external Interfaces


d) Number of errors

3. How many Information Domain Values are used for Function Point
Computation?
a) three
b) four
c) five
d) six

4. Function Point Computation is given by the formula


a) FP = [count total * 0.65] + 0.01 * sum(Fi)
b) FP = count total * [0.65 + 0.01 * sum(Fi)].
c) FP = count total * [0.65 + 0.01] * sum(Fi)
d) FP = [count total * 0.65 + 0.01] * sum(Fi)

5. Function Points in software engineering was first proposed by


a) Booch
b) Boehm
c) Albrecht
d) Jacobson

REFERENCES :

1. https://nptel.ac.in/courses/128106012
2. https://www.edureka.co/devops-certification-training
3. https://www.coursera.org/professional-certificates/devops-and-software-engineering

61
SɅRɅSWɅTI
Department of Computer College of
Science & Engineering in SɅRɅSWɅTI Engineering
AIML

62
SɅRɅSWɅTI

You might also like