Limit max default concurrency for tox jobs.
Change-Id: Ib6a4a54391d32a25292562af4d02bbc43b2ff274
This commit is contained in:
parent
160da96973
commit
597bd231a8
@ -6,24 +6,29 @@
|
|||||||
register: sysctl_hw_logicalcpu
|
register: sysctl_hw_logicalcpu
|
||||||
when: ansible_processor_vcpus is not defined
|
when: ansible_processor_vcpus is not defined
|
||||||
|
|
||||||
- name: Number of cores
|
- name: Get number of cores
|
||||||
set_fact:
|
set_fact:
|
||||||
num_cores: "{{ansible_processor_vcpus|default(sysctl_hw_logicalcpu.stdout)}}"
|
num_cores: "{{ansible_processor_vcpus|default(sysctl_hw_logicalcpu.stdout)}}"
|
||||||
|
|
||||||
- name: Set concurrency for cores == 3 or less
|
- name: Set default concurrency
|
||||||
set_fact:
|
set_fact:
|
||||||
default_concurrency: "{{ num_cores }}"
|
stestr_concurrency: "{{ num_cores|int // 2 }}"
|
||||||
when: num_cores|int <= 3
|
|
||||||
|
|
||||||
- name: Limit max concurrency when more than 3 vcpus are available
|
- name: Limit min concurrency to 1
|
||||||
set_fact:
|
set_fact:
|
||||||
default_concurrency: "{{ num_cores|int // 2 }}"
|
stestr_concurrency: 1
|
||||||
when: num_cores|int > 3
|
when:
|
||||||
|
stestr_concurrency|int < 1
|
||||||
|
|
||||||
|
- name: Limit max concurrency to 2
|
||||||
|
set_fact:
|
||||||
|
stestr_concurrency: 2
|
||||||
|
when:
|
||||||
|
stestr_concurrency|int > 2
|
||||||
|
|
||||||
- name: Run Tobiko
|
- name: Run Tobiko
|
||||||
command: tox -e {{tox_envlist}} {{tox_extra_args}} -- --concurrency={{default_concurrency}}
|
command: tox -e {{tox_envlist}} {{tox_extra_args}} -- --concurrency={{stestr_concurrency}}
|
||||||
args:
|
args:
|
||||||
chdir: "{{tox_dir}}"
|
chdir: "{{tox_dir}}"
|
||||||
become: true
|
become: true
|
||||||
become_user: stack
|
become_user: stack
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user