SlideShare a Scribd company logo
GitLab Runners
auto-scaled with
StepFunctions
AWS User Group Stockholm
2022-05-31
GitLab Runners
auto-scaled with
StepFunctions
AWS User Group Stockholm
2022-05-31
Hello, I’m
JIMMY DAHLQVIST
Head of AWS @ Sigma Technology Cloud
AWS Ambassador & Community Builder
@jimmydahlqvist
Why self hosted runners?
@jimmydahlqvist
Reasons for
◦ Long lived IAM Credentials
▫ Oauth is now supported
◦ Limits in CI/CD minutes
◦ Network requirements
@jimmydahlqvist
Reasons against
◦ Operational Overhead
◦ Runner bottlenecks
▫ All runners are busy
@jimmydahlqvist
Architecture Overview
@jimmydahlqvist
GitLab
@jimmydahlqvist
GitHub
@jimmydahlqvist
How it works
◦ Webhooks add message to
EventBridge
◦ EventBridge invoke StepFunction
@jimmydahlqvist
GitHub
@jimmydahlqvist
Why StepFunction
◦ Several tasks too perform
◦ Need to be coordinated
@jimmydahlqvist
StepFunction overview
@jimmydahlqvist
@jimmydahlqvist
StepFunction Logic
◦ Check Cooldown
◦ Determine needed scaling action
◦ Perform Scaling
▫ Add / Remove runners
@jimmydahlqvist
@jimmydahlqvist
Amazon State Language
@jimmydahlqvist
Task
@jimmydahlqvist
Definition
◦ Single Unit of work
◦ All work is done by tasks
@jimmydahlqvist
@jimmydahlqvist
Service / SDK Integration
◦ 15+ service integrations
◦ 200+ SDK integrations
◦ Specified in Resource
@jimmydahlqvist
Lambda Integration
◦ Invokes Lambda function directly
◦ Specify the function name
◦ arn:aws:lambda:region:account:function:
function_name
@jimmydahlqvist
Service Integration
◦ Calls service directly
◦ Specify the Service and API
◦ arn:aws:states:region:account:servicenam
e:APIname
@jimmydahlqvist
SDK Integration
◦ Calls the service using SDK
◦ Specify Service and apiAction
◦ arn:aws:states:::aws-sdk:
serviceName:apiAction
@jimmydahlqvist
Retry
◦ Powerful error handling
◦ Supported in Task and Parallel
◦ Specify backoff, max attempts,
intervals, and specific errors
@jimmydahlqvist
Retry Example
@jimmydahlqvist
Catch
◦ Powerful error handling
◦ Supported in Task, Map, and
Parallel
◦ Specify an error handling task
@jimmydahlqvist
Catch Example
@jimmydahlqvist
Input and Output Processing
◦ Manipulate the input and output
◦ Select only what you need
@jimmydahlqvist
ResultPath
◦ We can:
▫ Replace input with Result
▫ Discard Result
▫ Include Result with Input
▫ Update a Node in Input
@jimmydahlqvist
Replace input with Result
@jimmydahlqvist
Discard Result
@jimmydahlqvist
Include Result with Input
@jimmydahlqvist
Update a Node in Input
@jimmydahlqvist
Choice
@jimmydahlqvist
Overview
◦ Controls the flow in the state
machine
◦ Powerful comparison operations
◦ Support catch all else (Default)
path
@jimmydahlqvist
@jimmydahlqvist
String comparison
◦ StringEquals
◦ StringGreaterThan
◦ StringMatches
◦ IsString
◦ Etc
@jimmydahlqvist
Extended logic
◦ Support AND, OR, NOT operators
@jimmydahlqvist
Variable comparison
◦ Compare with a variable in the
event
@jimmydahlqvist
String matches
◦ Support wildcards
@jimmydahlqvist
Boolean and Numeric
◦ Supports same logic both Boolean
and Numeric
@jimmydahlqvist
Pass & Wait
@jimmydahlqvist
Pass
◦ State that will just be passed
through
◦ Use when END is not directly
supported
@jimmydahlqvist
@jimmydahlqvist
Wait
◦ Specified number of seconds
◦ Timestamp has passed
◦ Can be a variable in the event
@jimmydahlqvist
Parallel
@jimmydahlqvist
Run it in parallel
◦ Runs several Tasks at the same
time
◦ Collect data in parallel
@jimmydahlqvist
Improve it
@jimmydahlqvist
@jimmydahlqvist
@jimmydahlqvist
Open Source
@jimmydahlqvist
GitHub
◦ https://github.com/JimmyDqv/self
-hosted-runners-on-aws
◦ https://github.com/JimmyDqv/gitl
ab-runners-on-aws
Thank You!!
@jimmydahlqvist
https://www.linkedin.com/in/dahlqvistjimmy/
https://jimmydqv.com | https://dev.to/jimmydqv

More Related Content

PPTX
CI/CD As first and last line of defence
PPTX
EventBridge Patterns and real world use case
PPTX
Introduction to testing in Cloud / AWS
PDF
Continuous performance: Load testing for developers with gatling @ Utrecht JUG
PDF
Serverless for High Performance Computing
PPTX
Building a serverless event driven Slack Bot
PDF
Amsterdam JUG - Continuous performance
PDF
Continuous Performance - Load testing for developers with gatling @ iSense 2016
CI/CD As first and last line of defence
EventBridge Patterns and real world use case
Introduction to testing in Cloud / AWS
Continuous performance: Load testing for developers with gatling @ Utrecht JUG
Serverless for High Performance Computing
Building a serverless event driven Slack Bot
Amsterdam JUG - Continuous performance
Continuous Performance - Load testing for developers with gatling @ iSense 2016

Similar to Autoscaled Github Runners using StepFunctions (20)

PDF
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
PDF
Codemotion tech pills - Continuous performance
PDF
DeTesters meetup november 2018 - Continuous performance: load testing with G...
PPTX
Jdk.io cloud native business automation
ODP
Pipelines for SysAdmins #pipelineconf 2015
ODP
Pipelines for sysadmins
PDF
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
PDF
Web.dev extended : What's new in Web [GDG Taichung]
PDF
Webinar: End to End Security & Operations with Chainguard and Weave GitOps
PPTX
AWS ECS and AWS Fargate demystified: run serverless containers
PPTX
SQL azure database for DBA
PPTX
Delhi_Meetup_flyway_Integration.pptx
PPTX
SSIS Monitoring Deep Dive
PDF
Cqrs 101 all your base belong to us
PDF
EventBus and MVP: The Chocolate and Peanut Butter of Decoupling Android
PDF
#FunLearnSeason2 - Talk 2 : Publishing your App on Appexchange
PDF
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
PDF
Agile Business Transformation
PDF
Devops - Agile on Steroids
ODP
Git Flow - An Introduction
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Codemotion tech pills - Continuous performance
DeTesters meetup november 2018 - Continuous performance: load testing with G...
Jdk.io cloud native business automation
Pipelines for SysAdmins #pipelineconf 2015
Pipelines for sysadmins
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
Web.dev extended : What's new in Web [GDG Taichung]
Webinar: End to End Security & Operations with Chainguard and Weave GitOps
AWS ECS and AWS Fargate demystified: run serverless containers
SQL azure database for DBA
Delhi_Meetup_flyway_Integration.pptx
SSIS Monitoring Deep Dive
Cqrs 101 all your base belong to us
EventBus and MVP: The Chocolate and Peanut Butter of Decoupling Android
#FunLearnSeason2 - Talk 2 : Publishing your App on Appexchange
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
Agile Business Transformation
Devops - Agile on Steroids
Git Flow - An Introduction
Ad

More from Jimmy Dahlqvist (19)

PPTX
Event-driven and serverless in the world of IoT
PPTX
Building resilient serverless workloads: Navigating through failures
PPTX
Serverless website analytics with Lambda@Edge
PPTX
Cloud-grilled delights a high-tech approach to perfect BBQ
PPTX
Building-resilient-serverless-workloads-Navigating-through-failure
PPTX
Serverless website analytics with Lambda@Edge
PPTX
Encrypting data in S3 with Stepfunctions
PPTX
Building a serverless AI powered translation service
PPTX
Serverless cloud architecture patterns
PPTX
AI Powered event-driven translation bot
PPTX
Serverless and event-driven in a world of IoT
PPTX
Event-driven and serverless in the world of IoT
PPTX
IoT Enabled Smoker for Great BBQ
PPTX
IoT Enabled smoker for Great BBQ
PPTX
IoT enable smoker for great BBQ
PPTX
re:Invent Recap Breakfast
PPTX
CHAOS ENGINEERING – OR LET'S SHAKE THE TREE
PPTX
Road to an asynchronous device registration API
PPTX
GitOps in action, powered by Alexa.
Event-driven and serverless in the world of IoT
Building resilient serverless workloads: Navigating through failures
Serverless website analytics with Lambda@Edge
Cloud-grilled delights a high-tech approach to perfect BBQ
Building-resilient-serverless-workloads-Navigating-through-failure
Serverless website analytics with Lambda@Edge
Encrypting data in S3 with Stepfunctions
Building a serverless AI powered translation service
Serverless cloud architecture patterns
AI Powered event-driven translation bot
Serverless and event-driven in a world of IoT
Event-driven and serverless in the world of IoT
IoT Enabled Smoker for Great BBQ
IoT Enabled smoker for Great BBQ
IoT enable smoker for great BBQ
re:Invent Recap Breakfast
CHAOS ENGINEERING – OR LET'S SHAKE THE TREE
Road to an asynchronous device registration API
GitOps in action, powered by Alexa.
Ad

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm

Autoscaled Github Runners using StepFunctions

Editor's Notes

  • #25: Super powerful! Before you had to use a lambda to do a simple SDK call!!
  • #26: USE IT!!!! Backoff is a very good practice! Erros like: TaskFailed, Runtime, HeartbeatTimeout, BranchFailed and many more!
  • #28: USE IT!!!! Handle the errors that got away….
  • #29: Combination of retry and catch DESCRIBE WHAT HAPPENS IN DIFFERENT SCENARIOS!!!!!
  • #32: THIS IS DEFAULT AS WELL!!!
  • #55: Thank you! You can follow me on twitter or connect on linked in.