gutschilla

gutschilla

Hi,

I want to minimize the time required for the most-costly compilation step in our CI/CD environment.

Right now, We’re on GitLab using their runners to be installed on own machines. I tried with Kubernetes clusters on GCP and the Gitlab-provided runners and while this all runs fine and scales nicely horizontally, I am looking for quick build and test times. In our setup, the build step (fetching deps, comiling deps and own sources) takes the most time: a few minutes, depending on the project.

So I am looking into dedicated hardware for our gitlab runners where the major workload will be mix compile :computer: . Since the team isn’t big I don’t really need all the auto-scaling a Kubenetes cluster has to offer. I want quick result for individual builds from scratch.

Should I go many cores or for high single-core performance? Other than that I’ll go for local SSD storage and plenty of RAM (64GB).

Thanks for your insights!

Showing Posts 1 to 10

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

The biggest thing when making a CI/CD fast is minimizing the work that you need to do each time. If you’re having to compile all the dependencies from scratch every time, the biggest win will come from finding a way to cache that, regardless of what CPUs are available. We have a large project, but the actual compilation step takes < 10 seconds in our CI unless we are changing a dependency.

gutschilla

gutschilla OP

Very True! Thanks a lot. We already cache _build until mix.lock changes. What do you do to cache? Any more insights?

We also have a lot of git submodules in place for which we currently cannot track for changes – this surely can be tweaked somehow.

Still, getting build + test done even 10 seconds faster would greatly improve the process here for a lot lot unresolved reasons circling around the testability on developer machines. And while we’re of course going to fix those problems at some point I am looking for ways to have us more productive even at this stage.

In the short term simply adding more CPU power is an option to me as we can just buy it w/o someone to make it. So again, any insights on which hardware to get?

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Fair enough! The Elixir compiler is parallel, so you should be able to benefit from multiple cores. SSD speed is of course critical. 64gb of ram is wildly more than enough.

LostKobrakai

LostKobrakai

…until it hit’s compile time dependencies. So checking those and cutting them at certain places can also improve compilation times (in cached scenarios).

gutschilla

gutschilla OP

Alirght, I’ll try with both

  • i9-9900K (8 cores)
  • Ryzen7 1700X (8 cores)

both with 64GB of RAM at a comparable price (~70EUR/mo) and will let you know the results.

If the improvement is big enough I’ll give the EPYC 7401P (24 cores) at 200€/mo a shot.

Thanks @benwilson512 and @LostKobrakai for sharing your insights!

sorentwo

sorentwo

Oban Core Team

Tiered caches will help with the build time a lot. On CircleCI, even with small test runners, you are able to cache the hex deps, the compiled code, and PLT files if dialyzer is your thing.

I do this for all my applications, but here is an example for an open source project:

https://github.com/sorentwo/oban/blob/master/.circleci/config.yml

dimitarvp

dimitarvp

In terms of CPUs, I found the AMD Threadripper series quite good for compilation and overall dev work. Best results so far however I achieved with recent Xeon CPUs. They have bigger L1 / L2 / L3 caches than most consumer CPUs and I found them to be extremely adequate for compiling.

I’d say go for a Threadripper or a Xeon with at least 8 physical cores and a NVMe / PCI SSD (> 2 GB/s read/write speed). RAM isn’t of huge consequence for a compilation / CI machine. Even 16GB would be an overkill, unless the machine is also a dev machine and I misread you.

dimitarvp

dimitarvp

To follow up, on a Xeon 2150B (10/20 cores):

$ time mix compile --force
Compiling 418 files (.ex)
Generated <our_company_app> app
mix compile --force  76.51s user 16.60s system 664% cpu 14.020 total

To be honest, I expected the Elixir compiler to be able to utilise all cores. :confused:

Still pretty fast though.

NobbZ

NobbZ

It probably will be able to, but this is only possible if there is not a single compile time dependency between modules.

dimitarvp

dimitarvp

Yep, I’ve heard the dependency graph can severely impact the parallelisation of compilation
and it makes sense.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews