question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Save cost for CI infrastructure by having more types of build machines

See original GitHub issue

After https://github.com/apache/airflow/pull/14531 we are running the CI infrastructiure of ours using r5a.2xlarge machines. They are needed for tests (thanks to having 8xCPUs and 64 GB RAM we can run full suite of tests in 15 minutes instead of 1h by running the tests in parallel. Likely (due to ~ 2x less cost of running tests (2x more price/ 4x less time) we are saving money. We also achieve 30%-40% speedups on Pylint, Static Checks (thanks to 8 CPUS available).

However not all jobs can use the memory/parallelism and we can use much cheaper machines without impacting CI execution time:

  • Docs (not yet but possible)

  • K8S tests (not yet but possible)

  • Building Images

  • Providers building and testing

  • Image verification

  • Image waiting (this one is particularly wasteful)

By introducing a smaller type of machines and assigning the “big” machine type only to the jobs that can utilise higher we can drive the cost down significantly.

Small machine = r5a.large with 2 CPUs and 16GB memory should likely be enough

Spot Price in Frankfurt:

r5.2xlarge = $0.1549 per Hour r5a.large = $0.0365 per Hour

This means that for non-test jobs we can have further 4 x smaller cost if we do it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
potiukcommented, Mar 27, 2021

Before I go the “small instance” route, I am going to experiment now with the bigger instances. I think even now they will give us significant boost and cheaper prices (because they will be needed for shorter time). We got some 30 USD/day with parallel tests (which is ~ 800 USD/month give or take including lower traffic during weekends) which is still quite a bit too high.

I set the autoscaling like this now:

  • rx52xlarge instances (64 GB 8 CPUS)
  • Max 20 instances (lowered from 30)
  • Desired: 3 instances (lowered from 5)

The tests will run ~2 times faster now and I hope it will bring the cost down (I am also working on few more optimizations).

0reactions
potiukcommented, Jul 5, 2022

I think we will not do it - we should only do something like that when/if we move to K8S driven CI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build vs. Buy - The Cost of Implementing CI/CD - Harness
Value and focus are drivers when considering buying a CI/CD platform. The decision becomes even more difficult when an existing investment has ......
Read more >
CI/CD pipelines explained: Everything you need to know
Planning to implement CI/CD? This comprehensive guide explores the stages of a CI/CD pipeline, its pros and cons, best practices and more.
Read more >
Benefits of running continuous integration jobs on self-hosted ...
Cost savings​​ By setting up a CI instance on your infrastructure (whether an AWS EC2 instance or one hosted on your site), you...
Read more >
50 Best CI/CD Tools All DevOps Teams Should Know In 2022
Pricing : Free - Up to 500 build minutes and macOS standard VM; Pay-as-You-Go - prices per user per VM type; Team $299/month...
Read more >
An Introduction to CI/CD Best Practices - DigitalOcean
There are some straightforward steps you can take to improve speed, like scaling out your CI/CD infrastructure and optimizing tests. However, as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found