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

Build: Add benchmark task #22161

Merged
merged 57 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e83716a
New benchmark task WIP
shilman Apr 19, 2023
8c5f604
Upgrade wait-on
shilman Apr 24, 2023
cbd3646
Save bench results to benchmark-results
shilman Apr 24, 2023
7d3ff46
Add bench tasks to CI
shilman Apr 24, 2023
7ad75d9
Fix scripts package.json
shilman Apr 24, 2023
ea192ec
update parallelism
shilman Apr 24, 2023
765a508
update bench CI
shilman Apr 24, 2023
c240afe
Remove inDevelopment for bench tasks
shilman Apr 24, 2023
9a3fa7e
Revert "update parallelism"
shilman Apr 24, 2023
bcefa03
Fix duplicate keys
shilman Apr 24, 2023
abbb3d3
WIP temporarily change branch to next on repro command
yannbf Apr 24, 2023
6865fc5
fix path
yannbf Apr 24, 2023
ee01dad
fix path using constant
yannbf Apr 24, 2023
205e5fa
add error handling
yannbf Apr 24, 2023
9d75abb
Try writing to the sandbox dir instead of the code dir
shilman Apr 25, 2023
7798f31
Merge branch 'shilman/bench-task' of github.com:storybookjs/storybook…
shilman Apr 25, 2023
329ef4e
Upload to bigquery
shilman Apr 25, 2023
c87cc36
Merge branch 'next' into shilman/bench-task
ndelangen Jun 19, 2023
73ca1eb
fix lockfile
ndelangen Jun 19, 2023
dc22078
change config
ndelangen Jun 19, 2023
b6b0589
fix
ndelangen Jun 19, 2023
94e19ac
set parallelism to 11
ndelangen Jun 19, 2023
baebb8a
remove the old bench CI config
ndelangen Jun 19, 2023
8e7baa2
sync version of playwright
ndelangen Jun 19, 2023
7d872c6
add dep
ndelangen Jun 19, 2023
7b42ad6
optimization
ndelangen Jun 19, 2023
9619db2
update lockfile
ndelangen Jun 19, 2023
cc07e57
fix
ndelangen Jun 19, 2023
c920970
Merge branch 'next' into shilman/bench-task
ndelangen Jun 19, 2023
cc53ac6
switch to real types, fix import
ndelangen Jun 20, 2023
629c0f0
Merge branch 'next' into shilman/bench-task
ndelangen Jun 21, 2023
e463aa8
Merge branch 'next' into shilman/bench-task
ndelangen Jun 21, 2023
c3ae637
wip
ndelangen Jun 21, 2023
16aa722
wip
ndelangen Jun 21, 2023
ee122a4
it works
ndelangen Jun 21, 2023
f83b18d
update the upload script
ndelangen Jun 21, 2023
01e52ec
Merge branch 'next' into shilman/bench-task
ndelangen Jun 21, 2023
13f4cae
fix vite projects
ndelangen Jun 21, 2023
70e2601
Upload to new bench2 table
shilman Jun 22, 2023
2ec97e5
Update upload types/schema & document
shilman Jun 22, 2023
ac6984f
strict typing
ndelangen Jun 22, 2023
d5bc851
correct URLs per browse, kill port
ndelangen Jun 22, 2023
ea01393
regen lockfile
ndelangen Jun 22, 2023
df1090b
fix index.html not being a route during dev
ndelangen Jun 22, 2023
5dca45c
Merge branch 'next' into shilman/bench-task
ndelangen Jun 22, 2023
e620575
Make browser data consistent
ndelangen Jun 22, 2023
5a910d2
fix port-killer in CI
ndelangen Jun 22, 2023
d8422af
Merge branch 'next' into shilman/bench-task
ndelangen Jun 22, 2023
bb47352
remove port-killer add MDX tracking
ndelangen Jun 22, 2023
0289bb3
Skip docs benchmarks for now
shilman Jun 23, 2023
1016621
Fix defaults, error logging
shilman Jun 23, 2023
2d8a691
Fix typo
shilman Jun 23, 2023
2df984e
add bench.json to workspace to be persisted in CI
ndelangen Jun 23, 2023
e310832
use the frame api instead, await for the load event, increase timeout…
ndelangen Jun 23, 2023
6ad0c47
Merge branch 'next' into shilman/bench-task
ndelangen Jun 23, 2023
ca5dca9
fix
ndelangen Jun 23, 2023
1107520
cleanup
ndelangen Jun 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 45 additions & 101 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,88 +151,6 @@ jobs:
- code/renderers
- code/presets
- .verdaccio-cache
cra-bench:
executor:
class: large
name: sb_playwright
working_directory: /tmp/storybook
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Running local registry
command: |
cd code
yarn local-registry --open
background: true
- run:
name: Wait for registry
command: |
cd code
yarn wait-on http://localhost:6001
- run:
name: set up cra repro, skip tests
command: |
cd code
SANDBOX_ROOT=../bench yarn task --task sandbox --template cra/default-ts --skip-template-stories --start-from=never --no-link
- run:
name: Run @storybook/bench on repro
command: |
cd bench/cra-default-ts
rm -rf node_modules
mkdir node_modules
../../code/node_modules/.bin/sb-bench 'yarn install' --label cra
- report-workflow-on-failure
- run:
name: prep artifacts
when: always
command: tar cvzf /tmp/cra-default-ts-bench.tar.gz bench/cra-default-ts
- store_artifacts:
path: /tmp/cra-default-ts-bench.tar.gz
destination: cra-default-ts-bench.tar.gz
react-vite-bench:
executor:
class: large
name: sb_playwright
working_directory: /tmp/storybook
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Running local registry
command: |
cd code
yarn local-registry --open
background: true
- run:
name: Wait for registry
command: |
cd code
yarn wait-on http://localhost:6001
- run:
name: set up react-vite repro, skip tests
command: |
cd code
SANDBOX_ROOT=../bench yarn task --task sandbox --template react-vite/default-ts --skip-template-stories --start-from=never --no-link
- run:
name: Run @storybook/bench on repro
command: |
cd bench/react-vite-default-ts
rm -rf node_modules
mkdir node_modules
../../code/node_modules/.bin/sb-bench 'yarn install' --label react-vite
- report-workflow-on-failure
- run:
name: prep artifacts
when: always
command: tar cvzf /tmp/react-vite-default-ts-bench.tar.gz bench/react-vite-default-ts
- store_artifacts:
path: /tmp/react-vite-default-ts-bench.tar.gz
destination: react-vite-default-ts-bench.tar.gz
lint:
executor:
class: large
Expand Down Expand Up @@ -525,6 +443,36 @@ jobs:
- store_artifacts: # this is where playwright puts more complex stuff
path: code/playwright-results/
destination: playwright
bench:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
# NOTE: this assumes that the bench-dev key represents BOTH tasks since they are run at the same time.
# Update if we ever run these separately!
name: Running Dev Bench
command: yarn task --task bench-dev --template $(yarn get-template << pipeline.parameters.workflow >> bench-dev) --no-link --start-from=never --junit
- run:
name: Running Prod Bench
command: yarn task --task bench-build --template $(yarn get-template << pipeline.parameters.workflow >> bench-dev) --no-link --start-from=never --junit
- run:
name: Uploading results
command: yarn upload-bench $(yarn get-template << pipeline.parameters.workflow >> bench-dev)
- report-workflow-on-failure:
template: $(yarn get-template << pipeline.parameters.workflow >> bench-dev)
- store_artifacts: # this is where playwright puts more complex stuff
path: code/bench-results/
destination: bench-results

workflows:
ci:
Expand Down Expand Up @@ -596,18 +544,12 @@ workflows:
- coverage:
requires:
- unit-tests
- cra-bench:
requires:
- build
- react-vite-bench:
requires:
- build
- create-sandboxes:
parallelism: 9
parallelism: 11
requires:
- build
- build-sandboxes:
parallelism: 9
parallelism: 11
requires:
- create-sandboxes
- chromatic-sandboxes:
Expand All @@ -625,6 +567,10 @@ workflows:
parallelism: 9
requires:
- build-sandboxes
- bench:
parallelism: 2
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# requires:
Expand Down Expand Up @@ -653,34 +599,32 @@ workflows:
- coverage:
requires:
- unit-tests
- cra-bench:
requires:
- build
- react-vite-bench:
requires:
- build
- create-sandboxes:
parallelism: 18
parallelism: 20
requires:
- build
- build-sandboxes:
parallelism: 18
parallelism: 20
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 18
parallelism: 20
requires:
- build-sandboxes
- e2e-production:
parallelism: 18
parallelism: 20
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
requires:
- create-sandboxes
- test-runner-production:
parallelism: 18
parallelism: 20
requires:
- build-sandboxes
- bench:
parallelism: 2
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ code/test-results/
code/playwright-results/
code/playwright-report/
code/playwright/.cache/
code/bench-results/
Loading