Skip to content

Commit f49d58e

Browse files
authored
Sanitize stored CI output / 清理存储的 CI 输出 (#5013)
* feat: redact IPs and credentials from stored CI artifacts Run infx.results.redact on every file benchmark, multi-node, SpeedBench AL and profile jobs upload, right before the first upload. IP addresses become per-job HMAC tags that keep ports and distinct hosts, Oracle VCN domains keep only the host label, and credentials become ***REDACTED***. Files whose sha256 a power manifest records are left unchanged. Also require the STAGING_APP_URL repository variable instead of hardcoding the staging site as a fallback. * chore: tidy artifact sanitization docs and fixtures * refactor: simplify artifact sanitization * fix: harden artifact sanitization * 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 d2e96d8 commit f49d58e

13 files changed

Lines changed: 1487 additions & 21 deletions

‎.github/workflows/README.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,15 @@ Reuse fails closed when authorized but ineligible or invalid. Pushes to `main`
374374
never run a sweep: `run-sweep.yml` is PR-only, and without reuse authorization
375375
the Merge Ingest run fails and nothing is benchmarked or ingested.
376376

377+
## Stored Artifact Sanitization
378+
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.
385+
377386
## Repository Scope
378387

379388
Scheduled and run-completion jobs (Klaud, the runner offline digest,
@@ -386,7 +395,7 @@ configured by these repository variables:
386395
| Variable | Default | Effect |
387396
| ----------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
388397
| `APP_REPO` | `SemiAnalysisAI/InferenceX-app` | App repository that `merge-ingest`, `recover-reused-ingest`, `operatorx-sweep`, and `stage-results` dispatch ingest, video, and staging events to, and the only source the ingest and staging callbacks accept. `FRONTEND_PAT` must be able to dispatch to it. |
389-
| `STAGING_APP_URL` | `https://inferencemax-app-git-staging-semianalysisai.vercel.app` | Origin of that app's staging site, without a trailing slash. Staged-run comments link to it, and the staging callback accepts chart links only on it. Set it to the app repository's own `STAGING_APP_URL`. |
398+
| `STAGING_APP_URL` | Required, no default | Origin of that app's staging site, without a trailing slash. Staged-run comments link to it, and the staging callback accepts chart links only on it. Set it to the app repository's own `STAGING_APP_URL`; the callback fails while it is unset. |
390399

391400
## Validation Architecture
392401

‎.github/workflows/benchmark-multinode-tmpl.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,42 @@ jobs:
370370
fi
371371
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.fixed_sequence --all
372372
373+
- name: Redact stored artifacts
374+
if: ${{ always() && env.INFERENCEX_RESULTS_PYTHON != '' }}
375+
env:
376+
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
377+
run: |
378+
source "$PYTHONPATH/benchmarks/check_env.sh"
379+
check_env_vars INFERENCEX_RESULTS_PYTHON INFERENCEX_E2E_ROOT RESULT_FILENAME SCENARIO_TYPE EVAL_ONLY RUN_EVAL
380+
cd "$INFERENCEX_E2E_ROOT"
381+
shopt -s nullglob globstar
382+
paths=(multinode_server_logs.tar.gz srt-setup.log srt-bind.log job_event.json)
383+
if [[ "$EVAL_ONLY" != true ]]; then
384+
paths+=(
385+
"$RESULT_FILENAME"_*.json "agg_$RESULT_FILENAME"_*.json
386+
"power_validation_$RESULT_FILENAME"_*.json LOGS/power
387+
"result_processing_$RESULT_FILENAME.json" LOGS/*/results_*.json
388+
LOGS/agentic/**/agentic_power_concurrency_*.json
389+
LOGS/agentic/**/agentic_power_timezone_offset.txt
390+
LOGS/agentic/**/power_validation.json
391+
)
392+
fi
393+
if [[ "$SCENARIO_TYPE" == agentic-coding ]]; then
394+
for path in LOGS/agentic/**; do
395+
case "$path" in
396+
*/aiperf_artifacts/inputs.json | */aiperf_artifacts/profile_export_raw.jsonl) ;;
397+
*) if [[ -f "$path" ]]; then paths+=("$path"); fi ;;
398+
esac
399+
done
400+
fi
401+
if [[ "$RUN_EVAL" == true || "$EVAL_ONLY" == true ]]; then
402+
paths+=(
403+
meta_env.json results*.json al_gate_*.json ./*_report.json ./*_results.jsonl
404+
sample*.jsonl ./*_artifacts.tar.gz
405+
)
406+
fi
407+
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.redact "${paths[@]}"
408+
373409
- name: Upload result
374410
if: ${{ success() && env.RESULT_FILENAME != '' && !inputs.eval-only && inputs.scenario-type != 'agentic-coding' }}
375411
uses: $/.github/actions/upload-artifact-retry

‎.github/workflows/benchmark-tmpl.yml‎

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,6 @@ jobs:
333333
results/aiperf_artifacts \
334334
--failed-request-threshold "$AIPERF_FAILED_REQUEST_THRESHOLD"
335335
336-
- name: Upload video results
337-
if: ${{ always() && inputs.scenario-type == 'video-generation' && env.RESULT_FILENAME != '' }}
338-
uses: $/.github/actions/upload-artifact-retry
339-
with:
340-
name: ${{ env.VIDEO_ARTIFACT_NAME }}
341-
path: ${{ env.INFERENCEX_E2E_ROOT }}/h3-results
342-
if-no-files-found: error
343-
344336
- name: Process result
345337
if: ${{ always() && env.RESULT_FILENAME != '' && !inputs.eval-only && inputs.scenario-type != 'agentic-coding' && inputs.scenario-type != 'video-generation' }}
346338
env:
@@ -359,6 +351,60 @@ jobs:
359351
fi
360352
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.fixed_sequence
361353
354+
- name: Redact stored artifacts
355+
if: ${{ always() && env.INFERENCEX_RESULTS_PYTHON != '' }}
356+
env:
357+
RUNNER_LABEL: ${{ inputs.runner }}
358+
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
359+
run: |
360+
if [[ "$RUNNER_LABEL" == cluster:mi355x-amds ]]; then
361+
sudo chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE"
362+
fi
363+
source "$PYTHONPATH/benchmarks/check_env.sh"
364+
check_env_vars INFERENCEX_RESULTS_PYTHON INFERENCEX_E2E_ROOT RESULT_FILENAME SCENARIO_TYPE EVAL_ONLY RUN_EVAL
365+
cd "$INFERENCEX_E2E_ROOT"
366+
shopt -s nullglob globstar
367+
paths=(
368+
server.log results/*.log results/*_config.json
369+
srt-single-node-logs.tar.gz srt-video-logs.tar.gz srt-single-node-submission.json
370+
srt-slurm-sha.txt srt-setup.log srt-bind.log job_event.json
371+
)
372+
if [[ "$EVAL_ONLY" != true ]]; then
373+
paths+=(
374+
"$RESULT_FILENAME.json" "agg_$RESULT_FILENAME.json"
375+
"power_validation_$RESULT_FILENAME.json" "$RESULT_FILENAME"_conc*.json
376+
"power_validation_$RESULT_FILENAME"_conc*.json
377+
results/agentic_power_timezone_offset.txt LOGS/power
378+
LOGS/agentic/**/agentic_power_concurrency_*.json
379+
LOGS/video/**/benchmark_concurrency_*.json LOGS/video/server/*.json
380+
"LOGS/$RESULT_FILENAME.json" power-producer-sha.txt exporter-image.sha256
381+
)
382+
fi
383+
if [[ "$SCENARIO_TYPE" == agentic-coding ]]; then
384+
paths+=("$RESULT_FILENAME.json")
385+
for path in results/**; do
386+
case "$path" in
387+
results/aiperf_artifacts/inputs.json | results/aiperf_artifacts/profile_export_raw.jsonl) ;;
388+
*) if [[ -f "$path" ]]; then paths+=("$path"); fi ;;
389+
esac
390+
done
391+
fi
392+
if [[ "$RUN_EVAL" == true || "$EVAL_ONLY" == true ]]; then
393+
paths+=(
394+
meta_env.json results*.json al_gate_*.json ./*_report.json ./*_results.jsonl
395+
./*_artifacts.tar.gz sample*.jsonl
396+
)
397+
fi
398+
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.redact "${paths[@]}"
399+
400+
- name: Upload video results
401+
if: ${{ always() && inputs.scenario-type == 'video-generation' && env.RESULT_FILENAME != '' }}
402+
uses: $/.github/actions/upload-artifact-retry
403+
with:
404+
name: ${{ env.VIDEO_ARTIFACT_NAME }}
405+
path: ${{ env.INFERENCEX_E2E_ROOT }}/h3-results
406+
if-no-files-found: error
407+
362408
- name: Upload result
363409
if: ${{ success() && env.RESULT_FILENAME != '' && !inputs.eval-only && inputs.scenario-type != 'agentic-coding' && inputs.scenario-type != 'video-generation' }}
364410
uses: $/.github/actions/upload-artifact-retry

‎.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 & 0 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

‎.github/workflows/speedbench-al.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,20 @@ jobs:
354354
--base main \
355355
--head "$BRANCH"
356356
357+
- name: Redact stored artifacts
358+
if: ${{ always() && env.INFERENCEX_LAUNCH_PYTHON != '' }}
359+
env:
360+
PYTHONPATH: ${{ github.workspace }}/.launch-tooling/inferencex-e2e
361+
run: |
362+
source "$PYTHONPATH/benchmarks/check_env.sh"
363+
check_env_vars INFERENCEX_LAUNCH_PYTHON INFERENCEX_E2E_ROOT
364+
cd "$INFERENCEX_E2E_ROOT"
365+
shopt -s nullglob
366+
paths=(speedbench_results/server_*.log speedbench_results/speedbench_*)
367+
if (( ${#paths[@]} )); then
368+
"$INFERENCEX_LAUNCH_PYTHON" -P -m infx.results.redact "${paths[@]}"
369+
fi
370+
357371
- name: Upload server logs
358372
if: always()
359373
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎.github/workflows/stage-results-callback.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
env:
3131
GH_TOKEN: ${{ github.token }}
3232
APP_REPO: ${{ vars.APP_REPO || 'SemiAnalysisAI/InferenceX-app' }}
33-
STAGING_APP_URL: ${{ vars.STAGING_APP_URL || 'https://inferencemax-app-git-staging-semianalysisai.vercel.app' }}
33+
STAGING_APP_URL: ${{ vars.STAGING_APP_URL }}
3434
run: python3 -m infx.workflows.stage_results_callback

0 commit comments

Comments
 (0)