Commit 349e7b2d by Arve Knudsen Committed by GitHub

Drone: Reduce parallelism of certain steps to conserve memory (#26582)

* Drone: Reduce parallelism of front-end tests to avoid OOM

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Drone: Reduce parallelism of various steps to avoid OOM

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 94d0934e
...@@ -65,7 +65,7 @@ steps: ...@@ -65,7 +65,7 @@ steps:
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- rm -rf $(go env GOCACHE) && cp -r go-cache $(go env GOCACHE) - rm -rf $(go env GOCACHE) && cp -r go-cache $(go env GOCACHE)
- ./bin/grabpl build-backend --edition oss --build-id $DRONE_BUILD_NUMBER --variants linux-x64,linux-x64-musl,osx64,win64 --no-pull-enterprise - ./bin/grabpl build-backend --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --variants linux-x64,linux-x64-musl,osx64,win64 --no-pull-enterprise
depends_on: depends_on:
- initialize - initialize
- lint-backend - lint-backend
...@@ -75,7 +75,7 @@ steps: ...@@ -75,7 +75,7 @@ steps:
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir)
- ./bin/grabpl build-frontend --no-install-deps --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on: depends_on:
- initialize - initialize
- test-frontend - test-frontend
...@@ -98,6 +98,8 @@ steps: ...@@ -98,6 +98,8 @@ steps:
- yarn run packages:typecheck - yarn run packages:typecheck
- yarn run typecheck - yarn run typecheck
- yarn run test - yarn run test
environment:
TEST_MAX_WORKERS: 50%
depends_on: depends_on:
- initialize - initialize
...@@ -105,7 +107,7 @@ steps: ...@@ -105,7 +107,7 @@ steps:
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir)
- ./bin/grabpl build-plugins --edition oss --no-install-deps - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps
depends_on: depends_on:
- initialize - initialize
- lint-backend - lint-backend
...@@ -113,7 +115,7 @@ steps: ...@@ -113,7 +115,7 @@ steps:
- name: package - name: package
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise --variants linux-x64,linux-x64-musl,osx64,win64 - . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise --variants linux-x64,linux-x64-musl,osx64,win64
depends_on: depends_on:
- build-backend - build-backend
- build-frontend - build-frontend
...@@ -298,7 +300,7 @@ steps: ...@@ -298,7 +300,7 @@ steps:
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- rm -rf $(go env GOCACHE) && cp -r go-cache $(go env GOCACHE) - rm -rf $(go env GOCACHE) && cp -r go-cache $(go env GOCACHE)
- ./bin/grabpl build-backend --edition oss --build-id $DRONE_BUILD_NUMBER - ./bin/grabpl build-backend --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER
depends_on: depends_on:
- initialize - initialize
- lint-backend - lint-backend
...@@ -308,7 +310,7 @@ steps: ...@@ -308,7 +310,7 @@ steps:
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir)
- ./bin/grabpl build-frontend --no-install-deps --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on: depends_on:
- initialize - initialize
- test-frontend - test-frontend
...@@ -331,6 +333,8 @@ steps: ...@@ -331,6 +333,8 @@ steps:
- yarn run packages:typecheck - yarn run packages:typecheck
- yarn run typecheck - yarn run typecheck
- yarn run test - yarn run test
environment:
TEST_MAX_WORKERS: 50%
depends_on: depends_on:
- initialize - initialize
...@@ -338,7 +342,7 @@ steps: ...@@ -338,7 +342,7 @@ steps:
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir)
- ./bin/grabpl build-plugins --edition oss --no-install-deps - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps
depends_on: depends_on:
- initialize - initialize
- lint-backend - lint-backend
...@@ -346,7 +350,7 @@ steps: ...@@ -346,7 +350,7 @@ steps:
- name: package - name: package
image: grafana/build-container:1.2.21 image: grafana/build-container:1.2.21
commands: commands:
- . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise - . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on: depends_on:
- build-backend - build-backend
- build-frontend - build-frontend
......
...@@ -272,7 +272,10 @@ def build_backend_step(edition, variants=None): ...@@ -272,7 +272,10 @@ def build_backend_step(edition, variants=None):
], ],
'commands': [ 'commands': [
'rm -rf $(go env GOCACHE) && cp -r go-cache $(go env GOCACHE)', 'rm -rf $(go env GOCACHE) && cp -r go-cache $(go env GOCACHE)',
'./bin/grabpl build-backend --edition {} --build-id $DRONE_BUILD_NUMBER{}'.format(edition, variants_str), # TODO: Convert number of jobs to percentage
'./bin/grabpl build-backend --jobs 8 --edition {} --build-id $DRONE_BUILD_NUMBER{}'.format(
edition, variants_str
),
], ],
} }
...@@ -286,7 +289,8 @@ def build_frontend_step(edition): ...@@ -286,7 +289,8 @@ def build_frontend_step(edition):
], ],
'commands': [ 'commands': [
restore_yarn_cache, restore_yarn_cache,
'./bin/grabpl build-frontend --no-install-deps --edition {} '.format(edition) + # TODO: Use percentage for num jobs
'./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition {} '.format(edition) +
'--build-id $DRONE_BUILD_NUMBER --no-pull-enterprise', '--build-id $DRONE_BUILD_NUMBER --no-pull-enterprise',
], ],
} }
...@@ -301,7 +305,8 @@ def build_plugins_step(edition): ...@@ -301,7 +305,8 @@ def build_plugins_step(edition):
], ],
'commands': [ 'commands': [
restore_yarn_cache, restore_yarn_cache,
'./bin/grabpl build-plugins --edition {} --no-install-deps'.format(edition), # TODO: Use percentage for num jobs
'./bin/grabpl build-plugins --jobs 8 --edition {} --no-install-deps'.format(edition),
], ],
} }
...@@ -330,6 +335,9 @@ def test_frontend_step(): ...@@ -330,6 +335,9 @@ def test_frontend_step():
'depends_on': [ 'depends_on': [
'initialize', 'initialize',
], ],
'environment': {
'TEST_MAX_WORKERS': '50%',
},
'commands': [ 'commands': [
restore_yarn_cache, restore_yarn_cache,
'yarn run prettier:check', 'yarn run prettier:check',
...@@ -394,7 +402,8 @@ def package_step(edition, variants=None): ...@@ -394,7 +402,8 @@ def package_step(edition, variants=None):
'shellcheck', 'shellcheck',
], ],
'commands': [ 'commands': [
'. scripts/build/gpg-test-vars.sh && ./bin/grabpl package --edition {} '.format(edition) + # TODO: Use percentage for jobs
'. scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition {} '.format(edition) +
'--build-id $DRONE_BUILD_NUMBER --no-pull-enterprise' + variants_str, '--build-id $DRONE_BUILD_NUMBER --no-pull-enterprise' + variants_str,
], ],
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment