Git Product home page Git Product logo

next-gen-cicd's Introduction

Elevate Your Builds: Next-Gen CI/CD with Azure Container Apps and KEDA

Build & Publish to Registry

General

Virtual machines are still the most common way to build and deploy applications via CI/CD. This session explores a new approach: KEDA, a cloud-native autoscaler that will drive the on-demand scaling of containerized build agents running on Azure Container Apps. By leveraging both technologies, we can build highly scalable, cost-efficient and sustainable CI/CD pipelines.

Meetup Details

  • Click here to view the meetup details

Slides

  • Find the slides here

Docker Images

  • Dockerfile for GitHub-runners is located here
  • Dockerfile for Azure DevOps is located here

Demo

Prerequisites

  • Install Terraform or OpenTofu
  • Inject your GitHub PAT as Terraform variable gh_token
  • Update the following variables in vars.tf to match your needs:
    • repo_owner
    • repo_scope
    • repo_name_app
    • repo_name_job
    • image_tag
  • Adopt the following locals in main.tf to match your needs:
    • prefix
    • location
    • runnerImage

Create runner image

  • Initialize your GitHub repo by adding the Workflows release.yaml & docker-build.yaml to the path .github/workflows/
  • Commit & push Dockerfile and entrypoint.sh to your repo and let the workflow build & release the image

Created resources

  • Run Terraform locally or via worklfow to create needed resources
# Initialize Terraform
terraform init
# Run Teerraform plan to see what will be created
terraform plan
# Execute Terraform apply to create resources
terraform apply -auto-approve

Demo Workflow

  • Add this demo workflow to your repo and run the workflow:
name: Octo Organization CI

on:
  workflow_dispatch:
  push:
    branches: [ main ]

jobs:
  build:
    runs-on: [self-hosted]

    steps:
      - uses: actions/checkout@v4

      - name: Display summary
        run: |
          echo "### Next-Gen CICD! :rocket:" >> $GITHUB_STEP_SUMMARY
          echo "" >> $GITHUB_STEP_SUMMARY
          echo "Hello from Container App" >> $GITHUB_STEP_SUMMARY
          echo "" >> $GITHUB_STEP_SUMMARY
          echo "- $HOSTNAME" >> $GITHUB_STEP_SUMMARY

Logs

ENV

# App Env
az containerapp env logs show \
  --name gh-runner-env-app \
  --resource-group gh-runner-rg \
  | jq

# Job Env
az containerapp env logs show \
  --name gh-runner-env-job \
  --resource-group gh-runner-rg \
  | jq

App Logs

az containerapp logs show \
  --name gh-runner-app \
  --resource-group gh-runner-rg \
  --type system \
  | jq


az containerapp logs show \
  --name gh-runner-app \
  --resource-group gh-runner-rg \
  --type console \
  | jq

Kusto

# KEDA logs
ContainerAppSystemLogs_CL
| where EventSource_s == "KEDA"
| project TimeGenerated, EventSource_s ,Reason_s, Log_s, JobName_s, EnvironmentName_s
| order by TimeGenerated asc


# KEDA logs
ContainerAppSystemLogs_CL
| where EventSource_s == "ContainerAppController"
| project TimeGenerated, EventSource_s ,Reason_s, Log_s, JobName_s, EnvironmentName_s
| order by TimeGenerated asc

Useful Links

next-gen-cicd's People

Contributors

philwelz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.