Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support selectable number of CPUs for docker_builder #741

Closed
asomers opened this issue Dec 10, 2020 · 3 comments
Closed

Support selectable number of CPUs for docker_builder #741

asomers opened this issue Dec 10, 2020 · 3 comments
Labels

Comments

@asomers
Copy link

asomers commented Dec 10, 2020

Description

The docker_builder task should support a selectable number of CPUs. Right now it's hard-coded to 4.

Context

The Nix project has some tasks that must use docker_builder, even though they can only take advantage of a single CPU. So we're wasting resources. Our builds would schedule sooner, and your bills would be lower, if we could reduce the CPU count.

Anything Else

The task in question:
https://github.com/nix-rust/nix/blob/5729d0f391775c98699f0f92f8df6b7f5f49fc7d/.cirrus.yml#L53

@RDIL
Copy link
Contributor

RDIL commented Dec 10, 2020

Good idea! Can't hurt to have faster build times 😄

@asomers
Copy link
Author

asomers commented Feb 23, 2021

I tried following the instructions in 25346a5 , but they don't work. My builds failed with a Failed to start an instance: INVALID_ARGUMENT: Forbidden error. Is something about this not allowed for community cluster builds? Here is the relevant excerpt of my .cirrus.yml:

task:
  env:
    ...
  matrix:
    ...
  compute_engine_instance:
    image_project: cirrus-images
    image: family/docker_builder
    platform: linux
    cpu: 1                          # Since QEMU will only use 1 thread
    memory: 4G
  setup_script:
    ...

nix-rust/nix#1392

@fkorotkov
Copy link
Contributor

@asomers should be docker-builder with a dash and not underscore _.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants