Day-18 | What is CICD ? | Introduction to CICD | How CICD works ? | #devops #abhishekveeramalla

Day-18 | What is CICD ? | Introduction to CICD | How CICD works ? | #devops #abhishekveeramalla

Introduction to CI/CD

Overview of the Video

  • Abhishek introduces the topic of Continuous Integration and Continuous Delivery (CI/CD) as part of a comprehensive DevOps course.
  • He mentions previous videos on basic and advanced CI/CD setups available on his channel, emphasizing the importance of understanding CI/CD in modern software development.

Understanding CI/CD

  • The video aims to explain what CI/CD is, its significance, and the tools involved in this process.
  • Abhishek highlights the transition from legacy CI/CD setups to modern solutions that cater to scalable applications like Kubernetes.

What is CI/CD?

Definition and Components

  • CI/CD consists of two main components: Continuous Integration (CI) and Continuous Delivery (CD).
  • Continuous Integration involves integrating various tools and processes before delivering an application to customers.
  • Continuous Delivery focuses on deploying or delivering applications efficiently to customers across different geographical locations.

Practical Example

  • Abhishek illustrates how an application developed by a developer can be delivered globally, stressing the need for efficiency in this process.
  • He outlines essential steps such as testing, security scanning, reporting, and deployment that ensure reliable delivery of applications.

Importance of Automation in CI/CD

Steps Involved in Automation

  • The necessity for automation arises from the complexity involved in manual testing processes which can delay delivery times significantly.
  • Key automated steps include unit testing, static code analysis, vulnerability testing, end-to-end testing, reporting, and deployment.

Standard Practices

  • Each organization may have varying practices; however, certain standard steps are crucial for ensuring quality delivery.
  • Without these automated processes in place, organizations risk delivering subpar applications to their customers.

Unit Testing Explained

Introduction to Unit Testing

  • Abhishek begins discussing unit testing with a practical example involving a calculator application’s addition functionality.

Unit Testing and Code Quality in Software Development

Understanding Unit Testing

  • Unit testing involves verifying individual components of code, such as ensuring that the addition of two numbers (e.g., 2 + 3 = 5) functions correctly.
  • This process is essential for application developers to ensure that changes made to the code do not introduce errors, as manual testing for every change would be impractical.

Static Code Analysis

  • Static code analysis checks for syntactical correctness and proper formatting in the code, helping identify issues like unnecessary variable declarations that waste memory.
  • It ensures adherence to coding standards, including correct indentation and overall structure, which can sometimes be overlooked by peer reviews.

Code Quality and Vulnerability Testing

  • After updating software (e.g., a new Android version), it’s crucial to conduct vulnerability testing to prevent security risks that could lead to poor user experiences.
  • This step is vital before delivering updates or promoting applications through different stages of development.

Automation in Testing

  • Automation testing complements unit testing by validating that changes do not negatively impact other functionalities within the application (e.g., ensuring addition does not affect subtraction).
  • Functional or end-to-end testing verifies the entire application workflow rather than just isolated functions.

Reporting and Deployment Stages

  • Organizations must maintain reports on unit test coverage and overall code quality metrics for accountability and improvement tracking.
  • The deployment stage is critical; without deploying applications effectively, users cannot access them regardless of how well they are tested.

Version Control Systems (VCS)

  • Developers typically break down features into manageable chunks stored in a VCS like GitHub or Bitbucket, allowing for organized versioning of their work.
  • Each iteration (version 1, version 2, etc.) is pushed to the VCS when developers feel confident about their changes.

Continuous Integration/Continuous Deployment (CI/CD)

  • CI/CD processes are triggered upon pushing changes to a VCS. This automation streamlines workflows by executing tests and deployments without manual intervention.
  • Understanding legacy tools within CI/CD pipelines helps developers manage their deployment processes more efficiently.

CI/CD Process and Jenkins Automation

Overview of CI/CD in Application Development

  • The application developer submits version one of the added functionality to a GitHub repository, marking the beginning of the CI/CD process.
  • Following submission, various automated processes such as unit testing, static code analysis, and automation testing are triggered.
  • Jenkins is introduced as a Continuous Integration/Continuous Deployment (CI/CD) tool that monitors the GitHub repository for changes like pull requests or new commits.

Role of Jenkins in Automation

  • Jenkins acts as an orchestrator or pipeline that automates multiple tools involved in the development process.
  • It integrates tools necessary for building applications (e.g., Maven for Java applications), running unit tests (JUnit or Jacoco), and ensuring code quality (SonarQube).
  • A DevOps engineer configures these tools within Jenkins to ensure they run automatically upon code commits to the GitHub repository.

Importance of Jenkins Pipelines

  • The concept of Jenkins pipelines is crucial; they automate actions taken by integrated tools, enhancing efficiency in application delivery.
  • Pipelines facilitate integration with deployment platforms like Kubernetes or Docker, allowing seamless transitions from development to production environments.
  • Understanding pipelines is essential for job seekers in DevOps roles due to their significance in modern software delivery practices.

Stages of Application Promotion

  • The CI/CD process ensures rapid application delivery—transforming months-long cycles into minutes or hours through automation.
  • Once integrated with Maven and other tools, Jenkins can promote applications through different stages: from development to staging and finally production.

Environment Management

  • Organizations typically have multiple environments: production mirrors customer usage while staging may have limited resources for testing before final deployment.

Deployment Strategies in Jenkins

Understanding the Deployment Process

  • The initial deployment of applications occurs on a Dev platform, allowing queue engineers and automation to execute tests in a simple environment.
  • Jenkins can promote applications from Dev to Staging through manual or automatic approvals once testing is successful.
  • Staging environments may utilize more complex setups like clusters with multiple EC2 instances or Kubernetes configurations for better simulation before production deployment.
  • Cost considerations prevent staging environments from mirroring production setups, leading to simpler configurations for local testing teams.
  • The speaker encourages audience interaction by inviting questions and feedback regarding the clarity of the discussed concepts.

Legacy Tools: Jenkins Overview

  • Jenkins is referred to as a legacy tool; it has been foundational for many developers but faces challenges with modern microservices architectures.
  • Many organizations transitioned from Hudson to Jenkins over the past 7–8 years, initially focusing on on-premises deployments before moving to cloud platforms.
  • Modern applications often consist of thousands of microservices, complicating deployment processes that were simpler in earlier architectures.

Scaling Challenges with Jenkins

  • Deploying numerous services requires scaling Jenkins effectively; typically, a master node is installed on one host while additional nodes are connected for load distribution.
  • Organizations may create multiple Jenkins machines for different teams, leading to complex setups that require significant computational resources (RAM, CPU).

Cost and Maintenance Considerations

  • As more Jenkins instances are added, both costs and maintenance efforts increase significantly due to resource demands across various development teams.
  • The need for efficient compute management becomes critical; excessive virtual machines can lead to wasted resources when not actively used.

Limitations of Traditional Scaling Approaches

  • While integrating auto-scaling groups with Jenkins could provide some flexibility, complete zero-server scenarios during idle times remain unfeasible with traditional setups.
  • In high-demand environments with numerous microservices and pipelines, poorly configured systems can result in hundreds of unused virtual machines at any time.

Understanding Kubernetes and CI/CD Integration

Overview of Modern Applications and Kubernetes

  • The discussion begins with an exploration of modern applications, particularly focusing on scalable open-source solutions like Kubernetes.
  • Emphasizes the global collaboration among thousands of developers using platforms like GitHub to manage code changes effectively.

Code Change Management in Kubernetes

  • A demonstration is set up to show how Kubernetes handles code changes, specifically when a developer commits updates to the GitHub repository.
  • Highlights that there are currently 3,347 contributors to the Kubernetes project, indicating a large collaborative effort.

Pull Requests and Resource Management

  • Observes that no new pull requests or code changes have been made recently, stressing the importance of resource management during idle times.
  • Discusses expectations for zero compute instances being wasted during periods without code changes, emphasizing cost efficiency for organizations.

Utilizing GitHub Actions for CI/CD

  • Introduces GitHub Actions as a tool for continuous integration/continuous deployment (CI/CD), similar to Jenkins.
  • Explains that upon a code change, GitHub Actions spins up a Kubernetes pod or Docker container for execution, optimizing resource usage by sharing servers across projects.

Advantages of Shared Resources in CI/CD

  • Describes how shared resources allow multiple projects within an organization to utilize common infrastructure efficiently.
  • Suggests creating a centralized server on cloud platforms (like Azure or AWS) for managing builds across various repositories instead of individual setups.

Scalability and Future Considerations

  • Concludes with insights into scalability advantages offered by Kubernetes over traditional Jenkins setups; scaling can be done easily without significant overhead.

CI/CD Tools: Understanding Alternatives to Jenkins

Overview of CI/CD Tools

  • The speaker emphasizes that while Jenkins is a popular choice for CI/CD, there are several viable alternatives available, including GitHub Actions, GitLab CI, Travis CI, and CircleCI.
  • It’s important for users to be aware of these alternatives even if they lack in-depth knowledge about their implementation.

Advantages of GitHub Actions

  • The speaker prefers GitHub Actions over Jenkins due to its event-driven nature. Unlike Jenkins, which requires specific webhook configurations for pull requests, GitHub Actions operates with default event-driven capabilities.
  • GitHub Actions allows integration of pipelines across different projects seamlessly, providing flexibility and efficiency in managing workflows.

Comparison with Other CI/CD Solutions

  • While the focus is on GitHub Actions and Jenkins, the speaker acknowledges inquiries about GitLab pipelines. They note that understanding GitHub Actions can facilitate learning about GitLab CI since both share similar functionalities with minor syntactical differences.
Video description

Join our 24*7 Doubts clearing group (Discord Server) www.youtube.com/abhishekveeramalla/join Udemy Course (End to End DevOps Project) https://www.udemy.com/course/ultimate-devops-project-with-resume-preparation/?referralCode=9F588E43854814744430 --- --- Support my work https://www.buymeacoffee.com/abhishekprd Hi Everyone, Today's class (Day-18) is about "Introduction to CICD". In this class we will understand: 1. Introduction to CICD. 2. Why CICD ? 3. Legacy CICD setup 4. Advanced CICD setup 5. CICD setup in top MNCs 6. Preparation for Live Project tomorrow Telegram channel =============== https://t.me/abhishekveeramalla About me: ----------------- LinkedIn: https://www.linkedin.com/in/abhishek-veeramalla-77b33996/ GitHub: https://github.com/iam-veeramalla Medium: https://abhishekveeramalla-av.medium.com/ YouTube: https://www.youtube.com/channel/UCnnQ3ybuyFdzvgv2Ky5jnAA?app=desktop . . Disclaimer: Unauthorized copying, reproduction, or distribution of this video content, in whole or in part, is strictly prohibited. Any attempt to upload, share, or use this content for commercial or non-commercial purposes without explicit permission from the owner will be subject to legal action. All rights reserved.