Skip to content

Sample repo for the talk Elevate Your Builds: Next-Gen CI/CD

Notifications You must be signed in to change notification settings

philwelz/next-gen-cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sample repo for the talk Elevate Your Builds: Next-Gen CI/CD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published