Run builds on single-build agents (#37702)

This is an effort to reduce cache errors when multiple agents try to build the yarn cache at the same time
https://github.com/grafana/deployment_tools/issues/13329
This commit is contained in:
Julien Duchesne 2021-08-10 02:16:09 -04:00 committed by GitHub
parent 33aeee60ff
commit 7e63118ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 7 deletions

View File

@ -235,6 +235,9 @@ services:
MYSQL_ROOT_PASSWORD: rootpass MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana MYSQL_USER: grafana
node:
type: no-parallel
trigger: trigger:
event: event:
- pull_request - pull_request
@ -563,6 +566,9 @@ services:
MYSQL_ROOT_PASSWORD: rootpass MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana MYSQL_USER: grafana
node:
type: no-parallel
trigger: trigger:
branch: branch:
- main - main
@ -663,6 +669,9 @@ steps:
depends_on: depends_on:
- initialize - initialize
node:
type: no-parallel
trigger: trigger:
branch: branch:
- main - main
@ -1005,6 +1014,9 @@ services:
MYSQL_ROOT_PASSWORD: rootpass MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana MYSQL_USER: grafana
node:
type: no-parallel
trigger: trigger:
ref: ref:
- refs/tags/v* - refs/tags/v*
@ -1477,6 +1489,9 @@ services:
image_pull_secrets: image_pull_secrets:
- dockerconfigjson - dockerconfigjson
node:
type: no-parallel
trigger: trigger:
ref: ref:
- refs/tags/v* - refs/tags/v*
@ -1617,6 +1632,9 @@ steps:
depends_on: depends_on:
- initialize - initialize
node:
type: no-parallel
trigger: trigger:
ref: ref:
- refs/tags/v* - refs/tags/v*
@ -1948,6 +1966,9 @@ services:
MYSQL_ROOT_PASSWORD: rootpass MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana MYSQL_USER: grafana
node:
type: no-parallel
trigger: trigger:
event: event:
- custom - custom
@ -2414,6 +2435,9 @@ services:
image_pull_secrets: image_pull_secrets:
- dockerconfigjson - dockerconfigjson
node:
type: no-parallel
trigger: trigger:
event: event:
- custom - custom
@ -2554,6 +2578,9 @@ steps:
depends_on: depends_on:
- initialize - initialize
node:
type: no-parallel
trigger: trigger:
event: event:
- custom - custom
@ -2860,6 +2887,9 @@ services:
MYSQL_ROOT_PASSWORD: rootpass MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana MYSQL_USER: grafana
node:
type: no-parallel
trigger: trigger:
ref: ref:
- refs/heads/v* - refs/heads/v*
@ -3325,6 +3355,9 @@ services:
image_pull_secrets: image_pull_secrets:
- dockerconfigjson - dockerconfigjson
node:
type: no-parallel
trigger: trigger:
ref: ref:
- refs/heads/v* - refs/heads/v*
@ -3496,6 +3529,6 @@ get:
--- ---
kind: signature kind: signature
hmac: 68edb93a18f2e16f8a9b2bf3d21073e181e56d2420feec37ae80b121fc2faeeb hmac: 4f23649a1678c66fb96af929675bcf569cca3b208d425eace86150d981ee9fbb
... ...

View File

@ -17,20 +17,28 @@ def pipeline(
): ):
if platform != 'windows': if platform != 'windows':
platform_conf = { platform_conf = {
'os': 'linux', 'platform': {
'arch': 'amd64', 'os': 'linux',
'arch': 'amd64'
},
# A shared cache is used on the host
# To avoid issues with parallel builds, we run this repo on single build agents
'node': {
'type': 'no-parallel'
}
} }
else: else:
platform_conf = { platform_conf = {
'os': 'windows', 'platform': {
'arch': 'amd64', 'os': 'windows',
'version': '1809', 'arch': 'amd64',
'version': '1809',
}
} }
pipeline = { pipeline = {
'kind': 'pipeline', 'kind': 'pipeline',
'type': 'docker', 'type': 'docker',
'platform': platform_conf,
'name': name, 'name': name,
'trigger': trigger, 'trigger': trigger,
'services': services, 'services': services,
@ -39,6 +47,7 @@ def pipeline(
) + steps, ) + steps,
'depends_on': depends_on, 'depends_on': depends_on,
} }
pipeline.update(platform_conf)
if edition in ('enterprise', 'enterprise2'): if edition in ('enterprise', 'enterprise2'):
pipeline['image_pull_secrets'] = [pull_secret] pipeline['image_pull_secrets'] = [pull_secret]