Skip to content

Commit fe2d185

Browse files
authored
Merge pull request #96 from perftool-incubator/repo-updates
feat: update docs and merge CI workflows
2 parents 0841890 + 81a122f commit fe2d185

7 files changed

Lines changed: 159 additions & 72 deletions

File tree

.github/rulesets/branches/default-branch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"parameters": {
2626
"required_approving_review_count": 1,
2727
"dismiss_stale_reviews_on_push": true,
28+
"required_reviewers": [],
2829
"require_code_owner_review": false,
2930
"require_last_push_approval": false,
3031
"required_review_thread_resolution": true,
31-
"automatic_copilot_code_review_enabled": false,
3232
"allowed_merge_methods": [
3333
"merge"
3434
]
@@ -41,7 +41,8 @@
4141
"do_not_enforce_on_create": false,
4242
"required_status_checks": [
4343
{
44-
"context": "call-core-crucible-ci / core-crucible-ci-complete"
44+
"context": "crucible-ci-complete",
45+
"integration_id": 15368
4546
}
4647
]
4748
}

.github/workflows/crucible-ci.yaml

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,58 @@ name: crucible-ci
33
on:
44
pull_request:
55
branches: [ master ]
6-
paths-ignore:
7-
- LICENSE
8-
- '**.md'
9-
- '.github/rulesets/**'
10-
- .github/workflows/run-crucible-tracking.yaml
11-
- .github/workflows/faux-crucible-ci.yaml
12-
- .github/workflows/faux-unittest.yaml
13-
- 'docs/**'
146
workflow_dispatch:
157

8+
concurrency:
9+
group: ${{ github.ref }}/crucible-ci
10+
cancel-in-progress: true
11+
1612
jobs:
17-
call-core-crucible-ci:
13+
changes:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
only-docs: ${{ steps.filter.outputs.only_changed }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- id: filter
20+
uses: tj-actions/changed-files@v47
21+
with:
22+
files: |
23+
LICENSE
24+
*.md
25+
**/*.md
26+
.github/rulesets/**
27+
.github/workflows/run-crucible-tracking.yaml
28+
.github/workflows/crucible-ci.yaml
29+
.github/workflows/unittest.yaml
30+
docs/**
31+
32+
call-real-core-crucible-ci:
33+
needs: changes
34+
if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.only-docs != 'true' }}
1835
uses: perftool-incubator/crucible-ci/.github/workflows/core-crucible-ci.yaml@main
1936
with:
2037
ci_target: "multiplex"
2138
ci_target_branch: "${{ github.ref }}"
2239
github_workspace: "$GITHUB_WORKSPACE"
2340
userenv_filter: "minimal"
2441
secrets:
25-
registry_auth: ${{ secrets.CRUCIBLE_CI_ENGINES_REGISTRY_AUTH }}
42+
ci_registry_auth: ${{ secrets.CRUCIBLE_CI_ENGINES_REGISTRY_AUTH }}
43+
quay_oauth_token: ${{ secrets.CRUCIBLE_QUAYIO_OAUTH_TOKEN }}
44+
45+
call-faux-core-crucible-ci:
46+
needs: changes
47+
if: ${{ github.event_name != 'workflow_dispatch' && needs.changes.outputs.only-docs == 'true' }}
48+
uses: perftool-incubator/crucible-ci/.github/workflows/faux-core-crucible-ci.yaml@main
49+
50+
crucible-ci-complete:
51+
needs: [ call-real-core-crucible-ci, call-faux-core-crucible-ci ]
52+
if: always()
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Check Results
56+
if: >-
57+
contains(needs.*.result, 'failure') ||
58+
contains(needs.*.result, 'cancelled')
59+
run: exit 1
60+
- run: echo "crucible-ci complete"

.github/workflows/faux-crucible-ci.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/faux-unittest.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/unittest.yaml

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
1-
# Basic ci workflow using github actions
21
name: unittest
32

4-
concurrency:
5-
group: ${{ github.ref }}/unittest
6-
cancel-in-progress: true
7-
8-
# Controls when the action will run.
93
on:
10-
# Triggers the workflow on push or pull request events but only for the master branch
114
pull_request:
125
branches: [ master ]
13-
paths-ignore:
14-
- LICENSE
15-
- '**.md'
16-
- '.github/rulesets/**'
17-
- .github/workflows/run-crucible-tracking.yaml
18-
- .github/workflows/faux-crucible-ci.yaml
19-
- .github/workflows/faux-unittest.yaml
20-
- 'docs/**'
21-
22-
# Allows you to run this workflow manually from the Actions tab
236
workflow_dispatch:
247

25-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
8+
concurrency:
9+
group: ${{ github.ref }}/unittest
10+
cancel-in-progress: true
11+
2612
jobs:
27-
# Jobs to test schema, input json file, and requirements
28-
multiplex-unittests:
29-
# Job will run on github-hosted runner
13+
changes:
3014
runs-on: ubuntu-latest
15+
outputs:
16+
only-docs: ${{ steps.filter.outputs.only_changed }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- id: filter
20+
uses: tj-actions/changed-files@v47
21+
with:
22+
files: |
23+
LICENSE
24+
*.md
25+
**/*.md
26+
.github/rulesets/**
27+
.github/workflows/run-crucible-tracking.yaml
28+
.github/workflows/crucible-ci.yaml
29+
.github/workflows/unittest.yaml
30+
docs/**
3131
32-
# Steps represent a sequence of tasks that will be executed as part of the job
32+
multiplex-unittests:
33+
runs-on: ubuntu-latest
34+
needs: changes
35+
if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.only-docs != 'true' }}
3336
steps:
34-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3537
- uses: actions/checkout@v4
3638

3739
- name: Install dependencies
@@ -50,3 +52,22 @@ jobs:
5052
with:
5153
name: report
5254
path: report.html
55+
56+
faux-unittest:
57+
runs-on: ubuntu-latest
58+
needs: changes
59+
if: ${{ github.event_name != 'workflow_dispatch' && needs.changes.outputs.only-docs == 'true' }}
60+
steps:
61+
- run: echo "faux-unittest-complete"
62+
63+
unittest-complete:
64+
runs-on: ubuntu-latest
65+
needs: [ multiplex-unittests, faux-unittest ]
66+
if: always()
67+
steps:
68+
- name: Check Results
69+
if: >-
70+
contains(needs.*.result, 'failure') ||
71+
contains(needs.*.result, 'cancelled')
72+
run: exit 1
73+
- run: echo "unittest-complete"

CLAUDE.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Multiplex - Parameter Expansion Engine
2+
3+
## Purpose
4+
Multiplex translates multi-value benchmark parameters into single-value test matrices. Given a set of parameters with multiple possible values, it produces all valid combinations (the Cartesian product), respecting parameter roles and constraints. Output feeds into rickshaw-run as `bench-params.json`.
5+
6+
## Language
7+
Python 3 — single main file `multiplex.py` (~510 lines), no dependencies beyond `jsonschema`.
8+
9+
## Key Files
10+
| File | Purpose |
11+
|------|---------|
12+
| `multiplex.py` | Core parameter expansion logic and CLI entry point |
13+
| `params` | Default CLI arguments file (read by argparse `fromfile_prefix_chars`) |
14+
| `JSON/schema.json` | JSON schema for multi-value input validation |
15+
| `JSON/req-schema.json` | JSON schema for requirements file validation |
16+
17+
## Key Functions
18+
| Function | Purpose |
19+
|----------|---------|
20+
| `multiplex_sets()` | Main driver: expands all parameter sets |
21+
| `multiplex_set()` | Expands one multi-value set into multiple single-value sets (Cartesian product via `itertools.product`) |
22+
| `load_param_sets()` | Resolves `include` references from global-options into sets |
23+
| `override_presets()` | Applies defaults, essentials, and named presets from requirements |
24+
| `transform_param_val()` | Applies validation regex, unit conversion, and regex transformation |
25+
| `validate_schema()` | Validates input JSON against schema |
26+
27+
## Exit Codes
28+
| Code | Constant | Meaning |
29+
|------|----------|---------|
30+
| 0 | `EC_SUCCESS` | Success |
31+
| 1 | `EC_SCHEMA_FAIL` | Input JSON schema validation failed |
32+
| 2 | `EC_JSON_FAIL` | JSON file loading failed |
33+
| 3 | `EC_REQUIREMENTS_FAIL` | Requirements file loading failed |
34+
| 4 | `EC_VALIDATIONS_FAIL` | Parameter validation failed |
35+
| 5 | `EC_REQ_SCHEMA_FAIL` | Requirements JSON schema validation failed |
36+
| 6 | `EC_EMPTY_SET_FAIL` | Empty param set after preset override |
37+
38+
## Input/Output
39+
- **Input**: JSON with `global-options` and `sets` arrays; params use `arg` and `vals` (multi-value list) keys, optional `role` (client/server/all), `id`, `enabled`
40+
- **Output**: JSON array of arrays; each inner array is one test iteration with single-value params using `arg`, `val`, and `role` keys
41+
- **Requirements** (optional): Defines `presets` (defaults, essentials, named), `validations` (regex), and `units` (conversion factors)
42+
43+
## Tests
44+
Run with `cd` to project root, then `pytest tests/`:
45+
- `tests/test-json.py` — Parameter loading, multiplexing, Cartesian expansion, value conversion
46+
- `tests/test-requirements.py` — Validation regex, presets, unit conversion, preset precedence
47+
- `tests/test-schema.py` — Schema validation for valid and invalid inputs
48+
- 60+ JSON fixtures in `tests/JSON/`
49+
50+
## Conventions
51+
- 4-space indentation, PEP 8 naming
52+
- Module-level dicts for state: `validation_dict`, `convert_dict`, `transform_dict`, `presets_dict`
53+
- Uses Python `logging` module for debug/info/warning/error output

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ When running a benchmark, it is often desirable to run it multiple ways, changin
88

99
## Usage
1010
```
11-
./multiplex.py [--requirements JSON/requirements.json] --input JSON/mv-params-input.json [--output /path/to/bench-params.json]
11+
./multiplex.py [--requirements JSON/requirements.json] --input JSON/mv-params-input.json [--output /path/to/bench-params.json] [--debug]
1212
```
1313

14+
Default CLI arguments can be placed in a `params` file in the same directory, one argument per line (read via argparse `fromfile_prefix_chars`).
15+
1416
## Input multi-value JSON
1517
Multiplex requires a JSON file with the following format:
1618
```
@@ -274,3 +276,14 @@ parameters to STDOUT. A sample is available in `JSON/bench-params-output.json`:
274276
This JSON can then optionally be modified by the user, and then provided
275277
(typically as "bench-params.json") to a benchmark orchestrator like
276278
rickshaw-run.
279+
280+
## Exit codes
281+
| Code | Meaning |
282+
|------|---------|
283+
| 0 | Success |
284+
| 1 | Input JSON schema validation failed |
285+
| 2 | JSON file loading failed |
286+
| 3 | Requirements file loading failed |
287+
| 4 | Parameter validation failed |
288+
| 5 | Requirements JSON schema validation failed |
289+
| 6 | Empty param set after preset override (missing essentials/defaults) |

0 commit comments

Comments
 (0)