SENG3011

🌿  2.5 - Advanced CI/CD

In this lecture

  • What is GraphQL?
  • What is gRPC?
  • Trade-offs of using GraphQL and gRPC

Continuous Integration

A software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including tests) to detect integration errors as quickly as possible.

Martin Fowler, 2006

 

We integrate at many different levels - the testing pyramid becomes essential here. 

Continuous Integration

  • The software should always be in a working state
    • Passing pipeline on master branch
    • Cycle of develop/change, build/test, integrate/test, deliver
  • Your code on master should be suitable for release at any moment
    • Integration is continuous, rather than delayed
  • CI procedures should be
    • Reproducible
    • Largely (if not entirely) automated

What does CI include?

  • Version control management (Git)
  • Automated build processes (Maven/Gradle, Cmake, Cargo, Yarn)
  • Automated testing (frontend and backend) (JUnit, Pytest, Jest, Selenium)
  • Team processes (PR cycles, code reviews)
  • CI server to automate processes (CI runners, GitHub Actions)

A more complex CI workflow

Continuous Delivery

A software development discipline where you build software in such a way that the software can be released to production at any time

Martin Fowler, 2013

 

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

Agile Manifesto

 

 

Continuous Delivery

A software development discipline where you build software in such a way that the software can be released to production at any time

Martin Fowler, 2013

 

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

Agile Manifesto

 

 

Continuous Deployment

A continuation of the Continuous Delivery process, where software application is automatically deployed to the customer.

 

Aims to automate the release of every working version of software to production environment.

 

Consider the trade offs of Continuous Delivery vs. Continuous Deployment

Continuous Delivery vs. Continuous Deployment

  • For both:
    • Need a strong foundation in CI
    • Test, test, test
    • Deployment process is automated
  • Moving to continuous deployment:
    • Need a very strong testing culture - this will determine the quality of your releases
    • Release more often, accelerating customer feedback loop
    • Releases are smaller (lower risk), but without manual check (higher risk)
    • Faster iteration
    • More change boarding of customers
    • Need to embrace feature flags to minimise risk

Infrastructure as Code

  • Infrastructure as Code (IaC) is the managing and provisioning of infrastructure through code instead of through manual processes
  • Code vs. Clickops
    • Saves time and cost
    • More portable
    • More scalable 
  • Cloud computing helps us outsource some effort - but we still need to configure our PasS

Terraform

  • HashiCorp Terraform is a infrastructure as code tool that allows a user to define resources in human-readable configuration files
  • Declarative framework
  • Three stages
    • Write - define resources
    • Plan - terraform creates an execution plan describing the infrastructure to create/update/destroy based on existing infrastructure
    • Apply - terraform performs proposed operations, respecting resources dependencies

Let's look at our terraform code