Things to know before registering for the AWS Certified DevOps Engineer Certification Exams. ✌✌
What is CI/CD?
Understanding this deployment principle is one of the essential things to know when preparing for the certification exams. CI/CD simply means, Continuous Integration and Continuous Deployment.
Continuous integration is a DevOps software development practice where developers regularly merge their code changes into a central repository, after which automated builds and tests are run. Continuous integration most often refers to the build or integration stage of the software release process and entails both an automation component (e.g. a CI or build service) and a cultural component (e.g. learning to integrate frequently). The key goals of continuous integration are to find and address bugs quicker, improve software quality, and reduce the time it takes to validate and release new software updates.
Why is Continuous Integration Needed?
In the past, developers on a team might work in isolation for an extended period of time and only merge their changes to the master branch once their work was completed. This made merging code changes difficult and time-consuming, and also resulted in bugs accumulating for a long time without correction. These factors made it harder to deliver updates to customers quickly.
How does Continuous Integration Work?
With continuous integration, developers frequently commit to a shared repository using a version control system such as Git. Prior to each commit, developers may choose to run local unit tests on their code as an extra verification layer before integrating. A continuous integration service automatically builds and runs unit tests on the new code changes to immediately surface any errors.
With continuous delivery, code changes are automatically built, tested, and prepared for a release to production. Continuous delivery expands upon continuous integration by deploying all code changes to a testing environment and/or a production environment after the build stage.
Continuous Integration Benefits
Continuous integration helps your team be more productive by freeing developers from manual tasks and encouraging behaviors that help reduce the number of errors and bugs released to customers.
With more frequent testing, your team can discover and address bugs earlier before they grow into larger problems later.
Continuous integration helps your team deliver updates to their customers faster and more frequently.
Continuous Deployment (CD) is a software release process that uses automated testing to validate if changes to a codebase are correct and stable for immediate autonomous deployment to a production environment.
The benefits of continuous deployment
- Return on investment is high
- Automated
- Monitoring and alerts
Benefits of CI/CD
- Build faster
- Decrease code review time
- Automatic: You don’t have to manually test your code when using this method of code deployment.
- Faster fault isolation: CICD makes it easier to detect faults during code deployment.
- Additional deployment features: It allows seamless introduction of new deployment features.
CI/CD PIPELINE
- Source Stage: This shows the source of your code (Source Code Repository, similar to GitHub).
- Deploy Stage (Development): This can be achieved using AWS code deploy into and EC2 instance server.
- Deploy Stage (Production): his can be achieved using AWS code deploy into and EC2 instance server.
AWS CODE COMMITAWS Code Commit is a secure, highly scalable, managed source control service that hosts private Git repositories. It makes it easy for teams to securely collaborate on code with contributions encrypted in transit and at rest. Code Commit eliminates the need for you to manage your own source control system or worry about scaling its infrastructure. You can use Code Commit to store anything from code to binaries. It supports the standard functionality of Git, so it works seamlessly with your existing Git-based tools.
Benefit of AWS Code Commit
- Fully Managed: AWS Code Commit eliminates the need to host, maintain, back up, and scale your own source control servers. The service automatically scales to meet the growing needs of your project.
- Secure: AWS Code Commit automatically encrypts your files in transit and at rest. Code Commit is integrated with AWS Identity and Access Management (IAM) allowing you to customize user-specific access to your repositories.
- High Availability: AWS Code Commit has a highly scalable, redundant, and durable architecture. The service is designed to keep your repositories highly available and accessible.
- Collaborate on Code: AWS Code Commit helps you collaborate on code with teammates via pull requests, branching, and merging. You can implement workflows that include code reviews and feedback by default, and control who can make changes to specific branches.
- Faster Development Cycle: AWS Code Commit keeps your repositories close to your build, staging, and production environments in the AWS cloud. You can transfer incremental changes instead of the entire application. This allows you to increase the speed and frequency of your development lifecycle.
- Use of Existing Tools: AWS Code Commit supports all Git commands and works with your existing Git tools. You can keep using your preferred development environment plugins, continuous integration/continuous delivery systems, and graphical clients with Code Commit.
AWS CODE BUILDCode Build is a fully managed build service that compiles code, performs unit test, produces artifacts that are ready to deploy and eliminates the need to provision-manage-scale build servers by providing pre-package build environments and allows us to build customized build environment.
BENEFITS OF USING AWS CODEBUILD
- It’s fully managed: You don’t have to set up and build server, patch, update or maintain them.
- It’s on demand: It automatically scales to meet your requirements. No more migrating to larger EC2 instance server because, your builds are taking too long. You only pay for the minutes you consume.
- It’s preconfigured: It comes with many preconfigured build environments for the most popular programming languages. You just need to configure it to use your build script.
AWS CODE DEPLOYAWS Code Deploy is a fully managed deployment service that automates deployments to:
- Amazon EC2 instances
- On-premises instance
- AWS Lambda functions.
It also makes it easier to:
- Rapidly deploy new features
- Update Lambda function versions
- Avoid downtime during deployment
- Handle the full complex deployment process without any human intervention.
CODE TESTING
Why we test code
- To meet the requirement defined
- Ensure that the code performs in an acceptable period of time.
- Ensure that the code is usable.
- Ensure that the code respond to all kind of input.
TYPES OF CODE TESTING
Automatic testing
1. Automatic execution of tests during the CICD deployment.2. Comparison of actual outcomes to predicted outcomes. 3. Fast, and continuous feedback.3. Immediate notification of code faults/bugs.
Unit testing
It involves testing individual level of code testing to ensure they function correctly.
ARTIFACTSAn artifact is a product or by-product produced during the software development process. Example:
- Compiled binaries
- Source Code
- Documentation
- Use Cases
- Class diagrams
DEPLOMENT STRATAGIES
Single Target Deployment
Example: Build – Target
- It is used for small development projects, especially when legacy or non highly available infrastructure is involved.
- When it is initiated, a new application version is installed on the target server.
- A brief outage occurs during installation. There are no secondary servers so testing is limited. Rollback involves removing the new version and installing the previous.
All-at-once deployment
Example: Build – Target – Target
- Deployment happens in one step. Destination involves multiple targets.
- It is more complicated than single target, it requires orchestration tooling.
Minimum in -service Deployment
- Deployment happens in multiple stages
- Deployment happens to as many targets as possible while maintaining the minimum in service targets
- A few moving parts, orchestration and health checks are required.
- Allows automated testing, deployment targets are assesed and tested prior to continuing.
- There is not downtime.
Rolling Deployment
- Deployment happens in multiple stages, number of targets per stage is user-defined.
- Moving parts, orchestration and health checks are required.
- Overall application health isn’t maintain.
- Can be least efficient deployment time based on time-taken
- Allows automated testing, deployment targets are assesed and tested prior to continuing.
- Prevents downtime issues.
- Can be paused, allowing multi-version testing
Blue Green Deployment
- Rquires advances orchestration tooling
- Rollback is clean
Canary Deployment
- Keep blue active
- Route53 – weighted round robin
AWS CLOUDFORMATION
- It is a building block
- It’s a language that gives you building block to describe the infrastructure you want to provision in AWS.
Text Files: Containing JSON and yaml format. You can version it and track changes like any other piece of code.
Free:You can build your entire infrastructure with CloudFormation.
CLOUDFORMATION TERMS
- Stack: A collection of AWS resources that you manage as a single unit.
- Template: This is the document that describe how to act and what to create.
- Stack Policy: IAM style policy statement which governs what can be changed and who can change it.
WHEN AND WHERE TO USE CLOUDFORMATION
- To deploy infrastructure rather than doing it manually.
- To create repeatable patterned environment. Eg WordPress blog and a database if you were running a web hosting business.
- To automate testing for CI/CD environments.
- To define and environment all at once.
- To manage infrastructure configuration using software development style versioning and code repositories such as git.
Next, Part Two 👏👏✌✌✌✌✌✌Thank you making time to read our blog post on AWS DevOps engineer Certification check list. This is the part one of this blog post series.
Send us your feedback on this blog post with your questions and suggestions on how best we can improve our content. Please don’t forget to share our content.