From be1d1aa08d39704929f9d5b61975b89f9c754542 Mon Sep 17 00:00:00 2001 From: Nicholas Capo Date: Fri, 21 Feb 2020 04:59:20 -0600 Subject: [PATCH] chore(ci): Split benchmark jobs (#21624) * Remove scripts/build-benchmark.sh * Add CI_NAME environment variable --- .circleci/config.yml | 208 +++++++++++++++++++++++++++++++++++-- scripts/build-benchmark.sh | 32 ------ 2 files changed, 202 insertions(+), 38 deletions(-) delete mode 100755 scripts/build-benchmark.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index c11f730efd0eb..08ca1752994e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -361,22 +361,218 @@ jobs: paths: - "*" - run_benchmarks: + benchmark_markdown_id_512: docker: - - image: circleci/node:12 + - image: "circleci/node:12" resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "512" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_id + - run: + command: npm run build + working_directory: benchmarks/markdown_id + + benchmark_markdown_id_4096: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "4096" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_id + - run: + command: npm run build + working_directory: benchmarks/markdown_id + + benchmark_markdown_id_8192: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "8192" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_id + - run: + command: npm run build + working_directory: benchmarks/markdown_id + + benchmark_markdown_id_32768: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "32768" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_id + - run: + command: npm run build + working_directory: benchmarks/markdown_id + + benchmark_markdown_slug_512: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "512" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_slug + - run: + command: npm run build + working_directory: benchmarks/markdown_slug + + benchmark_markdown_slug_4096: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "4096" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_slug + - run: + command: npm run build + working_directory: benchmarks/markdown_slug + + benchmark_markdown_slug_8192: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "8192" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_slug + - run: + command: npm run build + working_directory: benchmarks/markdown_slug + + benchmark_markdown_slug_32768: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "32768" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_slug + - run: + command: npm run build + working_directory: benchmarks/markdown_slug + + benchmark_markdown_table_512: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "512" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_table + - run: + command: npm run build + working_directory: benchmarks/markdown_table + + benchmark_markdown_table_4096: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "4096" steps: - checkout - - run: ./scripts/build-benchmark.sh + - run: + command: npm install + working_directory: benchmarks/markdown_table + - run: + command: npm run build + working_directory: benchmarks/markdown_table + + benchmark_markdown_table_8192: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "8192" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_table + - run: + command: npm run build + working_directory: benchmarks/markdown_table + + benchmark_markdown_table_32768: + docker: + - image: "circleci/node:12" + resource_class: xlarge + environment: + CI_NAME: circleci + NUM_PAGES: "32768" + steps: + - checkout + - run: + command: npm install + working_directory: benchmarks/markdown_table + - run: + command: npm run build + working_directory: benchmarks/markdown_table workflows: version: 2 - run_benchmarks: - jobs: [run_benchmarks] + benchmark: + jobs: + - benchmark_markdown_id_512 + - benchmark_markdown_id_4096 + - benchmark_markdown_id_8192 + - benchmark_markdown_id_32768 + - benchmark_markdown_slug_512 + - benchmark_markdown_slug_4096 + - benchmark_markdown_slug_8192 + - benchmark_markdown_slug_32768 + - benchmark_markdown_table_512 + - benchmark_markdown_table_4096 + - benchmark_markdown_table_8192 + - benchmark_markdown_table_32768 triggers: - schedule: - cron: "12 3 * * *" # every day at 03:12 + cron: 12 3 * * * filters: branches: only: diff --git a/scripts/build-benchmark.sh b/scripts/build-benchmark.sh deleted file mode 100755 index 4f6dc34d0f012..0000000000000 --- a/scripts/build-benchmark.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -eux - -set -e -set -u -set -x - -BENCHMARKS=( - # create-pages - # image-processing - markdown_id - markdown_slug - markdown_table - # plugin-manifest - # query -) - -SIZES=( - 512 - 4096 - 8192 - 32768 -) - -cd benchmarks -for benchmark in "${BENCHMARKS[@]}"; do - cd "${benchmark}" - for num in "${SIZES[@]}"; do - NUM_PAGES=${num} npm install - NUM_PAGES=${num} ./node_modules/.bin/gatsby build - done - cd .. -done