Sunday, September 13, 2020

Error in Starting Jenkins Service - DevOps

While undergoing Training course on "DevOps Foundations: Continuous Delivery/Continuous Integration" through "Linkedin Learning", i got the below doubt.

I am having issue in starting Jenkins service and test fixture. 

Please help me to solve this problem (Message me on Linkedin if you have solution):

Error screenshot is mentioned below:



Steps to replicate the Error:

1. Desktop Path:
/a/DevOps/Ex_Files_DevOps_Continuous_Delivery_Integration/Exercise Files/Course Environments

2. Docker Command:
$ docker-compose up -d --build

3. Press Enter
Building jenkins
Step 1/8 : FROM jenkins:latest
 ---> cd14cecfdb3a
Step 2/8 : MAINTAINER Ernest Mueller <ernestmueller@theagileadmin.com>
 ---> Using cache
 ---> 1317d7c8dfbf
Step 3/8 : USER root
 ---> Using cache
 ---> 1da2689d4cf2
Step 4/8 : RUN     apt-get update &&     apt-get install -y build-essential &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> c3cf65c20337
Step 5/8 : COPY docker /usr/bin/docker
 ---> Using cache
 ---> 14227a0ef002
Step 6/8 : RUN gpasswd -a jenkins staff
 ---> Using cache
 ---> b4dd3651f510
Step 7/8 : USER jenkins
 ---> Using cache
 ---> 0670a9760139
Step 8/8 : ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]
 ---> Using cache
 ---> 2fc81a7e74bf
Successfully built 2fc81a7e74bf
Successfully tagged cd_jenkins:latest
Building test_fixture
Step 1/16 : FROM ubuntu:16.04
 ---> 4b22027ede29
Step 2/16 : MAINTAINER Ernest Mueller <ernestmueller@theagileadmin.com>
 ---> Using cache
 ---> f05ea0b1ea99
Step 3/16 : RUN apt-get update && apt-get install -y openssh-server curl jq vim
 ---> Using cache
 ---> 84c5190c3619
Step 4/16 : RUN mkdir /var/run/sshd
 ---> Using cache
 ---> 2c8ce2c83375
Step 5/16 : RUN echo 'root:theagileadmin' | chpasswd
 ---> Using cache
 ---> 5ec95fda248e
Step 6/16 : RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
 ---> Using cache
 ---> 4d43f68faf23
Step 7/16 : RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
 ---> Using cache
 ---> a300714bcfa5
Step 8/16 : ENV NOTVISIBLE "in users profile"
 ---> Using cache
 ---> e2994b48d1d1
Step 9/16 : RUN echo "export VISIBLE=now" >> /etc/profile
 ---> Using cache
 ---> 1533725c83db
Step 10/16 : RUN curl -L https://www.opscode.com/chef/install.sh | bash
 ---> Using cache
 ---> d91d92814adc
Step 11/16 : RUN wget https://packages.chef.io/files/stable/chefdk/1.5.0/ubuntu/16.04/chefdk_1.5.0-1_amd64.deb
 ---> Using cache
 ---> aa5b98e2f3c1
Step 12/16 : RUN dpkg -i chefdk_1.5.0-1_amd64.deb
 ---> Using cache
 ---> a3bf53026e4e
Step 13/16 : VOLUME        ["/chef-repo"]
 ---> Using cache
 ---> e478b6a56198
Step 14/16 : EXPOSE 22
 ---> Using cache
 ---> 2f917a84db9e
Step 15/16 : EXPOSE 8888
 ---> Using cache
 ---> 31b84a8588c6
Step 16/16 : CMD ["/usr/sbin/sshd", "-D"]
 ---> Using cache
 ---> ad7c951c921c
Successfully built ad7c951c921c
Successfully tagged test_fixture:latest
Building abao
Step 1/10 : FROM node:alpine
 ---> 0e0d8a11f565
Step 2/10 : MAINTAINER Ernest Mueller <ernestmueller@theagileadmin.com>
 ---> Using cache
 ---> 571cd3b0a5d5
Step 3/10 : RUN apk update && apk add yaml
 ---> Using cache
 ---> 38928796345a
Step 4/10 : RUN npm install -g abao
 ---> Using cache
 ---> 2e86f66f46f7
Step 5/10 : RUN npm install --save-dev chai
 ---> Using cache
 ---> 60eabe55be06
Step 6/10 : RUN mkdir -p /raml
 ---> Using cache
 ---> 9c708212cf63
Step 7/10 : VOLUME /raml
 ---> Using cache
 ---> b9df144ad4a0
Step 8/10 : WORKDIR /raml
 ---> Using cache
 ---> 63bfbc1f2424
Step 9/10 : ENTRYPOINT ["abao"]
 ---> Using cache
 ---> 69442b7e2f4d
Step 10/10 : CMD ["--help"]
 ---> Using cache
 ---> 932d2a96e3ef
Successfully built 932d2a96e3ef
Successfully tagged abao:latest
Starting courseenvironments_nexus_1 ...
Starting courseenvironments_test_fixture_1 ... error
Starting courseenvironments_abao_1         ...

Starting courseenvironments_nexus_1        ... done
ectivity on endpoint courseenvironments_test_fixture_1 (9232233db62902a65f3b25bf66d861f28aa8ba1d8c751fd33ee650a2a1e0b6efStarting courseenvironments_abao_1         ... done
Starting courseenvironments_jenkins_1      ... error

ERROR: for courseenvironments_jenkins_1  Cannot start service jenkins: error while mounting volume '/mnt/sda1/var/lib/docker/volumes/courseenvironments_ramlfiles/_data': failed to mount local volume: mount A:/DevOps/Ex_Files_DevOps_Continuous_Delivery_Integration/Exercise Files/Course Environments/raml-files:/mnt/sda1/var/lib/docker/volumes/courseenvironments_ramlfiles/_data, flags: 0x1000: no such file or directory

ERROR: for test_fixture  Cannot start service test_fixture: driver failed programming external connectivity on endpoint courseenvironments_test_fixture_1 (9232233db62902a65f3b25bf66d861f28aa8ba1d8c751fd33ee650a2a1e0b6ef): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use

ERROR: for jenkins  Cannot start service jenkins: error while mounting volume '/mnt/sda1/var/lib/docker/volumes/courseenvironments_ramlfiles/_data': failed to mount local volume: mount A:/DevOps/Ex_Files_DevOps_Continuous_Delivery_Integration/Exercise Files/Course Environments/raml-files:/mnt/sda1/var/lib/docker/volumes/courseenvironments_ramlfiles/_data, flags: 0x1000: no such file or directory
ERROR: Encountered errors while bringing up the project.

Friday, August 28, 2020

Azure DevOps

 What is Azure DevOps Server?

Azure DevOps Server is a Microsoft product that provides version control, reporting, requirements management, project management, automated builds, testing and release management capabilities. It covers the entire application life-cycle, and enables DevOps capabilities.

Developers can work in the cloud using Azure DevOps Services or on-premises using Azure DevOps Server. Azure DevOps Server was formerly named Visual Studio Team Foundation Server (TFS).

Azure DevOps is a Software as a service (SaaS) platform from Microsoft that provides an end-to-end DevOps tool-chain for developing and deploying software.  It also integrates with most leading tools on the market and is a great option for orchestrating a DevOps toolchain.


Benefits of Azure DevOps:

Azure DevOps provides DevOps teams with powerful tools.

  • Flexibility: If your DevOps team doesn’t want or need the full suite of services, they can customize them independently.
  • Timely Access to New Features: Every three weeks, DevOps users receive access to new features. No need to scramble around and wonder what’s new. These are not to be confused with upgrades
  • No Upgrades to Worry About: Users need not worry about upgrading or patching up the tool-chain because the Azure DevOps is a SaaS product. Companies that run on a CI/CD model no longer need to slow things down for the sake of upgrading.
  • Reliability: Azure DevOps is backed by 24 x7 support and a 99.9% SLA.
  • It’s Platform-agnostic: DevOps is designed to run on any platform (Linux, macOS, and Windows) or language (e.g., Android, C/C++, Node.js, Python, Java, PHP, Ruby, .Net, and iOS apps).
  • It’s Cloud-agnostic: Azure DevOps works with AWS and GCP.


What Are the Features of Azure DevOps?

  • Improved Source Control: Azure DevOps systems support two popular types of source control: Git (distributed) or Team Foundation Version Control (TFVC), which is a centralized, client-server system. You can add and manage Azure Git tags, review, download, and edit files to see change history.
  • Continuous Integration and Deployment (CI/CD): Many developers employ the practice of CI/CD, and Azure DevOps supports them. By using Azure pipelines, developers can automate many of the design processes, including defining builds and their steps, creating test instructions, and manage simultaneous releases.
  • Support for Manual and Exploratory Testing: Azure DevOps’ test features facilitate manual, exploratory, and continuous testing, including workflow customization, end-to-end traceability, criteria-based selection, and real-time charts that track test activity.
  • Azure Cloud-hosted Services: Azure provides DevOps teams with cloud-hosted services that support application development and deployment. These services can be used by themselves or in combination with Azure DevOps.
  • Plan and Track Your Work: Azure DevOps systems provide you with a couple of types of work items used to monitor features, requirements, user stories, tasks, bugs, and more. For planning purposes, you can access several kinds of backlogs and boards to support the main agile methods: Scrum, Scrumban, or Kanban. You can add and update relevant work items, manage product backlog, use sprint backlogs to plan sprints, and use Kanban boards to visualize the workflow and update statuses.
  • Dashboard Control: Using the DevOps dashboard feature, you can quickly navigate to different areas of the project, add and manage dashboards, and configure dashboard widgets. 
  • Azure Artifacts: Azure Artifacts allows teams to share Maven, npm, and NuGet packages from public and private sources and integrate package sharing into your CI/CD pipelines.

Thursday, August 27, 2020

C# Interview questions for Software Tester

Interview questions :

C# is a modern, general-purpose programming language that can be used to perform a wide range of tasks.  It consists of thousands of pre-built classes and interfaces that lets programmer to write powerful code in very less time.

Ace 11 common interview questions | Energy Resourcing

Variables and data types:

C# provides two types of data types: Value types and Reference types.

A  Value type data type stores copy of the value whereas the  Reference type data types stores the address of the value. C sharp provides great range of predefined data types but it also gives the way to create  user defined data types.

Encapsulation and abstraction :

Encapsulation and abstraction is the advanced mechanism in C# that lets your program to hide unwanted code within a capsule and shows only essential features of an object. Encapsulation is used to hide its members from outside class or interface, whereas abstraction is used to show only essential features.

In C# programming, Encapsulation uses five types of modifier to encapsulate data. These modifiers are public, private, internal, protected and protected internal. These all includes different types of characteristics and makes different types of boundary of code.

What is encapsulation?

Encapsulation is the process of hiding irrelevant data from the user. To understand encapsulation, consider an example of a mobile phone. Whenever you buy a mobile, you don’t see how circuit board works. You are also not interested to know how digital signal converts into the analog signal and vice versa. These are the irrelevant information for the mobile user, that’s why it is encapsulated inside a cabinet. 

In C# programming, we will do the same thing. We will create a cabinet and keep all the irrelevant information in it that will be unavailable to the user.

What is abstraction?

Abstraction is just opposite of Encapsulation. Abstraction is a mechanism to show only relevant data to the user. Consider the same mobile example again. Whenever you buy a mobile phone, you see their different types of functionalities as a camera, mp3 player, calling function, recording function, multimedia etc. It is an abstraction because you are seeing only relevant information instead of their internal engineering.

What is Access Specifiers in C#?

Access Specifiers defines the scope of a class member. A class member can be variable or function.

Public Access Specifiers (C#): The class member, that is defined as a public can be accessed by other class members that are initialized outside the class. A public member can be accessed from anywhere even outside the namespace.

Private Access Specifiers (C#): The private access specifiers restrict the member variable or function to be called outside of the parent class. A private function or variable cannot be called outside of the same class. It hides its member variable and method from other class and methods. However, you can store or retrieve the value from private access modifiers using get the set property.

Protected Access Specifiers C#: The protected access specifier hides its member variables and functions from other classes and objects. This type of variable or function can only be accessed in child class. It becomes very important while implementing inheritance.

C# Internal Access Specifiers: The internal access specifier hides its member variables and methods from other classes and objects, that is resides in other namespace. The variable or classes that are declared with internal can be access by any member within application. It is the default access specifiers for a class in C# programming.

C# Protected Internal Access Specifiers: The protected internal access specifier allows its members to be accessed in derived class, containing class or classes within same application. However, this access specifier rarely used in C# programming but it becomes important while implementing inheritance.

C# Get Set Modifier: The get set accessor or modifier mostly used for storing and retrieving the value from the private field. The get accessor must return a value of property type where set accessor returns void. The set accessor uses an implicit parameter called value. In simple word, the get method used for retrieving the value from private field whereas set method used for storing the value in private variables.

Classes

A class in C# is a blueprint or template that is used for declaring an object. However, there is no need to declare an object of the static class. A class consists of member variables, functions, properties etc. A method is a block of code in C# programming. The function makes program modular and easy to understand.


The class is a template, declaration or blueprint that is used for classifying the object. It encapsulates variable members, functions, structure, properties and many more components. It is the basic building block of object-oriented programming. In order to create a class, the class keyword is used.


C# Method Declaration

Method is the building block of object-oriented programming. It combines related code together and makes program easier. In C# method declaration, you can declare method by following way:

<Access Specifier> <Return Type> <Method Name>(Parameter list)

 {

    Body // void  is a return data type that return nothing

 }


C# Static Method And Variables:

Whenever you write a function or declare a variable, it doesn’t create an instance in a memory until you create an object of the class. But if you declare any function or variable with a static modifier, it directly creates an instance in a memory and acts globally. The static modifier doesn't reference any object.


C# Main Method:

In C# programming the Main method is where program starts execution. It is the main entry point of program that executes all the objects and invokes method to execute. There can be only one Main method in C#. However, the C# Main method can be void or int return type. It must be inside a class or struct and must be declared with static modifier. It is the main place where a program starts the execution and end. The Main method can have a parameter and these parameters are known as zero-indexed command line argument. In lateral chapter you will learn more about  command line argument.


Parameters:

The parameter is used to passing information to a function. Based on the type of parameters, function responses, and returns value. A parameter can be passed to a function by two ways: Passing parameter by value and passing a parameter by reference. 

As mentioned in the previous chapter, there are two types of the parameter that can be passed in function. One is Value type parameter and another is reference type parameter. Before understanding both types of parameters in C#, you will have to understand Value type and Reference type.

There are two ways to allocating space in memory. One is a value type and another is a Reference type. When you create int, char or float type variable, it creates value type memory allocation whereas when you create an object of a class, it creates reference type memory allocation.

Value Type: A value type variable directly contains data in the memory.

Reference Type: A Reference type variable contains memory address of value.

Constructors: Constructors are the special method of the class which is used when initializes the object. It looks like similar to method but it has the same name as a class. It is created with the same name of the class and notable thing is that it never returns value so you can’t use this method for returning some value.

WHAT IS FILE HANDLING IN C#?

To save the information permanently on the disk or reading information from the saved file through C# is known as File Handling. C# File Handling uses a stream to save or retrieve information.

FILES AND STREAM

A file is a collection of data stored on a disk with specific name, extension and directory path. When you open File using C# for reading and writing purpose it becomes Stream. A stream is a sequence of bytes traveling from a source to a destination over a communication path.

WHY I NEED TO LEARN FILE HANDLING?

As a C# programmer, several times you need to save information on a disk. You will not get database everywhere to save information and your project may require saving information in a txt file, doc file, xls file, pdf files or any other file types. So, you must know the concept of saving data in a file.

System.IO Namespace which is a collection of classes that is responsible for reading, writing and accessing of files.

System.IO Namespace is a collection of classes, methods, enumeration and types that is responsible for reading and writing files and data streams. All the File Handling operations require System.IO namespace.

WHAT IS FILESTREAM CLASS IN C#?

FileStream Class is used to perform the basic operation of reading and writing operating system files. FileStream class helps in reading from, writing and closing files.

In order to use FileStream class you need to include System.IO namespace and then create FileStream Object to create a new file or open an existing file.

FileStream <object_name> = new FileStream( <file_name>, <FileMode Enumerator>, <FileAccess Enumerator>, <FileShare Enumerator>);

FileMode – It specifies how to operation system should open the file. It has following members  

Append - Open the file if exist or create a new file. If file exists then place cursor at the end of the file.

Create - It specifies operating system to create a new file. If file already exists then previous file will be overwritten.

CreateNew - It create a new file and If file already exists then throw IOException.

Open – Open existing file.

Open or Create – Open existing file and if file not found then create new file.

Truncate – Open an existing file and cut all the stored data. So the file size becomes 0.

C# Inheritance With Programming Example

Inheritance is the one of the important pillar of Object Oriented Programming (OOP).

Inheritance allows you to access members of base class in child class. It enables you to create a child class that can access and use all the functionality of its base class. This way you can keep common variable and functions in a base class and use them as many times as you want in child class. Code re-usability makes your program simpler and efficient.

What is Polymorphism?

Polymorphism is one of the fundamental concept and strongest pillars of Object Oriented Programming. Simply Polymorphism means – One Interface, Multiple Functions. It is a Greek word that means Many Forms.

Static Polymorphism

In static Polymorphism, you bind a function with an object during compile time. In simple word, you tag a function with an object while writing program. It is also called early binding. In static polymorphism, Function Overloading gets implemented.

Dynamic Polymorphism

It is also called as Late Binding or Method Overriding or Dynamic Polymorphism. In dynamic polymorphism, we override base class function using virtual & override keywords.

Function Overloading

In function overloading, a function works differently based on parameters. A single function can have different nature based on a number of parameters and types of parameters. For example, you have a function Sum() that accepts values as a parameter and print their addition. You can write multiple functions with name Sum() but the parameter signature must be different.

What is Runtime Polymorphism?

Runtime Polymorphism is also known as Dynamic Polymorphism, Late Binding, Method overriding etc. Whereas in static polymorphism we overload a function; in dynamic polymorphism we override a base class function using virtual or override keyword. Method overriding means having two or more methods with the same name, same signature but with different implementation.

C# - What is OOP?

OOP stands for Object-Oriented Programming

Object-oriented programming has several advantages over procedural programming:

OOP is faster and easier to execute

OOP provides a clear structure for the programs

OOP helps to keep the C# code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug

OOP makes it possible to create full reusable applications with less code and shorter development time

C# - What are Classes and Objects?

Classes and objects are the two main aspects of object-oriented programming.

ex: class: Fruit, object: Apple, mango, banana

So, a class is a template for objects, and an object is an instance of a class.

When the individual objects are created, they inherit all the variables and methods from the class.

Featured Posts