-
Notifications
You must be signed in to change notification settings - Fork 73
feat: Local DevEx: Component Hot Reloading, component benchmarks for warm/cold builds #1095
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,18 @@ | ||
| # Root `.env.local` (optional, loaded by Makefile via `-include .env.local`) | ||
| # Used for kind-on-remote-host and other repo-wide overrides. | ||
| # | ||
| # Example: point tools at a remote machine running kind (Tailscale, etc.) | ||
| KIND_HOST=100.x.x.x | ||
|
|
||
| # --- Frontend local dev (`components/frontend/.env.local`) --- | ||
| # Prefer generating this file with `make dev-env` after the cluster is up; it sets: | ||
| # BACKEND_URL=http://localhost:<KIND_FWD_BACKEND_PORT>/api | ||
| # OC_TOKEN=<from cluster test-user-token> | ||
| # ENABLE_OC_WHOAMI=0 | ||
| # | ||
| # `make dev COMPONENT=frontend` writes/updates that file and runs `npm run dev`. | ||
| # `make dev COMPONENT=frontend,backend` uses BACKEND_URL=http://localhost:8080/api (local go run). | ||
| # | ||
| # Makefile variables for the dev workflow (pass on the command line): | ||
| # COMPONENT=frontend|backend|frontend,backend | ||
| # AUTO_CLUSTER=true # run kind-up without prompting if cluster is missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| name: Component Benchmarks | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| components: | ||
| description: Components to benchmark (comma-separated or all) | ||
| required: false | ||
| default: all | ||
| type: string | ||
| mode: | ||
| description: cold, warm, or both | ||
| required: false | ||
| default: both | ||
| type: string | ||
| baseline_ref: | ||
| description: Optional baseline git ref | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| pull_request: | ||
| types: [labeled] | ||
|
|
||
| jobs: | ||
| benchmark: | ||
| if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'benchmark' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: components/backend/go.mod | ||
| cache: false | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Run benchmark harness self-tests | ||
| run: | | ||
| bash tests/bench-test.sh | ||
|
|
||
| - name: Run component benchmarks | ||
| env: | ||
| COMPONENTS: ${{ inputs.components }} | ||
| MODE: ${{ inputs.mode }} | ||
| BASELINE_REF_INPUT: ${{ inputs.baseline_ref }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| ARGS=() | ||
| if [[ -n "${COMPONENTS:-}" && "${COMPONENTS}" != "all" ]]; then | ||
| ARGS+=(--components "${COMPONENTS}") | ||
| fi | ||
| if [[ -n "${MODE:-}" ]]; then | ||
| ARGS+=(--mode "${MODE}") | ||
| fi | ||
| if [[ -n "${BASELINE_REF_INPUT:-}" ]]; then | ||
| ARGS+=(--baseline-ref "${BASELINE_REF_INPUT}") | ||
| fi | ||
|
|
||
| bash scripts/benchmarks/component-bench.sh --ci "${ARGS[@]}" >/dev/null | ||
|
|
||
| - name: Publish benchmark summary | ||
| if: always() | ||
| run: | | ||
| { | ||
| echo "### Component Benchmarks" | ||
| echo | ||
|
|
||
| if [[ -f reports/benchmarks/results.tsv ]]; then | ||
| OVER_BUDGET=$(awk -F'\t' 'NR > 1 && $2 == "cold" && $8 == "false" { print $1 " (" $4 "s)" }' reports/benchmarks/results.tsv) | ||
| REGRESSIONS=$(awk -F'\t' 'NR > 1 && ($6 + 0) > 10.0 { print $1 " " $2 " (" $6 "%)" }' reports/benchmarks/results.tsv) | ||
|
|
||
| if [[ -n "${OVER_BUDGET}" ]]; then | ||
| echo "**Over 60s budget:**" | ||
| while IFS= read -r line; do | ||
| [[ -n "$line" ]] && echo "- $line" | ||
| done <<<"${OVER_BUDGET}" | ||
| echo | ||
| fi | ||
|
|
||
| if [[ -n "${REGRESSIONS}" ]]; then | ||
| echo "**Regressions over 10%:**" | ||
| while IFS= read -r line; do | ||
| [[ -n "$line" ]] && echo "- $line" | ||
| done <<<"${REGRESSIONS}" | ||
| echo | ||
| fi | ||
| fi | ||
|
|
||
| echo '```text' | ||
| if [[ -f reports/benchmarks/results.human.txt ]]; then | ||
| cat reports/benchmarks/results.human.txt | ||
| else | ||
| echo "No human-readable benchmark report was generated." | ||
| fi | ||
| echo '```' | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Upload benchmark artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: component-benchmarks-${{ github.run_id }} | ||
| path: reports/benchmarks/ | ||
| retention-days: 7 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.