vss-setup-video-analytics-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePurpose
用途
Deploy the video-analytics-api REST service standalone with the user's chosen config, data-log bind, and Elasticsearch / Kafka connectivity.
独立部署video-analytics-api REST服务,支持用户自定义配置、数据日志绑定,以及Elasticsearch/Kafka连接。
Instructions
操作说明
Follow the routing tables and step-by-step workflows below. Each section that ends in workflow, quick start, or flow is intended to be executed top-to-bottom. Detailed reference material lives in and helper scripts live in — call them via when the skill points to a script by name.
references/scripts/run_script遵循下方的路由表和分步工作流程。所有以workflow、quick start或flow结尾的章节都需要从上到下依次执行。详细参考资料位于目录,辅助脚本位于目录——当技能指向某个脚本时,通过调用它们。
references/scripts/run_scriptExamples
示例
Worked end-to-end examples are kept under (each manifest
contains a runnable scenario). Run a Tier-3 evaluation to replay them:
evals/*.jsonbash
nv-base validate skills/vss-setup-video-analytics-api --agent-evalA minimal standalone bring-up looks like:
bash
cd $REPO/deploy/docker
export VSS_APPS_DIR=$(pwd)
export VSS_DATA_DIR=${VSS_DATA_DIR:-/tmp/vss-data}
mkdir -p "$VSS_DATA_DIR/data_log/vss_video_analytics_api"
docker compose -f services/analytics/video-analytics-api/compose.yml up -d vss-video-analytics-api
curl -sf http://localhost:8081/livezFollow for the full
workflow (config source, data-log bind, infrastructure dependencies, REST endpoints).
references/deploy-video-analytics-api-service.md完整的端到端示例保存在目录下(每个清单包含一个可运行的场景)。运行Tier-3评估来复现这些示例:
evals/*.jsonbash
nv-base validate skills/vss-setup-video-analytics-api --agent-eval最小化独立启动步骤如下:
bash
cd $REPO/deploy/docker
export VSS_APPS_DIR=$(pwd)
export VSS_DATA_DIR=${VSS_DATA_DIR:-/tmp/vss-data}
mkdir -p "$VSS_DATA_DIR/data_log/vss_video_analytics_api"
docker compose -f services/analytics/video-analytics-api/compose.yml up -d vss-video-analytics-api
curl -sf http://localhost:8081/livez完整工作流程(配置源、数据日志绑定、基础设施依赖、REST端点)请参考。
references/deploy-video-analytics-api-service.mdLimitations
限制条件
- Requires the matching VSS profile / microservice to be deployed and reachable from the caller.
- NGC-hosted models and NIMs may be subject to rate-limits, GPU memory requirements, and license restrictions.
- Concurrency, GPU memory, and storage limits depend on the host hardware and the profile's compose file.
- 需要匹配的VSS配置文件/微服务已部署,且调用方可以访问。
- NGC托管的模型和NIM可能受速率限制、GPU内存要求和许可证限制。
- 并发能力、GPU内存和存储限制取决于主机硬件和配置文件的compose文件。
Troubleshooting
故障排除
- Error: REST call returns connection refused. Cause: target microservice not running. Solution: probe or
/docs; redeploy via/healthor the matchingvss-deploy-profileskill.vss-deploy-* - Error: HTTP 401/403 from NGC pulls. Cause: missing/expired . Solution:
NGC_CLI_API_KEYand re-export the key before retrying.docker login nvcr.io - Error: container OOM or model fails to load. Cause: insufficient GPU memory for the selected profile. Solution: switch to a smaller variant or free GPUs via .
docker compose down
- 错误:REST调用返回连接拒绝。原因:目标微服务未运行。解决方案:探测或
/docs端点;通过/health或对应的vss-deploy-profile技能重新部署。vss-deploy-* - 错误:从NGC拉取镜像时返回HTTP 401/403。原因:缺失或过期。解决方案:执行
NGC_CLI_API_KEY并重新导出密钥后重试。docker login nvcr.io - 错误:容器内存不足(OOM)或模型加载失败。原因:所选配置文件所需的GPU内存不足。解决方案:切换到更小的变体,或通过释放GPU资源。
docker compose down
VSS Setup Video Analytics API — Standalone
VSS Setup Video Analytics API — 独立部署
Deploy just the container (the Node.js REST API from the upstream repo), not as part of the full warehouse blueprint stack.
vss-video-analytics-apivideo-analytics-apiThe full operational walkthrough — config-source options, data-log volume behavior, infrastructure dependencies, REST API endpoints, deploy + verify, troubleshooting — is . This SKILL.md only handles routing and prerequisites.
references/deploy-video-analytics-api-service.md仅部署容器(来自上游仓库的Node.js REST API),而非作为完整仓库蓝图栈的一部分。
vss-video-analytics-apivideo-analytics-api完整的操作指南——配置源选项、数据日志卷行为、基础设施依赖、REST API端点、部署+验证、故障排除——请参考。本SKILL.md仅处理路由和前置条件。
references/deploy-video-analytics-api-service.mdWhen to use
使用场景
- "Deploy video analytics api" / "run video-analytics-api standalone"
- "I just want to run the REST API, not the full stack"
- "Use my own video-analytics-api config"
- "Point the API at a different Elasticsearch / Kafka"
- "Start the API without Kafka" / "run the API broker-less"
- "Check what REST endpoints are available"
- "部署视频分析API" / "独立运行video-analytics-api"
- "我只想运行REST API,不想部署完整栈"
- "使用我自己的video-analytics-api配置"
- "将API指向其他Elasticsearch/Kafka"
- "不使用Kafka启动API" / "无代理运行API"
- "查看可用的REST端点"
Prerequisites
前置条件
-
Repo checkout withpointing at
$VSS_APPS_DIR. Required by the service compose's volume binds.<repo>/deploy/docker/ -
NGC credentials —set so docker can pull the image. See
$NGC_CLI_API_KEY.../vss-deploy-profile/references/ngc.mdSecure-handling note for: this key is a long-lived credential that pulls all NVIDIA private images available to your NGC org. Never commit the key, never paste it into chat, never store it inNGC_CLI_API_KEY. Read it interactively (/tmp) or load it from your secret manager (Vault, AWS Secrets Manager, sealed-secrets) at deploy time. Write any derivedread -rs NGC_CLI_API_KEYfiles with.env+umask 077, add them tochmod 600, and rotate the key on a defined cadence and after every host decommission. If it has ever been exposed (host snapshot, shared screen, ticket attachment), rotate immediately..gitignore -
Docker runtime — Docker Engine 28.3.3 with Docker Compose plugin v2.39.1+. Verify withand
docker --version.docker compose version -
Elasticsearch — must be reachable at the URL configured in. The server pings ES on startup; if unreachable, it exits (and
elasticsearch.nodebrings it back). If you need to bring up ES too, use the infra compose:restart: always.docker compose -f services/infra/compose.yml up -d elasticsearch -
Optional Kafka broker. The API can run without Kafka. If you want a quiet broker-less deployment, use the image-baked config or a custom config with; the service-shipped compose config points at
kafka.brokers: [], so Kafka-dependent features (dynamic config, dynamic calibration, RTLS/AMR) will fail until a broker is reachable.localhost:9092 -
for the default compose. The base compose bind-mounts
$VSS_DATA_DIRfor multipart upload handling and file-backed assets such as calibration images. Set the directory to a writable host path and pre-create it, or remove that mount if image uploads are not needed.$VSS_DATA_DIR/data_log/vss_video_analytics_api
If any required prerequisite fails, surface the gap before going further.
-
仓库检出:指向
$VSS_APPS_DIR。这是服务compose文件的卷绑定所必需的。<repo>/deploy/docker/ -
NGC凭证:需设置,以便Docker可以拉取镜像。请参考
$NGC_CLI_API_KEY。../vss-deploy-profile/references/ngc.md安全处理注意事项:该密钥是长期有效的凭证,可拉取NGC组织下所有可用的NVIDIA私有镜像。绝不要提交密钥,绝不要粘贴到聊天中,绝不要存储在NGC_CLI_API_KEY目录。通过交互式方式读取(/tmp),或在部署时从密钥管理器(Vault、AWS Secrets Manager、sealed-secrets)加载。生成的read -rs NGC_CLI_API_KEY文件需设置.env+umask 077,将其添加到chmod 600,并按规定周期以及每次主机退役后轮换密钥。若密钥曾暴露(如主机快照、共享屏幕、工单附件),请立即轮换。.gitignore -
Docker运行时:Docker Engine 28.3.3及以上版本,搭配Docker Compose插件v2.39.1+。通过和
docker --version验证版本。docker compose version -
Elasticsearch:必须在配置的URL处可访问。服务器启动时会ping ES;若无法访问,则会退出(
elasticsearch.node会使其重新启动)。如果需要同时部署ES,可使用基础设施compose文件:restart: always。docker compose -f services/infra/compose.yml up -d elasticsearch -
可选Kafka代理:API可以在无Kafka的情况下运行。如果需要无代理的静默部署,可使用镜像内置的配置,或自定义配置并设置;服务自带的compose配置指向
kafka.brokers: [],因此依赖Kafka的功能(动态配置、动态校准、RTLS/AMR)在代理可访问前会失效。localhost:9092 -
默认compose所需的:基础compose文件将
$VSS_DATA_DIR绑定挂载,用于处理多部分上传和基于文件的资产(如校准图像)。需将该目录设置为可写的主机路径并预先创建,若不需要图像上传则可移除该挂载。$VSS_DATA_DIR/data_log/vss_video_analytics_api
若任何必要的前置条件未满足,请在继续操作前指出问题。
Workflow
工作流程
Hand the user and walk them through its steps in order:
references/deploy-video-analytics-api-service.md- Choose a config — image-baked default, service-shipped, or custom.
- Decide whether a data-log volume is needed for file uploads.
- Confirm infrastructure dependencies — Elasticsearch (required), Kafka (optional).
- Deploy + verify with and health check.
docker compose up
The compose-file edits, config options, deploy + verify commands, REST API endpoint table, and troubleshooting table all live in that reference — don't duplicate them here.
将提供给用户,并引导他们按顺序执行其中的步骤:
references/deploy-video-analytics-api-service.md- 选择配置——镜像内置默认配置、服务自带配置或自定义配置。
- 确定是否需要数据日志卷用于文件上传。
- 确认基础设施依赖——Elasticsearch(必需)、Kafka(可选)。
- 使用部署并验证健康状态。
docker compose up
compose文件编辑、配置选项、部署+验证命令、REST API端点表和故障排除表均在该参考文档中——请勿在此处重复。
REST API capabilities
REST API功能
Once the container is up and Elasticsearch is reachable, the API serves the
endpoint groups listed in
§ REST API endpoints.
references/deploy-video-analytics-api-service.mdThe server must initialize against Elasticsearch before can return healthy. Data-query endpoints also need matching Elasticsearch indices and data. Endpoints that publish notifications (config, calibration) or expose RTLS / AMR streams also require Kafka.
/livez容器启动且Elasticsearch可访问后,API将提供
§ REST API端点中列出的端点组。
references/deploy-video-analytics-api-service.md服务器必须先完成Elasticsearch初始化,才能返回健康状态。数据查询端点还需要匹配的Elasticsearch索引和数据。发布通知(配置、校准)或暴露RTLS/AMR流的端点也需要Kafka。
/livezKafka-dependent features (runtime, requires broker)
依赖Kafka的功能(运行时,需要代理)
Once the container is up and a Kafka broker is reachable, three additional capabilities are available:
容器启动且Kafka代理可访问后,将提供三个额外功能:
Dynamic config
动态配置
The API acts as the producer for dynamic config updates. When an operator POSTs to , the API publishes an message to the topic with Kafka key . The downstream container consumes this and ACKs back. The API also handles the bootstrap flow — when starts, it publishes a message, and the API replies with containing the latest verified config from Elasticsearch.
/configupsertmdx-notificationbehavior-analytics-configbehavior-analyticsbehavior-analyticsrequest-configupsert-allConsumer-side validation, ACK semantics, and the full wire contract are documented in .
../vss-setup-behavior-analytics/references/dynamic-config.mdAPI作为动态配置更新的生产者。当操作员向发送POST请求时,API会向主题发布一条消息,Kafka键为。下游的容器会消费该消息并返回ACK。API还处理引导流程——当启动时,它会发布一条消息,API则回复包含来自Elasticsearch的最新验证配置的消息。
/configmdx-notificationupsertbehavior-analytics-configbehavior-analyticsbehavior-analyticsrequest-configupsert-all消费端验证、ACK语义和完整的通信协议记录在中。
../vss-setup-behavior-analytics/references/dynamic-config.mdDynamic calibration
动态校准
The API produces calibration update notifications on with Kafka key . Supports (full snapshot), (per-sensor merge), and (per-sensor removal). The downstream container consumes these and applies them to the live calibration.
mdx-notificationcalibrationupsert-allupsertdeletebehavior-analyticsConsumer-side validation and per-action policy are documented in .
../vss-setup-behavior-analytics/references/dynamic-calibration.mdAPI会在主题上发布校准更新通知,Kafka键为。支持(完整快照)、(按传感器合并)和(按传感器移除)操作。下游的容器会消费这些通知并应用到实时校准中。
mdx-notificationcalibrationupsert-allupsertdeletebehavior-analytics消费端验证和每个操作的策略记录在中。
../vss-setup-behavior-analytics/references/dynamic-calibration.mdRTLS / AMR
RTLS / AMR
The API consumes real-time location () and AMR () messages from Kafka and exposes them via REST endpoints.
mdx-rtlsmdx-amrAPI从Kafka消费实时位置()和AMR()消息,并通过REST端点暴露这些数据。
mdx-rtlsmdx-amrRouting rules
路由规则
- If the user wants "the full stack" (UI / agent / perception): hand off to with profile
vss-deploy-profile(orwarehouse). Don't run this skill in parallel.alerts - If the user wants to deploy the analytics pipeline (behavior creation, incident detection): hand off to .
vss-setup-behavior-analytics - If the user wants to publish a runtime config / calibration update through the REST API: confirm Kafka is reachable, then use the or calibration endpoints and point them at the behavior-analytics dynamic-update references for the consumer wire contract.
/config - If the user wants to understand the dynamic config / dynamic calibration wire contract from the consumer (behavior-analytics) side: point them at and
../vss-setup-behavior-analytics/references/dynamic-config.md.../vss-setup-behavior-analytics/references/dynamic-calibration.md - If the user wants to query or interact with the REST API endpoints: the endpoint table above and the deploy reference cover what's available. For the full OpenAPI spec, see in the
src/app/specification/openapi.jsonrepo.video-analytics-api
- 如果用户想要"完整栈"(UI/代理/感知):将其引导至,使用
vss-deploy-profile(或warehouse)配置文件。请勿并行运行本技能。alerts - 如果用户想要部署分析流水线(行为创建、事件检测):将其引导至。
vss-setup-behavior-analytics - 如果用户想要通过REST API发布运行时配置/校准更新:确认Kafka可访问,然后使用或校准端点,并引导他们参考behavior-analytics的动态更新文档以了解消费端通信协议。
/config - 如果用户想要从消费端(behavior-analytics)了解动态配置/动态校准的通信协议:引导他们参考和
../vss-setup-behavior-analytics/references/dynamic-config.md。../vss-setup-behavior-analytics/references/dynamic-calibration.md - 如果用户想要查询或与REST API端点交互:上方的端点表和部署参考文档涵盖了可用内容。完整的OpenAPI规范请查看仓库中的
video-analytics-api。src/app/specification/openapi.json