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

Integrate ui-profiler, improve dispatch, separate jlpm/yarn #143

Merged
merged 22 commits into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2f01301
Allow mutable yarn installs, cherry-picked from:
krassowski Apr 29, 2023
1e44554
Fix transpilation
fcollonval Mar 20, 2023
b122712
WIP: integrate ui-profiler with benchmarks
krassowski Apr 2, 2023
3f24f8d
Install testing dependencies separately from launching lab
krassowski Apr 23, 2023
46c6ca4
Use workflow from branch for benchmark for easier development
krassowski Apr 23, 2023
06638bb
We need jlpm, but which version will we get? depends on reference!
krassowski Apr 23, 2023
0f5a991
Fix ui-profiler, use fixture
krassowski Apr 29, 2023
3182bae
Add more scenarios for execution time
krassowski Apr 29, 2023
3d7fc8c
Update profiler, add prettier
krassowski Apr 30, 2023
dafb772
Disable user-interface part of ui-profiler
krassowski Apr 30, 2023
a682aaf
Add useful projects, increase width of the screen
krassowski May 1, 2023
9b7f429
Rename notebooks to be more descriptive
krassowski May 1, 2023
bb83b1d
Rewrite profiler tests, add dedicated workflow with dispatch
krassowski May 1, 2023
be3da43
Adjust timeouts, custom attachment for style-sheets
krassowski May 1, 2023
5d0f7a0
Fix workflow
krassowski May 1, 2023
f4cb908
Ensure fkill is available
krassowski May 1, 2023
f99d7f6
Add rules benchmark, adjust timeouts and defaults
krassowski May 1, 2023
ad396a1
Wrap grep argument in quotes
krassowski May 1, 2023
d676c88
Allow retires due to completer flakiness
krassowski May 1, 2023
e117d93
Simplify reporting for profiler workflow
krassowski May 1, 2023
8b8b102
Reduce default sample numbers
krassowski May 1, 2023
48a9cdc
Increase delay for plotly rendering
krassowski May 1, 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
38 changes: 32 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,48 @@ on:
description: "Git repository reference to the challenger branch"
required: true
challenger_project:
description: "Playwright project to execute on the challenger version"
description: "Playwright project to execute (windowingMode JupyterLab 4; renderCellOnIdle: JupyterLab 2.3 or 3.x)"
required: false
default: "jupyterlab"
type: "string"
type: choice
options:
- jupyterlab
- jupyterlab-renderCellOnIdle-on
- jupyterlab-renderCellOnIdle-off
- jupyterlab-windowingMode-full
- jupyterlab-windowingMode-defer
- jupyterlab-windowingMode-none
- jupyterlab-1-2
- retrolab
- testing
reference_branch:
description: "Reference branch on the JupyterLab repository (default: master)"
required: false
default: "master"
reference_project:
description: "Playwright project to execute on the reference version"
required: false
default: "jupyterlab"
type: "string"
default: ""
type: choice
options:
- jupyterlab
- jupyterlab-renderCellOnIdle-on
- jupyterlab-renderCellOnIdle-off
- jupyterlab-windowingMode-full
- jupyterlab-windowingMode-defer
- jupyterlab-windowingMode-none
- jupyterlab-1-2
- retrolab
- testing
browser:
description: "Which browser to use (one of 'chromium' [default], 'firefox', 'webkit')"
description: "Which browser to use (default 'chromium')"
required: false
default: "chromium"
type: choice
options:
- chromium
- firefox
- webkit
samples:
description: "Number of samples to compute"
required: false
Expand All @@ -49,7 +74,8 @@ permissions:

jobs:
test:
uses: jupyterlab/benchmarks/.github/workflows/run-benchmark.yml@master
# uses: jupyterlab/benchmarks/.github/workflows/run-benchmark.yml@master
uses: ./.github/workflows/run-benchmark.yml
with:
event: ${{ github.event_name }}
# Repository to clone for scheduled benchmark
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/profiler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: JupyterLab UI Profiler

on:
workflow_dispatch:
inputs:
challenger:
description: "JupyterLab Git repository with the challenger version (format {owner}/{repo})"
required: true
default: "jupyterlab/jupyterlab"
challenger_branch:
description: "Git repository reference to the challenger branch"
required: true
default: "master"
challenger_project:
description: "Playwright project to execute (windowingMode JupyterLab 4; renderCellOnIdle: JupyterLab 2.3 or 3.x)"
required: false
default: "jupyterlab"
type: choice
options:
- jupyterlab
- jupyterlab-renderCellOnIdle-on
- jupyterlab-renderCellOnIdle-off
- jupyterlab-windowingMode-full
- jupyterlab-windowingMode-defer
- jupyterlab-windowingMode-none
- jupyterlab-1-2
- retrolab
- testing
reference_branch:
description: "Reference branch on the JupyterLab repository (default: master)"
required: false
default: "master"
reference_project:
description: "Playwright project to execute on the reference version"
required: false
default: ""
type: choice
options:
- jupyterlab
- jupyterlab-renderCellOnIdle-on
- jupyterlab-renderCellOnIdle-off
- jupyterlab-windowingMode-full
- jupyterlab-windowingMode-defer
- jupyterlab-windowingMode-none
- jupyterlab-1-2
- retrolab
- testing
browser:
description: "Which browser to use (default 'chromium')"
required: false
default: "chromium"
type: choice
options:
- chromium
- firefox
- webkit
samples:
description: "Number of samples to compute (individual tests multiply this number by their a test-speicific factor)"
required: false
default: "25"
type: string
grep:
description: "Tests to include (grep expression)"
required: false
default: ""
type: string
grep_invert:
description: "Tests to skip (grep expression). Benchmarking individual rules requires a lot of time (reduce number of samples!)"
required: false
default: "rules"
type: string

permissions:
issues: write

jobs:
test:
# uses: jupyterlab/benchmarks/.github/workflows/run-profiler.yml@master
uses: ./.github/workflows/run-profiler.yml
with:
challenger: ${{ github.event.inputs.challenger || 'jupyterlab/jupyterlab' }}
challenger_branch: ${{ github.event.inputs.challenger_branch || 'master' }}
challenger_project: ${{ github.event.inputs.challenger_project || 'jupyterlab' }}
reference_branch: ${{ github.event.inputs.reference_branch || 'master' }}
reference_project: ${{ github.event.inputs.reference_project || 'jupyterlab' }}
browser: ${{ github.event.inputs.browser || 'chromium' }}
samples: ${{ github.event.inputs.samples || '25' }}
grep: ${{ github.event.inputs.grep || '' }}
grep_invert: ${{ github.event.inputs.grep_invert || '' }}
artifacts_name: 'profiler-report'
50 changes: 35 additions & 15 deletions .github/workflows/run-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ on:
required: false
default: "benchmark-assets"
type: string
grep_invert:
description: "Tests to skip"
required: false
default: "@slow"
type: string

env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0

permissions:
issues: write
Expand Down Expand Up @@ -154,7 +162,7 @@ jobs:
git checkout ${OLD_REF_SHA}
working-directory: reference

- name: Install dependencies
- name: Install reference
run: |
set -ex
echo "OLD_REF_SHA=$(git log -n1 --format='%H')" >> $GITHUB_ENV
Expand All @@ -169,24 +177,31 @@ jobs:
set -ex
pip install ipywidgets plotly
pip install -v extensions/fixed-data-table
pip install jupyterlab-ui-profiler
jupyter labextension disable @jupyterlab/ui-profiler:user-interface

jupyter server extension list
jupyter labextension list
working-directory: benchmarks

- name: Launch JupyterLab
- name: Install testing dependencies
shell: bash
run: |
yarn install
working-directory: benchmarks/tests

- name: Launch JupyterLab (reference)
shell: bash
run: |
jlpm install
# Mount a volume to overwrite the server configuration
jlpm start-jlab 2>&1 > /tmp/jupyterlab_server_old.log &
yarn start-jlab 2>&1 > /tmp/jupyterlab_server_old.log &
working-directory: benchmarks/tests

- name: Install browser
run: |
set -ex
# Install only Chromium browser
jlpm playwright install chromium
yarn playwright install chromium
working-directory: benchmarks/tests

- name: Wait for JupyterLab
Expand All @@ -195,16 +210,16 @@ jobs:
resource: http-get://localhost:9999/lab
timeout: 360000

- name: Execute benchmark tests
- name: Execute benchmark tests (reference)
continue-on-error: true
working-directory: benchmarks/tests
run: |
set -ex
# Update test screenshots
BENCHMARK_NUMBER_SAMPLES=1 PW_VIDEO=1 jlpm run test --project ${{ inputs.reference_project }} -u
BENCHMARK_NUMBER_SAMPLES=1 PW_VIDEO=1 yarn run test --project ${{ inputs.reference_project }} -u --grep-invert '${{ inputs.grep_invert }}'

# -u is needed to generate the benchmark expected file
jlpm run test --project ${{ inputs.reference_project }} -u
yarn run test --project ${{ inputs.reference_project }} -u --grep-invert '${{ inputs.grep_invert }}'
cp tests-out/lab-benchmark-expected.json /tmp/

- name: Kill the server
Expand All @@ -224,7 +239,7 @@ jobs:
ref: ${{ env.CHALLENGER_REF }}
path: challenger

- name: Install dependencies
- name: Install challenger
run: |
set -ex
# Fix for installing JupyterLab 1
Expand All @@ -237,11 +252,10 @@ jobs:
cp /tmp/lab-benchmark-expected.json ./tests-out
working-directory: challenger

- name: Launch JupyterLab
- name: Launch JupyterLab (challenger)
shell: bash
run: |
# Mount a volume to overwrite the server configuration
jlpm start-jlab 2>&1 > /tmp/jupyterlab_server_new.log &
yarn start-jlab 2>&1 > /tmp/jupyterlab_server_new.log &
working-directory: benchmarks/tests

- name: Wait for JupyterLab
Expand All @@ -250,7 +264,7 @@ jobs:
resource: http-get://localhost:9999/lab
timeout: 360000

- name: Execute benchmark tests
- name: Execute benchmark tests (challenger)
continue-on-error: true
shell: bash
env:
Expand All @@ -259,13 +273,13 @@ jobs:
run: |
set -ex
# Update test screenshots
BENCHMARK_NUMBER_SAMPLES=1 PW_VIDEO=1 jlpm run test --project ${{ inputs.challenger_project }} -u
BENCHMARK_NUMBER_SAMPLES=1 PW_VIDEO=1 yarn run test --project ${{ inputs.challenger_project }} -u --grep-invert '${{ inputs.grep_invert }}'

# Copy reference here otherwise it will use the value from the update screenshots
# command called just before
cp /tmp/lab-benchmark-expected.json ./tests-out

jlpm run test --project ${{ inputs.challenger_project }}
yarn run test --project ${{ inputs.challenger_project }} --grep-invert '${{ inputs.grep_invert }}'
working-directory: benchmarks/tests

- name: Generate the report
Expand Down Expand Up @@ -301,6 +315,12 @@ jobs:
# Copy the reference data to upload it as artifact
cp ./tests-out/lab-benchmark-expected.json ./benchmark-results/

- name: Set job summary
if: always()
shell: bash
run: |
cat ./benchmarks/tests/benchmark-results/lab-benchmark.md >> $GITHUB_STEP_SUMMARY

- name: Publish the report
if: ${{ inputs.event == 'schedule' }}
uses: actions/github-script@v6
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/run-memory-leak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
default: "7"
type: string

env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0

jobs:
memory-leak-test:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -79,8 +82,7 @@ jobs:
- name: Launch JupyterLab
shell: bash
run: |
# Mount a volume to overwrite the server configuration
jlpm start-jlab 2>&1 > /tmp/jupyterlab_server.log &
yarn start-jlab 2>&1 > /tmp/jupyterlab_server.log &
working-directory: benchmarks/memory-leaks

- name: Execute memory leaks test
Expand Down
Loading