Skip to content

Commit b503ae5

Browse files
committed
Match the app's log redaction rules / 与 app 的日志清理规则保持一致
Port every rule of InferenceX-app's log-redaction.ts (#1760) to infx.results.redact with the standard library only, so the bare result-tooling interpreter keeps working. Variable-length lookbehinds become fixed-width alternations or bounded checks, classes match what JavaScript's u and iu flags match, and the bounded repeats and line window mirror the app's. Copy log-redaction.vectors.json byte for byte. Files are redacted in blocks of lines with the same result as the whole text, including a JSON key on an earlier line and the app's email hint. Redact profile traces before they are uploaded or pushed, and redact CollectiveX and OperatorX shard output before upload. 将 InferenceX-app 的 log-redaction.ts(#1760)中的全部规则移植到 infx.results.redact,只使用标准库, 使无依赖的结果处理解释器继续可用。变长后行断言改写为定宽分支或有界检查,字符类与 JavaScript 的 u、iu 标志一致, 有界重复与行窗口也与 app 相同。逐字节复制 log-redaction.vectors.json。文件按行块清理,结果与整段文本相同, 包括上一行的 JSON 键和 app 的邮箱提示。profile trace 在上传和推送前清理,CollectiveX 与 OperatorX 的分片输出在上传前清理。
1 parent 29b5944 commit b503ae5

7 files changed

Lines changed: 906 additions & 136 deletions

File tree

‎.github/workflows/README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,12 @@ the Merge Ingest run fails and nothing is benchmarked or ingested.
376376

377377
## Stored Artifact Sanitization
378378

379-
Benchmark, multi-node, SpeedBench AL, and profile jobs run `Redact stored artifacts`
380-
(`python -m infx.results.redact`) on the files they upload, right before the first upload.
379+
Benchmark, multi-node, SpeedBench AL, profile, CollectiveX and OperatorX jobs run
380+
`Redact stored artifacts` (`python -m infx.results.redact`) on the files they upload, right
381+
before the first upload. Profile traces are redacted before they are uploaded or pushed to the
382+
trace storage repository. The rules are the app's `log-redaction.ts`, and both repositories test
383+
them against the same vectors. The `h3-results` video bundle is not redacted, because its
384+
`SHA256SUMS` and evidence digests seal every file.
381385

382386
## Repository Scope
383387

‎.github/workflows/collectivex-sweep.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ jobs:
147147
[ -z "$CX_MODES" ] || args+=(--modes "$CX_MODES")
148148
[ -z "$CX_PRECISIONS" ] || args+=(--precisions "$CX_PRECISIONS")
149149
collectivex/run.sh "$CX_SHARD_SKU" --shard "$CX_SHARD" "${args[@]}"
150+
- name: Redact stored artifacts
151+
if: always()
152+
env:
153+
PYTHONPATH: inferencex-e2e
154+
run: python3 -m infx.results.redact "collectivex/results/$CX_SHARD_SKU"
150155
- name: Upload results
151156
if: always()
152157
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎.github/workflows/operatorx-sweep.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ jobs:
226226
timeout 15 sinfo --Node --noheader --format='%N|%P|%t' \
227227
> "$OPERATORX_OUTPUT/slurm-nodes.log" 2>&1 || true
228228
fi
229+
- name: Redact stored artifacts
230+
if: always()
231+
run: python3 -m infx.results.redact "$OPERATORX_OUTPUT"
229232
- name: Upload results and diagnostics
230233
if: always()
231234
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎.github/workflows/profile.yml‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,22 @@ jobs:
377377
check_env_vars INFERENCEX_RESULTS_PYTHON
378378
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.fixed_sequence
379379
380+
- name: Redact stored artifacts
381+
if: ${{ always() && env.INFERENCEX_RESULTS_PYTHON != '' }}
382+
env:
383+
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
384+
TRACE: ${{ steps.run.outputs.trace }}
385+
TP0_DECODE: ${{ steps.run.outputs.tp0_decode }}
386+
TP0_EXTEND: ${{ steps.run.outputs.tp0_extend }}
387+
run: |
388+
source "$PYTHONPATH/benchmarks/check_env.sh"
389+
check_env_vars INFERENCEX_RESULTS_PYTHON INFERENCEX_E2E_ROOT
390+
paths=("$INFERENCEX_E2E_ROOT/moe_debug.tp0.log")
391+
for trace in "$TRACE" "$TP0_DECODE" "$TP0_EXTEND"; do
392+
if [[ -n "$trace" ]]; then paths+=("$trace"); fi
393+
done
394+
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.redact "${paths[@]}"
395+
380396
- name: Upload profile as artifact
381397
if: ${{ steps.run.outputs.trace != '' }}
382398
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -401,15 +417,6 @@ jobs:
401417
path: ${{ steps.run.outputs.tp0_extend }}
402418
if-no-files-found: ignore
403419

404-
- name: Redact stored artifacts
405-
if: ${{ always() && env.MOE_DEBUG == '1' }}
406-
env:
407-
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
408-
run: |
409-
source "$PYTHONPATH/benchmarks/check_env.sh"
410-
check_env_vars INFERENCEX_RESULTS_PYTHON INFERENCEX_E2E_ROOT
411-
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.redact "$INFERENCEX_E2E_ROOT/moe_debug.tp0.log"
412-
413420
- name: Upload MoE debug log as artifact
414421
if: ${{ env.MOE_DEBUG == '1' }}
415422
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

0 commit comments

Comments
 (0)