Skip to content

Commit 69c9ff0

Browse files
committed
merge base and fix lint/type errors and update configs
1 parent 8f215e3 commit 69c9ff0

File tree

274 files changed

+3547
-2718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+3547
-2718
lines changed

.github/workflows/development.yml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ jobs:
2121
- name: Run quality checks
2222
run: tox -e quality
2323

24+
ui-quality-checks:
25+
permissions:
26+
contents: "read"
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Check out code
30+
uses: actions/checkout@v3
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Run quality and typing checks
36+
run: npm run lint
37+
2438
type-checks:
2539
runs-on: ubuntu-latest
2640
strategy:
@@ -37,6 +51,20 @@ jobs:
3751
- name: Run quality checks
3852
run: tox -e types
3953

54+
ui-type-checks:
55+
permissions:
56+
contents: "read"
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Check out code
60+
uses: actions/checkout@v3
61+
62+
- name: Install dependencies
63+
run: npm ci
64+
65+
- name: Run quality and typing checks
66+
run: npm run type-check
67+
4068
precommit-checks:
4169
runs-on: ubuntu-latest
4270
strategy:
@@ -51,7 +79,21 @@ jobs:
5179
- name: Install dependencies
5280
run: pip install pre-commit
5381
- name: Run pre-commit checks
54-
run: pre-commit run --all-files
82+
run: SKIP=ruff-format pre-commit run --all-files
83+
84+
ui-precommit-check:
85+
permissions:
86+
contents: "read"
87+
runs-on: ubuntu-latest
88+
steps:
89+
- name: Check out code
90+
uses: actions/checkout@v3
91+
92+
- name: Install dependencies
93+
run: npm ci
94+
95+
- name: Run pre-commit checks
96+
run: npx husky run pre-commit
5597

5698
unit-tests:
5799
runs-on: ubuntu-latest
@@ -69,6 +111,20 @@ jobs:
69111
- name: Run unit tests
70112
run: tox -e test-unit -- -m "smoke or sanity"
71113

114+
ui-unit-tests:
115+
permissions:
116+
contents: "read"
117+
runs-on: ubuntu-latest
118+
steps:
119+
- name: Check out code
120+
uses: actions/checkout@v3
121+
122+
- name: Install dependencies
123+
run: npm ci
124+
125+
- name: Run unit tests
126+
run: npm run test:unit
127+
72128
integration-tests:
73129
runs-on: ubuntu-latest
74130
strategy:
@@ -85,6 +141,20 @@ jobs:
85141
- name: Run integration tests
86142
run: tox -e test-integration -- -m smoke
87143

144+
ui-integration-tests:
145+
permissions:
146+
contents: "read"
147+
runs-on: ubuntu-latest
148+
steps:
149+
- name: Check out code
150+
uses: actions/checkout@v3
151+
152+
- name: Install dependencies
153+
run: npm ci
154+
155+
- name: Run integration tests
156+
run: npm run test:integration
157+
88158
build:
89159
runs-on: ubuntu-latest
90160
strategy:

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Install dependencies
5353
run: pip install pre-commit
5454
- name: Run pre-commit checks
55-
run: pre-commit run --all-files
55+
run: SKIP=ruff-format pre-commit run --all-files
5656

5757
unit-tests:
5858
runs-on: ubuntu-latest

.gitignore

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,49 @@ cython_debug/
179179
*.json
180180
*.yaml
181181

182-
# Turn off UI related ignores, defer to ui/.gitignore
183-
!ui/**
182+
183+
# UI Section - Next.js/React application under src/ui/
184+
# dependencies
185+
/node_modules/
186+
/.pnp
187+
.pnp.*
188+
.yarn/*
189+
!.yarn/patches
190+
!.yarn/plugins
191+
!.yarn/releases
192+
!.yarn/versions
193+
194+
# testing
195+
coverage/
196+
197+
# next.js
198+
/src/ui/.next/
199+
/src/ui/out/
200+
201+
# production
202+
build/
203+
204+
# misc
205+
*.pem
206+
207+
# debug
208+
npm-debug.log*
209+
yarn-debug.log*
210+
yarn-error.log*
211+
.pnpm-debug.log*
212+
213+
# vercel
214+
src/ui/.vercel
215+
216+
# typescript
217+
*.tsbuildinfo
218+
src/ui/next-env.d.ts
219+
220+
# Root-level UI config files that should be tracked
221+
!package.json
222+
!package-lock.json
223+
!tsconfig.json
224+
!tsconfig.*.json
225+
!src/ui/lib
226+
!src/ui/public/manifest.json
227+
.eslintcache

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ repos:
88
rev: v0.11.7
99
hooks:
1010
- id: ruff
11+
name: run linter
12+
args: [ --fix, --show-fixes ]
13+
- id: ruff-format
14+
name: run formatter
1115
- repo: https://github.com/pre-commit/mirrors-mypy
1216
rev: v1.15.0
1317
hooks:

.prettierignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# === Don't touch ===
2+
*.md
3+
*.mdx
4+
*.yaml
5+
*.yml
6+
7+
# === Skip all JSON …
8+
*.json
9+
10+
# === include relevant json ===
11+
!src/ui/**/*.json
12+
!tests/ui/**/*.json
13+
14+
# Root-level configs to format
15+
!/.eslint.config.js
16+
!/tsconfig*.json
17+
!/*.config.{js,ts}
18+
!/jest.setup.ts

ui/.prettierrc renamed to .prettierrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
"arrowParens": "always",
33
"bracketSameLine": false,
44
"bracketSpacing": true,
5-
"jsxBracketSameLine": false,
65
"jsxSingleQuote": false,
7-
"printWidth": 100,
6+
"printWidth": 88,
87
"semi": true,
98
"singleQuote": true,
109
"tabWidth": 2,

DEVELOPING.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,94 @@ Review the coverage report to confirm that your new code is adequately tested.
179179

180180
3. **Address Feedback**: Respond to any feedback from reviewers and make necessary changes.
181181

182+
## Developing the Web UI
183+
184+
The GuideLLM project includes a frontend UI located in `src/ui`, built using [Next.js](https://nextjs.org/). This section provides instructions for working on the UI.
185+
186+
### Getting Started
187+
188+
First, install dependencies:
189+
190+
```bash
191+
npm install
192+
```
193+
194+
Then, start the local development server:
195+
196+
```bash
197+
npm run dev
198+
```
199+
200+
Then open [http://localhost:3000](http://localhost:3000) in your browser.
201+
202+
### Building for Production
203+
204+
To build the app for production (output in the `out` directory):
205+
206+
```bash
207+
npm run build
208+
```
209+
210+
### Running UI Tests
211+
212+
- **Unit tests**:
213+
214+
```bash
215+
npm run test:unit
216+
```
217+
218+
- **Integration tests**:
219+
220+
```bash
221+
npm run test:integration
222+
```
223+
224+
- **Integration+Unit tests with coverage**:
225+
226+
```bash
227+
npm run coverage
228+
```
229+
230+
- **End-to-end tests** (using Cypress, ensure live dev server):
231+
232+
```bash
233+
npm run test:e2e
234+
```
235+
236+
### Code Quality and Styling
237+
238+
- **Fix styling issues**:
239+
240+
```bash
241+
npm run format
242+
```
243+
244+
- **Run ESLint checks**:
245+
246+
```bash
247+
npm run lint
248+
```
249+
250+
- **Run TS type checks**:
251+
252+
```bash
253+
npm run type-checks
254+
```
255+
256+
##### Tagging Tests
257+
258+
Reference [https://www.npmjs.com/package/jest-runner-groups](jest-runner-groups) Add @group with the tag in a docblock at the top of the test file to indicate which types of tests are contained within. Can't distinguish between different types of tests in the same file.
259+
260+
```
261+
/**
262+
* Admin dashboard tests
263+
*
264+
* @group smoke
265+
* @group sanity
266+
* @group regression
267+
*/
268+
```
269+
182270
## Additional Resources
183271

184272
- [CONTRIBUTING.md](https://github.com/neuralmagic/guidellm/blob/main/CONTRIBUTING.md): Guidelines for contributing to the project.

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,48 @@ The `guidellm benchmark` command is used to run benchmarks against a generative
153153

154154
- `--output-path`: Defines the path to save the benchmark results. Supports JSON, YAML, or CSV formats. If a directory is provided, the results will be saved as `benchmarks.json` in that directory. If not set, the results will be saved in the current working directory.
155155

156+
### GuideLLM UI
157+
158+
GuideLLM UI is a companion frontend for visualizing the results of a GuideLLM benchmark run.
159+
160+
### 🛠 Running the UI
161+
162+
1. Use the Hosted Build (Recommended for Most Users)
163+
164+
After running a benchmark with GuideLLM, a report.html file will be generated (by default at guidellm_report/report.html). This file references the latest stable version of the UI hosted at:
165+
166+
```
167+
https://neuralmagic.github.io/guidellm/ui/dev/
168+
```
169+
170+
Open the file in your browser and you're done—no setup required.
171+
172+
2. Build and Serve the UI Locally (For Development) This option is useful if:
173+
174+
- You are actively developing the UI
175+
176+
- You want to test changes to the UI before publishing
177+
178+
- You want full control over how the report is displayed
179+
180+
```bash
181+
npm install
182+
npm run build
183+
npx serve out
184+
```
185+
186+
This will start a local server (e.g., at http://localhost:3000). Then, in your GuideLLM config or CLI flags, point to this local server as the asset base for report generation.
187+
188+
### 🧪 Development Notes
189+
190+
During UI development, it can be helpful to view sample data. We include a sample benchmark run wired into the Redux store under:
191+
192+
```
193+
src/lib/store/[runInfo/workloadDetails/benchmarks]WindowData.ts
194+
```
195+
196+
In the future this will be replaced by a configurable untracked file for dev use.
197+
156198
## Resources
157199

158200
### Documentation

cypress.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
specPattern: 'tests/ui/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
6+
supportFile: 'tests/ui/cypress/support/e2e.ts',
7+
baseUrl: 'http://localhost:3000', // optional, but good practice
8+
},
9+
});

0 commit comments

Comments
 (0)