Unit-3 DevOps
Unit-3 DevOps
Introduction to project management: The need for source code control, The
history of source code management, Roles and code, source code management
system and migrations, Shared authentication, Hosted Git servers, Different Git
server implementations, Dockerintermission, Gerrit, The pull request model,
GitLab.
Git server implementations used in DevOps, each with their own strengths and
weaknesses. Here are some of the most popular ones:
4. Azure DevOps: A cloud-based platform that includes a Git server, along with
features like continuous integration, continuous deployment, and agile project
planning.
5. AWS CodeCommit: A cloud-based Git server offered by Amazon Web
Services, integrating with other AWS services like CodeBuild and
CodePipeline.
8. Gitea: A lightweight, open-source Git server that offers features like issue
tracking, pull requests, and continuous integration.
9. GitKraken: A commercial Git server that offers features like pull requests,
code reviews, and continuous integration, along with a graphical user interface.
10. Bonobo Git Server: An open-source Git server that offers features like pull
requests, code reviews, and continuous integration, with a focus on simplicity
and ease of use.
Docker intermission
Docker is a tool that's positioned between developers and operations personnel.
Thanks to Docker, developers can hand over to the operations team an
application - packaged as an image - that can run seamlessly run on any
environment (testing, staging, or production). It guarantees that if a feature
functions in the development environment, it will also work in the production
and staging environments.
Docker eliminates friction between the two teams and eases the work of
automating steps such as testing, staging, and deployment. This helps accelerate
application development and improves the overall performance of applications
in a production environment.
Gerrit
Gerrit is a web-based, open-source code review tool that integrates with Git. It
allows teams to review changes in a collaborative manner before the code is
merged into the main repository. Gerrit helps streamline the code review
process, ensuring that code quality is maintained and that any potential issues
are caught early in the development cycle.
History of Gerrit
Gerrit was originally developed by Google for its own internal projects.
It was released as an open-source project in 2010.
Since then, it has gained a significant user base in the open-source
community.
Key Features of Gerrit:
1. Code Review Workflow: Gerrit facilitates a structured code review
process where changes can be submitted for review, discussed, and
approved or rejected based on feedback from reviewers.
2. Integration with Git: Gerrit works as a Git repository, allowing
developers to push changes to Gerrit instead of directly to the main
branch. The changes go through a review process where they can be
refined and improved.
3. Access Control: Gerrit provides fine-grained access control, allowing
teams to define who can view, review, and submit changes to specific
projects or branches.
4. Change Management: Each change in Gerrit is tracked with its own
review page, where discussions, comments, and reviews can be made.
Changes can be amended, and new versions can be submitted in response
to feedback.
5. Automated Checks: Gerrit can integrate with continuous integration (CI)
systems to automate testing, linting, and other checks. This ensures that
changes meet the project's standards before they are merged.
6. Branch and Project Management: Gerrit supports the management of
multiple branches and projects, making it easier to handle complex
workflows in larger codebases.
Architecture of Gerrit
Gerrit is built on a Java-based architecture that interacts with Git.
The system consists of a web application and a server-side component.
It uses a PostgreSQL database to store configurations and review data.
User Roles in Gerrit
1. Administrators
Administrators have full control over the Gerrit instance. They can
manage projects, users, permissions, and settings.
Responsibilities:
o Create, configure, and delete projects.
o Manage user accounts and groups.
o Define and modify access controls and permissions.
o Configure Gerrit settings and integrations with other tools like
CI/CD pipelines.
o Troubleshoot and resolve any issues with the Gerrit instance.
2. Project Owners
Project Owners have administrative rights over specific projects but not
the entire Gerrit instance.
Responsibilities:
o Manage access controls for their specific projects.
o Add or remove users from project-specific groups.
o Configure project-specific settings and integrations.
o Approve changes that affect project settings or structure.
3. Developers (Contributors)
Developers are the primary users who contribute code to the projects.
Responsibilities:
o Submit changes (patch sets) for review.
o Respond to feedback by amending changes as needed.
o Review changes submitted by others, if granted review
permissions.
o Work on assigned changes and ensure that their submissions meet
project standards and pass any automated checks.
4. Reviewers
Reviewers are responsible for reviewing and approving or rejecting
changes submitted by developers.
Responsibilities:
o Review code changes, comment on specific lines, and suggest
improvements.
o Score changes using Gerrit's scoring system (e.g., +1, -1, +2, -2).
o Approve changes that meet the project's quality standards.
o Reject or request additional changes if the submission does not
meet the required standards.
5. Integrators (Submitters)
Integrators are responsible for merging approved changes into the main
branch.
Responsibilities:
o Ensure that changes meet all approval and verification criteria
before submission.
o Submit changes once they have the required approval scores from
reviewers and pass automated checks.
o Monitor the health of the main branch and address issues related to
submitted changes.
6. CI Bots
Continuous Integration (CI) Bots are automated users that perform tasks
like running tests, checks, and other automated processes.
Responsibilities:
o Automatically verify changes by running tests and checks.
o Provide feedback on whether changes pass or fail these checks.
o Prevent changes from being merged if they do not pass the required
checks.
GitLab
GitLab is a comprehensive, web-based DevOps platform that provides a
complete suite of tools for managing the software development lifecycle, from
planning and source code management to CI/CD, monitoring, and security. It is
designed to streamline and enhance the collaboration and productivity of
development teams by providing everything needed to build, deploy, and
maintain software in one place.
Key Features of GitLab:
1. Source Code Management (SCM): GitLab provides robust Git
repository management, including branching, merging, and pull requests,
all integrated into a single platform. It supports features like code
reviews, issue tracking, and merge requests, which facilitate collaboration
and code quality.
2. Continuous Integration and Continuous Deployment (CI/CD): GitLab
has built-in CI/CD pipelines that allow teams to automate the building,
testing, and deployment of code. This enables developers to catch issues
early and deliver features faster and more reliably.
3. DevSecOps: Security is integrated into GitLab's workflow, offering tools
for static and dynamic application security testing (SAST/DAST),
dependency scanning, container scanning, and more. This helps teams
identify and address security vulnerabilities throughout the development
process.
4. Project Management: GitLab includes a range of project management
tools, such as boards, milestones, and issue tracking. These tools help
teams plan, track progress, and manage tasks efficiently.
5. Collaboration Tools: GitLab facilitates collaboration through features
like merge requests, inline commenting on code, discussions, and
mentions. This ensures that team members can work together effectively,
whether they are co-located or distributed.
6. Code Review and Quality Assurance: GitLab supports code review
processes through merge requests, where reviewers can provide feedback,
suggest changes, and approve or reject code. Automated testing and code
quality checks can be integrated into the workflow to maintain high
standards.
7. Container Registry: GitLab includes a built-in container registry that
allows teams to store and manage Docker images, which can be used in
CI/CD pipelines or for deployment.
8. Monitoring and Logging: GitLab provides tools for monitoring
application performance and tracking logs. It integrates with Prometheus
for monitoring and can be used to set up alerts and visualize application
metrics.
9. Integration with Other Tools: GitLab integrates with numerous third-
party tools and services, including cloud providers (AWS, Azure, GCP),
Kubernetes, Jira, Slack, and many others, making it highly adaptable to
various workflows.
GitLab Editions:
GitLab is available in multiple editions:
GitLab Community Edition (CE): This is the open-source version of
GitLab, which provides core features suitable for small to medium-sized
teams and projects.
GitLab Enterprise Edition (EE): This version includes advanced
features tailored for larger enterprises, such as enhanced security,
performance optimizations, and additional integrations. EE is available in
different tiers, including Premium and Ultimate, each offering
progressively more features.
Advantages of Using GitLab:
All-in-One Platform: GitLab provides a single application for the entire
DevOps lifecycle, reducing the need for multiple tools and simplifying
integrations.
Scalability: GitLab is suitable for small teams to large enterprises, with
features and pricing tiers that scale according to the needs of the
organization.
Automation and Efficiency: GitLab's CI/CD pipelines and automation
capabilities help teams move faster by reducing manual tasks and
increasing deployment frequency.
Strong Security Posture: With integrated security scanning and
compliance features, GitLab helps teams build secure applications and
maintain regulatory standards.
Open Source Community: GitLab’s Community Edition is open-source,
allowing for community contributions, transparency, and flexibility in
usage.
Use Cases:
Software Development: GitLab is widely used by development teams to
manage source code, track issues, and collaborate on code reviews.
DevOps Automation: Teams use GitLab to automate the build, test, and
deployment process, making it a cornerstone of DevOps practices.
Security and Compliance: With integrated security tools, GitLab helps
organizations maintain secure codebases and meet compliance
requirements.