一键导入
build-test-dash-ha
Copy dash-ha repo into build container and run compilation checks and unit tests. Use when: compile and test in sonic-dash-ha repo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Copy dash-ha repo into build container and run compilation checks and unit tests. Use when: compile and test in sonic-dash-ha repo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build dash-ha debian packages and deploy to SONiC switches. Use when: building deb, deploying to switches, installing dash-ha, config reload, dpkg-buildpackage, deploy dash-hadpu containers.
Create the sonic-dash-ha Docker build container from scratch and verify the repo compiles. Use when: setting up a new build container, bootstrapping the dash-ha dev environment, "create the build container", "set up sonic-dash-ha container", installing build dependencies, building libswsscommon.
Run sonic-mgmt-int pytest tests on physical SmartSwitch testbeds and debug failures. Use when: running HA tests, planned shutdown tests, running sonic-mgmt-int tests, checking test logs, debugging test failures on physical switches, analyzing syslog on DUT, run_tests.sh.
| name | build-test-dash-ha |
| description | Copy dash-ha repo into build container and run compilation checks and unit tests. Use when: compile and test in sonic-dash-ha repo. |
| argument-hint | Optional: specific make targets (e.g. ci-build, ci-test, ci-lint) or crate names to test |
sonic-dash-ha Docker build container must be running locally (check with docker ps)| Parameter | Default Value |
|---|---|
| Build container | sonic-dash-ha |
| Host repo path | <path-to-sonic-dash-ha> |
| Container repo path | /sonic-dash-ha |
The host repo path is a placeholder — substitute the actual path to the user's local sonic-dash-ha checkout.
docker ps --filter name=sonic-dash-ha --format '{{.Names}}'
If the container is not running, stop and tell the user. Do not attempt to start it.
FIRST, check whether the repo is bind-mounted into the container. Some setups
bind-mount the host repo at /sonic-dash-ha instead of using docker cp. Running
rm -rf /sonic-dash-ha inside the container against a bind mount will delete the
host repo and its .git. Always check before deleting:
docker inspect sonic-dash-ha \
--format '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{"\n"}}{{end}}'
If the host repo path maps to /sonic-dash-ha (bind mount): do NOT run
rm -rf and do NOT docker cp. The container already sees the current source.
Skip directly to Step 3.
If /sonic-dash-ha is NOT a bind mount: refresh the copy. This removes the old
source tree and copies a fresh one; the cargo build cache under target/ is
preserved for incremental builds:
docker exec sonic-dash-ha bash -c "rm -rf /sonic-dash-ha" && \
docker cp <path-to-sonic-dash-ha> sonic-dash-ha:/sonic-dash-ha
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && cargo build --workspace --all-features 2>&1"
If the user asks for a CI-grade build (strict, deny warnings), use:
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && RUSTFLAGS='--deny warnings' cargo build --workspace --all-features 2>&1"
Check the output for errors. If compilation fails, show the errors and stop — do not proceed to tests.
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && cargo test --workspace --all-features 2>&1"
To test a specific crate:
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && cargo test -p <crate-name> 2>&1"
Report the test summary (number of passed/failed tests). If any tests fail, show the failure output.
These are only run when the user explicitly asks, or asks for "full CI" / "ci-all":
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && cargo fmt --check --all 2>&1"
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && cargo clippy --workspace --all-features --no-deps -- --deny 'clippy::all' 2>&1"
Runs all CI targets sequentially (format, build, doc, lint, test — both debug and release):
docker exec sonic-dash-ha bash -c "cd /sonic-dash-ha && make ci-all 2>&1"
Warning: This is slow as it builds and tests in both debug and release modes with cargo clean between each stage.
rm -rf and re-copying ensures clean source. The target/ directory inside the container is not preserved across rm -rf + docker cp since it lives under /sonic-dash-ha/target/. For faster incremental builds, consider syncing only changed files instead.| tail -n 50 if you only need to see the summary, but show full output on failure.ci-all can take much longer.--release to build and test commands.