Practical No. 1
AIM: To study and implement Linux Commands
SOFTWARE REQUIRED: Operating System THEORY:
Basic Linux Commands:
pwd command
Use the pwd command to find out the path of the current working directory (folder) you’re in. The command will return an absolute (full) path, which is basically a path of all the directories that starts with a forward slash (/). An example of an absolute path is /home/username.
cd command
To navigate through the Linux files and directories, use the cd command. It requires either the full path or the name of the directory, depending on the current working directory that you’re in. Let’s say you’re in /home/username/Documents and you want to go to Photos, a subdirectory of Documents. To do so, simply type the following command:
cd Photos.
Another scenario is if you want to switch to a completely new directory, for example,/home/username/Movies. In this case, you have to type cd followed by the directory’s absolute path: cd /home/username/Movies.
There are some shortcuts to help you navigate quickly:
cd .. (with two dots) to move one directory up
cd to go straight to the home folder
cd- (with a hyphen) to move to your previous directory
On a side note, Linux’s shell is case sensitive. So, you have to type the name’s directory exactly as it is.
ls command The ls
command is used to view the contents of a directory. By default, this command will display the contents of your current working directory.
If you want to see the content of other directories, type ls and then the directory’s path. For example, enter ls /home/username/Documents to view the content of Documents.
There are variations you can use with the ls command:
ls -R will list all the files in the sub-directories as well
ls -a will show the hidden files
ls -al will list the files and directories with detailed information like the permissions, size, owner, etc.
cat command cat
(short for concatenate) is one of the most frequently used commands in Linux. It is used to list the contents of a file on the standard output (stdout). To run this command, type cat followed by the file’s name and its extension. For instance: cat file.txt.
Here are other ways to use the cat command:
cat > filename creates a new file
cat filename1 filename2>filename3 joins two files (1 and 2) and stores the output of them in a new file (3)
to convert a file to upper or lower case use, cat filename | tr a-z A-Z >output.txt
cp command
Use the cp command to copy files from the current directory to a different directory. For instance, the command cp scenery.jpg /home/username/Pictures would create a copy of scenery.jpg (from your current directory) into the Pictures directory.
mv command
The primary use of the mv command is to move files, although it can also be used to rename files.
The arguments in mv are similar to the cp command. You need to type mv, the file’s name, and the destination’s directory. For example: mv file.txt /home/username/Documents.
To rename files, the Linux command is mv oldname.ext newname.ext
mkdir command Use mkdir
command to make a new directory — if you type mkdir Music it will create a directory called Music.
There are extra mkdir commands as well:
To generate a new directory inside another directory, use this Linux basic command mkdir Music/Newfile
use the p (parents) option to create a directory in between two existing directories. For example, mkdir -p Music/2020/Newfile will create the new “2020” file.
rmdir command
If you need to delete a directory, use the rmdir command. However, rmdir only allows you to delete empty directories.
rm command
The rm command is used to delete directories and the contents within them. If you only want to delete the directory — as an alternative to rmdir — use rm -r.
Note: Be very careful with this command and double-check which directory you are in. This will delete everything and there is no undo.
touch command
The touch command allows you to create a blank new file through the Linux command line. As an example, enter touch /home/username/Documents/Web.html to create an HTML file entitled Web under the Documents directory.
locate command
You can use this command to locate a file, just like the search command in Windows. What’s more, using the -i argument along with this command will make it case-insensitive, so you can search for a file even if you don’t remember its exact name.
To search for a file that contains two or more words, use an asterisk (*). For example, locate -i school*note command will search for any file that contains the word “school” and “note”, whether it is uppercase or lowercase.
find command
Similar to the locate command, using find also searches for files and directories. The difference is, you use the find command to locate files within a given directory.
As an example, find /home/ -name notes.txt command will search for a file called notes.txt within the home directory and its subdirectories.
Other variations when using the find are:
To find files in the current directory use, find . -name notes.txt
To look for directories use, / -type d -name notes. txt
grep command
Another basic Linux command that is undoubtedly helpful for everyday use is grep. It lets you search through all the text in a given file.
To illustrate, grep blue notepad.txt will search for the word blue in the notepad file. Lines that contain the searched word will be displayed fully.
sudo command
Short for “SuperUser Do”, this command enables you to perform tasks that require administrative or root permissions. However, it is not advisable to use this command for daily use because it might be easy for an error to occur if you did something wrong.
df command
Use df command to get a report on the system’s disk space usage, shown in percentage and KBs. If you want to see the report in megabytes, type df -m.
du command
If you want to check how much space a file or a directory takes, the du (Disk Usage) command is the answer. However, the disk usage summary will show disk block numbers instead of the usual size format. If you want to see it in bytes, kilobytes, and megabytes, add the -h argument to the command line.
head command
The head command is used to view the first lines of any text file. By default, it will show the first ten lines, but you can change this number to your liking. For example, if you only want to show the first five lines, type head -n 5 filename.ext.
tail command
This one has a similar function to the head command, but instead of showing the first lines, the tail command will display the last ten lines of a text file. For example, tail -n filename.ext.
diff command
Short for difference, the diff command compares the contents of two files line by line. After analyzing the files, it will output the lines that do not match. Programmers often use this command when they need to make program alterations instead of rewriting the entire source code.
The simplest form of this command is diff file1.txt file2.ext
tar command
The tar command is the most used command to archive multiple files into a tarball — a common Linux file format that is similar to zip format, with compression being optional.
This command is quite complex with a long list of functions such as adding new files into an existing archive, listing the content of an archive, extracting the content from an archive, and many more. Check out some practical examples to know more about other functions.
chmod command
chmod is another Linux command, used to change the read, write, and execute permissions of files and directories. As this command is rather complicated, you can read the full tutorial in order to execute it properly.
chown command
In Linux, all files are owned by a specific user. The chown command enables you to change or transfer the ownership of a file to the specified username. For instance, chown linuxuser2 file.ext will make linuxuser2 as the owner of the file.ext.
jobs command
jobs command will display all current jobs along with their statuses. A job is basically a process that is started by the shell.
kill command
If you have an unresponsive program, you can terminate it manually by using the kill command. It will send a certain signal to the misbehaving app and instructs the app to terminate itself.
There is a total of sixty-four signals that you can use, but people usually only use two signals:
SIGTERM (15) — requests a program to stop running and gives it some time to save all of its progress. If you don’t specify the signal when entering the kill command, this signal will be used.
SIGKILL (9) — forces programs to stop immediately. Unsaved progress will be lost.
Besides knowing the signals, you also need to know the process identification number (PID) of the program you want to kill. If you don’t know the PID, simply run the command ps ux.
After knowing what signal you want to use and the PID of the program, enter the following syntax:
kill [signal option] PID.
ping command
Use the ping command to check your connectivity status to a server. For example, by simply entering ping google.com, the command will check whether you’re able to connect to Google and also measure the response time.
wget command
The Linux command line is super useful — you can even download files from the internet with the help of the wget command. To do so, simply type wget followed by the download link.
uname command The
Command, short for Unix Name, will print detailed information about your Linux system like the machine name, operating system, kernel, and so on.
top command
As a terminal equivalent to Task Manager in Windows, the top command will display a list of running processes and how much CPU each process uses. It’s very useful to monitor system resource usage, especially knowing which process needs to be terminated because it consumes too many resources.
history command
When you’ve been using Linux for a certain period of time, you’ll quickly notice that you can run hundreds of commands every day. As such, running history command is particularly useful if you want to review the commands you’ve entered before.
man command
Confused about the function of certain Linux commands? Don’t worry, you can easily learn how to use them right from Linux’s shell by using the man command. For instance, entering man tail will show the manual instruction of the tail command.
echo command
This command is used to move some data into a file. For example, if you want to add the text, “Hello, my name is John” into a file called name.txt, you would type echo Hello, my name is John >> name.txt
zip, unzip command
Use the zip command to compress your files into a zip archive, and use the unzip command to extract the zipped files from a zip archive.
hostname command
If you want to know the name of your host/network simply type hostname. Adding a -i to the end will display the IP address of your network.
useradd, userdel command
Since Linux is a multi-user system, this means more than one person can interact with the same system at the same time. useradd is used to create a new user, while passwd is adding a password to that user’s account. To add a new person named John type, useradd John and then to add his password type, passwd 123456789.
To remove a user is very similar to adding a new user. To delete the users account type, userdel UserName
Conclusion::
In this way we have studied and implemented the Linux Commands.
Practical No. 2
AIM: To study practical on the installation of java, Tomcat Server SOFTWARE REQUIRED: Java SE, JDK, Tomcat, VS Code
THEORY:
Java
Java is a programming language and a platform.
Programming language: Java is high-level, object-oriented, class-based, concurrent, secured and general-purpose computer-programming language. It is a widely used robust technology.
Platform: Any hardware or software environment in which a program runs, is known as a platform. Since Java has a runtime environment (JRE) and API, it is called a platform.
Steps for installing java:
Go to the download page of J2SE Version 1.4.2.
Select the version for Windows and click through the license acceptance. After two pages, you will be able to download the EXE file for installing java on windows. Look for the SDK version.
Download and run the EXE installation program.
You will need to accept the license agreement again.
Use the suggested directory for installing java (C:\j2sdk1.4.2_01).
You may use the remaining default settings for the installation.
Setting the Java Environment Variable
Tomcat will need to know where you have installed java. To do this, you will need to set the environment variable JAVA_HOME to C:\j2sdk1.4.2_01 (where you installed java).
Open the control panel under the start menu.
Double-click on System.
Click on the Advanced tab.
Click on the Environment Variables button.
Under System Variables, click on the New button.
For variable name, type: JAVA_HOME
For variable value, type: C:\j2sdk1.4.2_01
Continue to click OK to exit the dialog windows.
Apache Tomcat
Apache Tomcat is a webcontainer which allows to run servlet and JavaServer Pages (JSP) based web applications. Most of the modern Java web frameworks are based on servlets, e.g. JavaServer Faces, Struts, Spring.
Apache Tomcat also provides by default a HTTP connector on port 8080, i.e., Tomcat can also be used as an HTTP server. But the performance of Tomcat is not as good as the performance of a designated web server, like the Apache HTTP server.
Installation:
Go to the Tomcat Web page.
Click on Binaries under the Download label on the left side of the page.
Scroll down until you see Tomcat 4.1.x. (x will be some number greater than 10).
Click on the link ending with exe (e.g. 4.1.27 exe).
Download and run the exe file.
I suggest you install Tomcat at c:\tomcat4
Use the default settings and provide a password that you will remember.
Running Tomcat
Here are the steps to see if Tomcat has been successfully installed
Start Tomcat by finding its start program in the Programs Menu (located in the Start menu). Look under Apache Tomcat 4.1 and select "Start Tomcat".
Open a Web browser and type in the following URL:
http://localhost:8080/
At this point, you should see the Tomcat home page, which is provided by the Tomcat Web server running on your computer. Note: if your computer has an internet name or an IP number, you may access your Tomcat server anywhere on the internet by substituting localhost with the full name or IP number.
To shut down your server and remove the Console window, select "Stop Tomcat" in the same menu where you selected "Stop Tomcat".
. Set CLASSPATH
Since servlets and JSP are not part of the Java 2 platform, standard edition, ve to identify the servlet classes to the compiler. Here are the standard Tomcat locations:
Tomcat 4: c:\tomcat4\common\lib\servlet.jar
Put the development directory in the CLASSPATH. include "." (the current directory) in the CLASSPATH.
Here are two representative methods of setting the CLASSPATH. They assume that your development directory is C:\Servlets+JSP. Replace install_dir with the actual base installation location of the server. Also, be sure to use the appropriate case for the filenames, and enclose your pathnames in double quotes if they contain spaces.
Windows 98/Me. Use the autoexec.bat file.
Tomcat 4
Code:
Sample file to download and modify: autoexec.bat
Enable the Invoker Servlet
The invoker servlet lets you run servlets without first making changes to your Web application's deployment descriptor (i.e., the WEB-INF/web.xml file). Instead, you just drop your servlet into WEB-INF/classes and use the URL http://host/servlet/ServletName (or http://host/webAppName/servlet/ServletName once you start using your own Web applications). The invoker servlet is extremely convenient when you are learning and even when you are doing your initial development. To enable the invoker servlet, uncomment the following servlet-mapping element in c:\tomcat4\conf\web.xml. Also, do not confuse this Apache Tomcat-specific web.xml file with the standard one that goes in the WEB-INF directory of each Web application. Finally, remember to make a backup copy of the original version of this file before you make the changes.
CONCLUSION:
Practical No. 3
AIM: To study practical on Software Development Life Cycle and DevOps LifeCycle & Stages
SOFTWARE REQUIRED: Operating System THEORY:
Software Development Life Cycle(SDLC) :
SDLC, or Software Development Life Cycle, is a set of steps used to create software applications. These steps divide the development process into tasks that can then be assigned, completed, and measured.
SDLC is a way to measure and improve the development process. It allows a fine-grain analysis of each step of the process. This, in turn, helps companies maximize efficiency at each stage. As computing power increases, it places a higher demand on software and developers. Companies must reduce costs, deliver software faster, and meet or exceed their customers’ needs. SDLC helps achieve these goals by identifying inefficiencies and higher costs and fixing them to run smoothly.SDLC Cycle represents the process of developing software.Below is the diagrammatic representation of the SDLC cycle:
SDLC Phases:
Given below are the various phases
Requirement gathering and analysis
Design
Implementation or coding
Testing
Deployment
Maintenance
Requirement Gathering and Analysis
During this phase, all the relevant information is collected from the customer to develop a product as per their expectation. Any ambiguities must be resolved in this phase only.
Business analyst and Project Manager set up a meeting with the customer to gather all the information like what the customer wants to build, who will be the end-user, what is the purpose of the product. Before building a product a core understanding or knowledge of the product is very important. For Example, A customer wants to have an application which involves money transactions. In this case, the requirement has to be clear like what kind of transactions will be done, how it will be done, in which currency it will be done, etc.
Once the requirement gathering is done, an analysis is done to check the feasibility of the development of a product. In case of any ambiguity, a call is set up for further discussion.
Once the requirement is clearly understood, the SRS (Software Requirement Specification) document is created. This document should be thoroughly understood by the developers and also should be reviewed by the customer for future reference.
Design
In this phase, the requirement gathered in the SRS document is used as an input and software architecture that is used for implementing system development is derived.
Implementation or Coding
Implementation/Coding starts once the developer gets the Design document. The
Software design is translated into source code. All the components of the software are implemented in this phase.
Testing
Testing starts once the coding is complete and the modules are released for testing. In
this phase, the developed software is tested thoroughly and any defects found are assigned to developers to get them fixed.
Retesting, regression testing is done until the point at which the software is as per the customer’s expectation. Testers refer SRS document to make sure that the software is as per the customer’s standard.
5)Deployment
Once the product is tested, it is deployed in the production environment or first UAT (User Acceptance testing) is done depending on the customer expectation.
In the case of UAT, a replica of the production environment is created and the customer along with the developers does the testing. If the customer finds the application as expected, then sign off is provided by the customer to go live.
6)Maintenance
After the deployment of a product on the production environment, maintenance of the product i.e. if any issue comes up and needs to be fixed or any enhancement is to be done is taken care by the developers.
Development and Operations(Dev Ops) Life Cycle :
Why DevOps?
Before we know what DevOps is, it is very important to know how DevOps came into existence. Before DevOps, we had the waterfall model and the agile model for software development.
Waterfall Model
The waterfall model can be defined as a sequential process in the development of a system or software that follows a top-down approach. This model was a straightforward and linear model. The waterfall model had various phases such as Requirement Definition, Software Design, Implementation, Testing, Deployment, and Maintenance.
Software development companies that used the waterfall model approach, had to spend a lot of time to get their product right. That is because unless you complete a particular phase, you could not proceed to the next phase. Also, the working software was delivered only after the final phase of this model.
This model was only suitable for projects which had stable requirements. By stable, I mean that requirements will not change with the time. But in today’s world, this is a very unlikely thing because requirements keep on changing from time to time. These were a few drawbacks of the waterfall model
AGILE Methodology
Agile methodology is a practice that promotes continuous iteration of development and testing throughout the software development life cycle of the project. Both development and testing activities are concurrent, unlike the Waterfall model. While the Agile approach brought agility to development, it was lost on Operations which did not come up to speed with agile practices.
There was a lack of collaboration between Developers and Operation Engineers and this slowed down the development process and releases. Software companies had begun to realize the need for better collaboration between the teams and faster delivery of software. This gave birth to the DevOps approach. DevOps enabled continuous software delivery with less complex problems to fix and faster resolution of problems.
What is DevOps?
The term DevOps is a combination of two words namely Development and
Operations. DevOps is a practice that allows a single team to manage the entire application development life cycle, that is, development, testing, deployment, and operations.The aim of DevOps is to shorten the system’s development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.
DevOps is a software development approach through which superior quality software can be developed quickly and with more reliability. It consists of various stages such as continuous development, continuous integration, continuous testing, continuous deployment, and continuous monitoring.
DevOPs Life Cycle
The various phases such as continuous development, continuous integration, continuous testing, continuous deployment, and continuous monitoring constitute the DevOps Life cycle.
Continuous Development
This is the phase that involves ‘planning‘ and ‘coding‘ of the software. The vision of the project is decided during the planning phase and the developers begin developing the code for the application. There are no DevOps tools that are required for planning, but there are a number of tools for maintaining the code.
Continuous Testing
This is the stage where the developed software is continuously tested for bugs. For Continuous testing, automation testing tools like Selenium, TestNG, JUnit, etc are used. These tools allow QAs to test multiple code bases thoroughly in parallel to ensure that there are no flaws in the functionality.
Continuous Integration
This stage is the heart of the entire DevOps life cycle. It is a software development practice in which the developers are required to commit changes to the source code more frequently. This may be on a daily or a weekly basis. Every commit is then built and this allows early detection of problems if they are present. Building code not only involves compilation but it also includes code review, unit testing, integration testing, and packaging.
The code supporting new functionality is continuously integrated with the existing code. Since there is continuous development of software, the updated code needs to be integrated continuously as well as smoothly with the systems to reflect changes to the end-users.
Continuous Deployment
This is the stage where the code is deployed to the production servers. It is also important to ensure that the code is correctly deployed on all the servers.Configuration Management is the act of establishing and maintaining consistency in an application’s functional requirements and performance. Let me put this in simpler words, it is the act of releasing deployments to servers, scheduling updates on all servers and most importantly keeping the configurations consistent across all the servers.Since the new code is deployed on a continuous basis, configuration management tools play an important role in executing tasks quickly and frequently.
Continuous Monitoring
This is a very crucial stage of the DevOps life cycle where you continuously monitor the performance of your application. Here vital information about the use of the software is recorded. This information is processed to recognize the proper functionality of the application. The system errors such as low memory, server not reachable, etc are resolved in this phase.
The root cause of any issue is determined in this phase. It maintains the security and availability of the services. Also if there are network issues, they are resolved in this phase. It helps us automatically fix the problem as soon as they are detected.Any major issues if found are reported to the development team so that it can be fixed in the continuous development phase. This leads to a faster resolution of the problems.
These DevOps stages are carried out on loop continuously till you achieve the desired product quality. Therefore almost all of the major IT companies have shifted to DevOps for building their products.
CONCLUSION:
Practical No. 4
AIM: To study practical on DevOps Tools (Docker, Jenkins, Git, Jira, copado)
SOFTWARE REQUIRED: Operating System THEORY:
DevOps Tools
The above image shows the various sub-stages of DevOps and the tools used in each of them. Each of the tools in DevOps is bound to a particular phase of
DevOps. Tools that are used in that different phases of DevOps Life Cycle as follows
Docker
Docker is a containerization platform that packages your application and all its dependencies together in the form of containers to ensure that your application works seamlessly in any environment.It is a configuration management tool and platform that packages an application and all its dependencies together in the form of containers. This containerization aspect of Docker assures you that the application can work in any environment.
In the following diagram, each and every application runs on separate containers and has its own set of dependencies & libraries. This makes sure that each application is independent of other applications, giving developers surety that they can build applications that will not interfere with one another.
So a developer can build a container that can have different applications installed on it and give it to the QA team. Then the QA team would only need to run the container to replicate the developer’s environment.
Jenkins
Continuous Integration is the most important part of DevOps that is used to integrate various DevOps stages. Jenkins is the most famous Continuous Integration tool.It is an open-source automation tool written in Java with plugins built for Continuous Integration purposes. Jenkins is used to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. It also allows you to continuously deliver your software by integrating with a large number of testing and deployment technologies.
With Jenkins, organizations can accelerate the software development process through automation. Jenkins integrates development life-cycle processes of all kinds,
including build, document, test, package, stage, deploy, static analysis, and much more.
Jenkins achieves Continuous Integration with the help of plugins. Plugins allow the integration of Various DevOps stages. If you want to integrate a particular tool, you need to install the plugins for that tool. For example Git, Maven 2 project, Amazon EC2, HTML publisher etc.
Git
Git is a free, open source distributed version control system tool designed to handle everything from small to very large projects with speed and efficiency. It plays a crucial role when it comes to managing the code that the collaborators contribute to the shared repository. This code is then pulled for performing continuous integration to create a build and test it on the test server and eventually deploy it on the production.
Git enables the communication between the development and the operations team. When you are working on a large project with a huge number of collaborators, it becomes very critical to have communication between the collaborators while making changes in the project.
Commit messages in Git play a vital role in communicating among the team. The bits and pieces that we all deploy lie in the Git. To be successful in DevOps, you need to have all of the communication in Version Control.
Jira
Jira is developed by Atlassian and was initially designed as a bug and issue tracker. It has later evolved to the solid project management tool that it is today, supporting all kinds of use cases. Jira is highly flexible and allows configurations for diverse environments and processes. It supports any agile methodology. Jira offers fluid workflow by identifying development issues at the earliest stage. This makes it easier
for the enterprises to make informed decisions leading to faster shipping and higher quality of release.
Jira is well-acknowledged for its high configurability and flexibility. It allows for usage in a wide range of processes and environment.. The workflows, types of issues, and screens in Jira enable customization for any scenario and can be easily altered via the administration GUI. Following are the most important enterprise-level benefits of Jira:
Create issue via web application or through pre-configured email address
Delivers real time, relevant information to multiple stakeholders
Enables you to know outstanding, scheduled and resolved tasks
Configurable email alerts on pending, overdue tasks
Periodic reports, configurable, automatically delivered to multiple stakeholders
Search for issues you look often, save them as filters
Jira supports the use of both Scrum and Kanban methodologies with each having its specific requirements and benefits. With Scrum, you get better results for timelines. It goes through the priority list in certain sprints. With Kanban, on the other hand, you get a better outcome for service and support teams. It goes through a priority list as fast as possible with no plan modes and no sprints.
Copado
Copado’s flexible architecture allows it to work with the tools that it already has including VCS & ALM tools, automation tools, and applications thus helping you better leverage your existing investments. Further, being 100% Salesforce native, Copado is fully integrated with Salesforce DX and Salesforce Clouds
With Copado, all key DevOps functions and processes are seamlessly integrated, manual tasks are automated or minimized, and the team and management get complete visibility of all the release process data. This leads to improved and
predictable software quality, improved productivity, faster releases, and overall reduced costs. The Copado Solution includes a suite of seamlessly integrated products for release planning, testing, compliance, packaging, releasing and monitoring to form a single, smooth, collaborative arrangement across the complete DevOps cycle for Salesforce applications.
Copado supports every stage of your release and provides a best-of-breed native salesforce DevOps experience. From individual developers to complex, multi-team projects, Copado provides the breadth and depth of release orchestration functionality combined with insights into critical release data to help improve deployment success rates, and maximizing efficiency and output.
CONCLUSION:
Practical No. 5
AIM: To study Practical on SAAS (Microsoft Azure) for DevOps
SOFTWARE REQUIRED: Operating System
THEORY:
Microsoft Azure
Microsoft Azure is a cloud computing platform that provides a wide variety of services that we can use without purchasing and arranging our hardware. It enables the fast development of solutions and provides the resources to complete tasks that may not be achievable in an on-premises environment. Azure Services like compute, storage, network, and application services allow us to put our effort into building great solutions without worrying about the assembly of physical infrastructure.
Microsoft Azure is a growing set of cloud computing services created by Microsoft that hosts your existing applications, streamline the development of a new application, and also enhances our on-premises applications. It helps the organizations in building, testing, deploying, and managing applications and services through Microsoft-managed data centers.
Cloud Computing is the delivery of computing services such as servers, storage, databases, networking, software, analytics, intelligence, and more, over the Cloud.
Cloud Computing provides an alternative to the on-premises data center. With an on-premises data center, we have to manage everything, such as purchasing and installing hardware, virtualization, installing the operating system, and any other required applications, setting up the network, configuring the firewall, and setting up
storage for data. After doing all the set-up, we become responsible for maintaining it through its entire lifecycle.
But if we choose Cloud Computing, a cloud vendor is responsible for the hardware purchase and maintenance. They also provide a wide variety of software and platform as a service. We can take any required services on rent. The cloud computing services will be charged based on usage.
The cloud environment provides an easily accessible online portal that makes it handy for the user to manage the computer storage, network, and application resources. Some cloud service providers are in the following figure.
Cloud computing services are Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). They are the three major service categories provided by cloud providers as follows
Infrastructure as a Service (IaaS): In IaaS, we can rent IT infrastructures like servers and virtual machines (VMs), storage, networks, operating systems from a cloud service vendor. We can create VM running Windows or Linux and install anything we want on it. Using IaaS, we don’t need to care about the hardware or virtualization software, but other than that, we do have to manage everything else. Using IaaS, we get maximum flexibility, but still, we need to put more effort into maintenance.
Platform as a Service (PaaS): This service provides an on-demand environment for developing, testing, delivering, and managing software applications. The developer is responsible for the application, and the PaaS vendor provides the ability to deploy and run it. Using PaaS, the flexibility gets reduced, but the management of the environment is taken care of by the cloud vendors.
Software as a Service (SaaS): It provides centrally hosted and managed software services to the end-users. It delivers software over the internet, on-demand, and typically on a subscription basis. E.g., Microsoft One Drive, Dropbox, WordPress and Amazon Kindle. SaaS is used to minimize the operational cost to the maximum extent. Software as a service (SaaS) allows users to connect to and use cloud-based apps over the Internet. Common examples are email, calendaring and office tools (such as Microsoft Office 365).
SaaS provides a complete software solution which you purchase on a pay-as-you-go basis from a cloud service provider. You rent the use of an app for your organization and your users connect to it over the Internet, usually with a web browser. All of the underlying infrastructure, middleware, app software
and app data are located in the service provider’s data center. The service provider manages the hardware and software and with the appropriate service agreement, will ensure the availability and the security of the app and your data as well. SaaS allows your organisation to get quickly up and running with an app at minimal upfront cost.
Common SaaS scenarios
If you have used a web-based email service such as Outlook, Hotmail or Yahoo! Mail, then you have already used a form of SaaS. With these services, you log into your account over the Internet, often from a web browser. The email software is located on the service provider’s network and your messages are stored there as well. You can access your email and stored messages from a web browser on any computer or Internet-connected device.you can rent productivity apps, such as email, collaboration and calendaring; and sophisticated business applications such as customer relationship management (CRM), enterprise resource planning (ERP) and document management. You pay for the use of these apps by subscription or according to the
level of use.
Advantages of SaaS
Gain access to sophisticated applications
To provide SaaS apps to users, you don’t need to purchase, install, update or maintain any hardware, middleware or software. SaaS makes even sophisticated enterprise applications, such as ERP and CRM, affordable for organizations that lack the resources to buy, deploy and manage the required infrastructure and software themselves.
Pay only for what you use
You also save money because the SaaS service automatically scales up and down according to the level of usage.
Use free client software
Users can run most SaaS apps directly from their web browser without needing to download and install any software, although some apps require plugins. This means that you don’t need to purchase and install special software for your users.
Mobilize your workforce easily
SaaS makes it easy to “mobilize” your workforce because users can access SaaS apps and data from any Internet-connected computer or mobile device. You don’t need to worry about developing apps to run on different types of computers and devices because the service provider has already done so. In addition, you don’t need to bring special expertise onboard to manage the security issues inherent in mobile computing. A carefully chosen service provider will ensure the security of your data, regardless of the type of device consuming it.
Access app data from anywhere
With data stored in the cloud, users can access their information from any
Internet-connected computer or mobile device. And when app data is stored in the cloud, no data is lost if a user’s computer or device fails.
CONCLUSION:
Practical No. 6
AIM: To install Jenkins on System. SOFTWARE REQUIRED: JDK, Jenkins
IMPLEMENTATION:
Jenkins may be installed on either Windows or Unix platforms. There are some prerequisites for Jenkins to install Jenkins on the computer.
Prerequisites:
Hardware requirements:
minimum 256 MB of RAM
at least 1 GB of space in your hard drive Software Requirements:
Jenkins runs on Java, either the latest version of Java Development Kit (JDK) or Java Runtime Environment (JRE) is needed.
Jenkins Installation:
Following steps should be followed so that to install Jenkins successfully:
Step 1) Go to https://www.jenkins.io/download/ and select the platform. In our case Windows
Step 2) Go to the download location from the local computer and unzip the downloaded package. Double-click on unzipped jenkins.msi.
Step 3) In the Jenkin Setup screen, click Next.
Step 4) Choose the location where you want to have the Jenkins instance installed (default location is C:\Program Files (x86)\Jenkins), then click on Next button.
Step 5)Click on the Install button.
Step 6) Once install is complete, click Finish.
Step 7) During the installation process an info panel may pop-up to inform the user that for a complete setup, the system should be rebooted at the end of the current installation. Click on OK button when the Info panel is popping-up:
After completing the Jenkins installation phase, you should proceed further and start its configuration. Next steps will guide you how you can unblock Jenkins application:
Step 1) After completing the Jenkins installation process, a browser tab will pop-up asking for the initial Administrator password. To access Jenkins, you need to go to browse the following path in your web browser. http://localhost:8080
If you can access the above URL, then it confirms that Jenkins is successfully installed in your system.
Step 2) The initial Administrator password should be found under the Jenkins installation path (set at Step 4 in Jenkins Installation).
For default installation location to C:\Program Files (x86)\Jenkins, a file called initialAdminPassword can be found under C:\Program Files (x86)\Jenkins\secrets.
However, If a custom path for Jenkins installation was selected, then you should check that location for the initialAdminPassword file.
Step 3) Open the highlighted file and copy the content of the initialAdminPassword file.
Step 4) Paste the password into the browser's pop-up tab
(http://localhost:8080/login?form=%2F) and click on the Continue button.
Jenkins Setup:
You can also customize your Jenkins environment by below-given steps:
Step 1) Click on the “Install suggested plugins button” so Jenkins will retrieve and install the essential plugins
Jenkins will start to download and install all the necessary plugins needed to create new Jenkins Jobs.
You can choose the Option “Select Plugins to Install” and select the plugins you want to install
Step 2) After all suggested plugins were installed, the “Create First Admin User” panel will show up. Fill all the fields with desired account details and hit the “Save and Finish” button.
Step 3) Once you have filled the above data, finally it will ask for URL information where you can configure the default instance path for Jenkins. Leave it as it is to avoid any confusion later. However, if another application is already using the 8080 port, you can use another port for Jenkins and finally save the settings, and you are done with installation of Jenkins. Hit the “Save and Continue” button:
New Jenkins Server is successfully installed . Hit the “Start using Jenkins” button.
CONCLUSION:
Practical No. 7
AIM: To experiment tools management with jenkins SOFTWARE REQUIRED: JDK, Jenkins
IMPLEMENTATION:
Configure System
To manage Jenkins, click on the "Manage Jenkins" option from the left hand of the Jenkins Dashboard page.
Click on Configure System:
In this, we can manage paths to the various tools to use in builds, such as the versions of Ant and Maven, as well as security options, email servers, and other system-wide configuration details. Jenkins will add the required configuration fields dynamically when new plugins are installed.
The configure system page is a critical configuration part. This screen represents a variety of sections, each correlating to a different configuration area from generic Jenkins settings, global environment variables, and most installed plugins are configured on this page.
Home directory
Jenkins requires some disk space to perform builds and keep archives. You can check this location from the configuration screen of Jenkins.
By default, this is set to ~/.jenkins, and this location will be initially stored within your user profile (such as C:\Users\Nikita\.jenkins) location.
You can change this location to a different location to store all relevant builds and archives. We can do this in the following ways:
Set the environment variable of JENKINS_HOME to the new home directory before launching the servlet container.
Set the system property of JENKINS_HOME to the servlet container.
Set JNDI (Java Naming and Directory Interface) environment entry JENKINS_HOME to the new directory.
Let's set the JENKINS_HOME environment variable.
# of executors
This option refers to the total number of concurrent job executions that can take place on the Jenkins machine. This can be changed based on the requirements.
Environment Variables
This option is used to add custom environment variables which will apply to all the jobs. Environment variables are key-value pairs and can be accessed and used in Builds wherever required. (For example: SLACK_TOKEN, SAUCE_API_KEY ).
Jenkins URL
By default, the Jenkins URL is set to the localhost. If you have a DNS (domain name setup) for your machine, set this to the domain name else overwrite localhost with the IP of the machine. This will help in setting up slaves (nodes) and while sending out links using the email as you can directly access the Jenkins URL using the environment variable JENKINS_URL which can be accessed as ${JENKINS_URL}.
Email Notification
In the Email Notification section, you can configure the SMTP settings for sending out emails. This needs for Jenkins to connect to the SMTP mail server and send out emails to the recipient list.
CONCLUSION:
Practical No. 8
AIM: To create Job and manage it using Jenkins SOFTWARE REQUIRED:
IMPLEMENTATION:
Jenkins Freestyle Project is a repeatable build job, script, or pipeline that contains steps and post-build actions. It is an improved job or task that can span multiple operations. It allows you to configure build triggers and offers project-based security for your Jenkins project. It also offers plugins to help you build steps and post-build actions.
The types of actions you can perform in a Jenkins build step or post-build action are quite limited. There are many standard plugins available within a Jenkins Freestyle Project to help you overcome this problem.
Create a New Build Job in Jenkins
The freestyle build job is a highly flexible and easy-to-use option. You can use it for any type of project; it is easy to set up, and many of its options appear in other build jobs. Below is a step by step process to create a job in Jenkin.
Step 1) Login to Jenkins
To create a Jenkins freestyle job, log on to your Jenkins dashboard by visiting your Jenkins installation path. Usually, it will be hosted on localhost at http://localhost:8080 If you have installed Jenkins in another path, use the appropriate URL to access your dashboard as shown in the below Jenkins job creation example.
Step 2) Create New Item
Click on “New Item” at the top left-hand side of your dashboard.
Step 3) Enter Item details
In the next screen,
Enter the name of the item you want to create. We shall use the “Hello world” for this demo.
Select Freestyle project
Click Okay
Step 4) Enter Project details
Step 5) Enter repository URL
Under Source Code Management, Enter your repository URL. We have a test repository located at https://github.com/kriru/firstJava.git
It is also possible for you to use a local repository.
If your GitHub repository is private, Jenkins will first validate your login credentials with GitHub and only then pull the source code from your GitHub repository.
Step 6) Tweak the settings
Now that you have provided all the details, it’s time to build the code. Tweak the settings under the build section to build the code at the time you want. You can even schedule the build to happen periodically, at set times.
Under build,
Click on “Add build step”
Click on “Execute Windows batch command” and add the commands you want to execute during the build process.
Here, I have added the java commands to compile the java code. I have added the following windows commands:
javac HelloWorld.java java HelloWorld
Step 7) Save the project
When you have entered all the data,
Click Apply
Save the project.
Step 8) Build Source code
Now, in the main screen, Click the Build Now button on the left-hand side to build the source code.
Step 9) Check the status
After clicking on Build now, you can see the status of the build you run under Build History.
Step 10) See the console output
Click on the build number and then Click on console output to see the status of the build you run. It should show you a success message, provided you have followed the setup properly as shown in the below Jenkins create new job example.
In sum, we have executed a HelloWorld program hosted on GitHub. Jenkin pulls the code from the remote repository and builds continuously at a frequency you define.
CONCLUSION: