A Real Life Example of CI/CD Pipelines in Action

Written by abdulghaani | Published 2022/03/15
Tech Story Tags: devop | devops | devops-principles | devops-containers | containers-devops | devops-top-story | software-development | agile-software-development

TLDRBokbasen, an Oslo, Norway-based information service, developed infrastructure to support e-books and streaming service for audiobooks. The company needed to use a container-based microservice framework to develop new services to be simple and more agile to extend with new functionality while also enabling the component services to scale independently. The challenge was to distribute these new products with an IT staff involving only five employees. Then appeared a need for DevOps, which seamlessly streamlined releasing updates and new functionality. The use of IaC provides a consistent and repeatable method.via the TL;DR App

Introduction

Bokbasen, an Oslo, Norway-based Information service, offers many benefits to all parts of Norway’s publishing community.
The company develops a catalog with information about all Norwegian publishers. By utilizing this single centralized register, the industry can easily implement this data and information in online stores, bookshops, libraries, and academic institutions, instead of wasting time gathering it.
When e-books entered the market, Bokbasen quickly adapted to this new culture by developing the infrastructure to support e-books and a streaming service for audiobooks. 
In 2017 Bokbasen started using Amazon Web Services – AWS for storing and transcoding audio files, and by 2018 Bokbasen shifted its public website to AWS.
In 2019, Bokbasen shifted its focus towards digitizing and distributing books and learning materials. For this purpose, it utilized two services. Digitalelev, a product for management and procurement of digital learning materials in schools, and Allvit, a platform for distributing textbooks and resources for higher education.

The Challenge

A primary challenge was to distribute these new products with an IT staff involving only five employees. The solution was to use a combination of scalable managed services from AWS, with subject matter professionals from Basefarm, a European managed service provider and AWS partner.
To solve this issue, Bokbasen chose to use a container-based microservice framework to develop new services to be simple and more agile to extend with new functionality while also enabling the component services to scale independently. Basefarm worked with 
Then appeared a need for DevOps as Bokbasen has to deploy and manage DevOps Pipelines, which seamlessly streamlined releasing updates and new functionality.

Role of DevOps

DevOps brings a cultural transition by allowing the team that authors code to collaborate with the team that operates it, turning them into a unified team.  Instead of each software release possessing many potentially troublesome changes that are all released simultaneously, teams are encouraged to release small changes more frequently, thus diluting the impact of change and making it easier for the teams to test and release.
Bokbasen has to choose a deployment strategy that possesses:
  • Develop a single framework for all environments
  • Release early and often
  • Use a rolling deployment to replace or upgrade the existing model gradually.
  • Always fix faults by rolling forward to an upcoming release
Bokbasen needed to enable their own DevOps team to deploy consistently to all environments, including production.

Solution

Infrastructure as Code
Utilizing Infrastructure as Code technology (IaC), a client can streamline infrastructure, application services, and CI/CD pipelines across environments.
HashiCorp Terraform is used to deploy Bokbasen’s infrastructure. Self-service terraform templates are being used to allow instant and easy creation of new pipelines.
Many top IaC modules by the Hashicorp Terraform registry and from Basefarm have simplified the transition process. The use of IaC provides a consistent and repeatable method for the deployment and management of infrastructure across platforms.
Spring Cloud Config and AWS Systems Manager Parameter Store store configuration and confidential information such as security credentials encrypted and audited.
Deployment Pipelines
Basefarm Professional Services, in collaboration with Bokbasen, are intended to develop pipelines, build application artifacts and deploy microservices across Bokbasens Test, Stage, and Production accounts, integrating with the following AWS utilities:
LambdaFargateBatchAPI-GatewayStatic websites on S3 (utilizing CloudFront CDN)
When an individual of the DevOps team commits to a selected branch, the pipeline is triggered, developing artifacts, such as the service segment’s docker images and sending those images to the container registry.  The channel then deploys the container to the Test environment. A smoke test using Runscope is called. The DevOps team manually verifies the outcomes of the test before allowing the release to be deployed to the stage, where the same smoke test and additional verification tests are performed before allowing final deployment in Production. 
DevOps have read-only access to stage and production environments. The pipelines are authorized for cross-account deployments assuming Identity and Access Management – IAM roles.
Database schemas are also altered as part of the deployment pipelines via Flyway.
Similar pipelines are designed for CI/CD of Fargate hosted containers, batch jobs, lambda functions, and S3 hosted websites.
First Published here

Written by abdulghaani | Tech evangelist on a mission to create something magical
Published by HackerNoon on 2022/03/15