Skip to content

Commit 73f0063

Browse files
authored
Merge branch 'main' into feat/scenarios
2 parents 5e484c4 + 023c8dd commit 73f0063

Some content is hidden

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

77 files changed

+13690
-3222
lines changed

.eslintrc.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2024": true,
5+
"jest": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"next",
11+
"next/core-web-vitals",
12+
"plugin:@typescript-eslint/eslint-recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:prettier/recommended"
15+
],
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": {
18+
"ecmaFeatures": {
19+
"jsx": true
20+
},
21+
"ecmaVersion": 2024,
22+
"project": ["src/ui/tsconfig.json", "tsconfig.test.json", "tsconfig.cypress.json"],
23+
"sourceType": "module"
24+
},
25+
"plugins": ["@typescript-eslint", "import", "jest", "no-secrets", "react"],
26+
"root": true,
27+
"rules": {
28+
"complexity": ["warn", { "max": 8 }],
29+
"curly": ["error", "all"],
30+
"import/order": [
31+
"error",
32+
{
33+
"groups": [
34+
["builtin", "external"],
35+
["internal", "parent", "sibling", "index"]
36+
],
37+
"newlines-between": "always-and-inside-groups",
38+
"pathGroups": [
39+
{
40+
"pattern": "@{app,assets,classes,components,hooks,lib,pages,store,tests,types,utils}/**",
41+
"group": "internal",
42+
"position": "before"
43+
},
44+
{
45+
"pattern": "{.,..}/**",
46+
"group": "internal",
47+
"position": "after"
48+
}
49+
],
50+
"pathGroupsExcludedImportTypes": ["builtin"],
51+
"alphabetize": { "order": "asc", "caseInsensitive": true }
52+
}
53+
],
54+
"import/no-extraneous-dependencies": ["error"],
55+
"no-secrets/no-secrets": ["error", { "additionalRegexes": {}, "ignoreContent": [] }]
56+
},
57+
"settings": {
58+
"next": { "rootDir": ["src/ui/", "tests/ui/"] },
59+
"import/resolver": {
60+
"typescript": {
61+
"project": [
62+
"src/ui/tsconfig.json",
63+
"tsconfig.test.json",
64+
"tsconfig.cypress.json"
65+
]
66+
}
67+
}
68+
}
69+
}

.github/workflows/development.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Development
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, synchronize, reopened]
66

77
jobs:
@@ -31,11 +31,9 @@ jobs:
3131

3232
- name: Install dependencies
3333
run: npm ci
34-
working-directory: src/ui
3534

3635
- name: Run quality and typing checks
3736
run: npm run lint
38-
working-directory: src/ui
3937

4038
type-checks:
4139
runs-on: ubuntu-latest
@@ -63,11 +61,9 @@ jobs:
6361

6462
- name: Install dependencies
6563
run: npm ci
66-
working-directory: src/ui
6764

6865
- name: Run quality and typing checks
6966
run: npm run type-check
70-
working-directory: src/ui
7167

7268
precommit-checks:
7369
runs-on: ubuntu-latest
@@ -83,7 +79,7 @@ jobs:
8379
- name: Install dependencies
8480
run: pip install pre-commit
8581
- name: Run pre-commit checks
86-
run: pre-commit run --all-files
82+
run: SKIP=ruff-format pre-commit run --all-files
8783

8884
ui-precommit-check:
8985
permissions:
@@ -94,12 +90,10 @@ jobs:
9490
uses: actions/checkout@v3
9591

9692
- name: Install dependencies
97-
working-directory: src/ui
9893
run: npm ci
9994

10095
- name: Run pre-commit checks
10196
run: npx husky run pre-commit
102-
working-directory: src/ui
10397

10498
unit-tests:
10599
runs-on: ubuntu-latest
@@ -117,6 +111,20 @@ jobs:
117111
- name: Run unit tests
118112
run: tox -e test-unit -- -m "smoke or sanity"
119113

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+
120128
integration-tests:
121129
runs-on: ubuntu-latest
122130
strategy:
@@ -133,6 +141,20 @@ jobs:
133141
- name: Run integration tests
134142
run: tox -e test-integration -- -m smoke
135143

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+
136158
build:
137159
runs-on: ubuntu-latest
138160
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,14 @@ yarn-error.log*
217217
src/ui/.vercel
218218

219219
# typescript
220-
src/ui/*.tsbuildinfo
220+
*.tsbuildinfo
221221
src/ui/next-env.d.ts
222222

223223
# Root-level UI config files that should be tracked
224224
!package.json
225225
!package-lock.json
226226
!.eslintrc.json
227227
!tsconfig.json
228+
!tsconfig.*.json
229+
!src/ui/lib
230+
!src/ui/public/manifest.json

.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+
!/.eslintrc.json
16+
!/tsconfig*.json
17+
!/*.config.{js,ts}
18+
!/jest.setup.ts
File renamed without changes.

DEVELOPING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,68 @@ 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+
To start the local development server:
189+
190+
```bash
191+
npm run dev
192+
```
193+
194+
Then open [http://localhost:3000](http://localhost:3000) in your browser.
195+
196+
### Building for Production
197+
198+
To build the app for production (output in the `out` directory):
199+
200+
```bash
201+
npm run build
202+
```
203+
204+
### Running UI Tests
205+
206+
- **Unit tests**:
207+
208+
```bash
209+
npm run test:unit
210+
```
211+
212+
- **Integration tests**:
213+
214+
```bash
215+
npm run test:integration
216+
```
217+
218+
- **End-to-end tests** (using Cypress, ensure live dev server):
219+
220+
```bash
221+
npm run test:e2e
222+
```
223+
224+
### Code Quality and Styling
225+
226+
- **Fix styling issues**:
227+
228+
```bash
229+
npm run format
230+
```
231+
232+
- **Run ESLint checks**:
233+
234+
```bash
235+
npm run lint
236+
```
237+
238+
- **Run TS type checks**:
239+
240+
```bash
241+
npm run type-checks
242+
```
243+
182244
## Additional Resources
183245

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

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+
});

deploy/Containerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
ARG PYTHON=3.13
2+
3+
# Use a multi-stage build to create a lightweight production image
4+
FROM docker.io/python:${PYTHON}-slim as builder
5+
6+
# Copy repository files
7+
COPY / /src
8+
9+
# Create a venv and install guidellm
10+
RUN python3 -m venv /opt/guidellm \
11+
&& /opt/guidellm/bin/pip install --no-cache-dir /src
12+
13+
# Copy entrypoint script into the venv bin directory
14+
RUN install -m0755 /src/deploy/entrypoint.sh /opt/guidellm/bin/entrypoint.sh
15+
16+
# Prod image
17+
FROM docker.io/python:${PYTHON}-slim
18+
19+
# Copy the virtual environment from the builder stage
20+
COPY --from=builder /opt/guidellm /opt/guidellm
21+
22+
# Add guidellm bin to PATH
23+
ENV PATH="/opt/guidellm/bin:$PATH"
24+
25+
# Create a non-root user
26+
RUN useradd -md /results guidellm
27+
28+
# Switch to non-root user
29+
USER guidellm
30+
31+
# Set working directory
32+
WORKDIR /results
33+
34+
# Metadata
35+
LABEL org.opencontainers.image.source="https://github.com/neuralmagic/guidellm" \
36+
org.opencontainers.image.description="GuideLLM Performance Benchmarking Container"
37+
38+
# Set the environment variable for the benchmark script
39+
# TODO: Replace with scenario environment variables
40+
ENV GUIDELLM_TARGET="http://localhost:8000" \
41+
GUIDELLM_MODEL="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16" \
42+
GUIDELLM_RATE_TYPE="sweep" \
43+
GUIDELLM_DATA="prompt_tokens=256,output_tokens=128" \
44+
GUIDELLM_MAX_REQUESTS="100" \
45+
GUIDELLM_MAX_SECONDS="" \
46+
GUIDELLM_OUTPUT_PATH="/results/results.json"
47+
48+
ENTRYPOINT [ "/opt/guidellm/bin/entrypoint.sh" ]

0 commit comments

Comments
 (0)