Skip to content

dansholds/circleci-scaling-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scaling-docker-solution

A solution to scale (up & down) docker runners on a macos/windows/linux system.

Prerequsites:

  1. You will need an active runner on a machine that has docker installed, for instance, I used my MacBook, but you can use an Ubuntu EC2 Instance.
  2. Populate your CCI project env vars with the following, and populate with the correct infomation:
    • RESOURCE_CLASS = Your docker runners resource-class
    • DOCKER_RESOURCE_TOKEN = Your docker runners resource-class token
    • CIRCLE_TOKEN = Your CCI API token
    • DOCKER_IMAGE_ID = The image ID of whatever docker image you want your resource-class to use

Once you have done the above, you should be able to run the pipeline and watch as your containers spin up based on how many waiting tasks you have for a specified resource-class.

Once no more tasks are running for that resource-class, the containers will be removed.

Scaling script polling for waiting jobs: Screenshot 2022-01-26 at 15 33 31

6 Containers created based on amount of waiting jobs: Screenshot 2022-01-26 at 15 33 54

Jobs are complete, so containers are removed: Screenshot 2022-01-26 at 15 34 04

About

testing circleci runner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages