This directory contains everything needed to run the Vulnerability Analysis pipeline with Docker Compose.
deploy/
├── docker-compose.yml # Default stack (NVIDIA-hosted NIMs)
├── docker-compose.nim.yml # Overlay adding a self-hosted nim-llm service
├── Dockerfile # vuln-analysis image (build context is the repo root)
├── nginx/ # nginx caching proxy (nginx-cache) and SSL (nginx-ssl) config
├── 1_Deploy_CVE.ipynb # Step-by-step deploy walkthrough
└── 2_Customize_CVE.ipynb # Customizing scans against the deployed service
-
Docker with the Compose v2 plugin (
docker compose version) -
Both API credentials below (see the top-level README):
NVIDIA_API_KEY=your-nvidia-api-key TAVILY_API_KEY=your-tavily-api-key
A project-root
.envis convenient for local work, but it is not the only option. You may export these variables or inject them through a CI system, notebook environment, orchestrator, or secret manager. Compatible proxies may be selected withNV_BASE_URLandTAVILY_API_BASE_URL, but the two key variables must still contain the credentials expected by those endpoints. Do not commit real credentials. There is no credential-free mode for a complete, uncached pipeline run.
Run all commands from the repo root. The checked-in wrapper always uses this deployment's
Compose file, loads the root .env when present, and explicitly selects the project named by
DOCKER_COMPOSE_PROJECT_NAME (default vuln_analysis):
# Record the invoking host UID/GID in .env before creating bind-mounted artifacts
bash deploy/configure-host-identity.sh
# Build the application image
bash deploy/compose.sh build vuln-analysis
# Start the stack and wait for the analysis API healthcheck
bash deploy/compose.sh up -d --wait --wait-timeout 300
# Tear it down
bash deploy/compose.sh downIf credentials are already exported or injected into the Compose environment,
the wrapper also works without a root .env. Set DOCKER_COMPOSE_PROJECT_NAME in the
environment or .env before the first up when multiple deployments share a host, and use
the wrapper for every later lifecycle, logs, and exec command. The deployment and
customization notebooks are stateful: run each from top to bottom, run the deployment
notebook first when using the HTTP examples, and rerun setup/producer cells after a kernel
restart before trusting files left under /tmp.
The two application services run as the UID/GID recorded by
deploy/configure-host-identity.sh. Their startup preflight verifies that .tmp, .cache,
and outputs are writable before Jupyter or the API starts. If an older root-run deployment
already created unwritable paths, stop the stack and have the host owner or storage
administrator repair their ownership, then rerun the identity helper. On root-squashed NFS,
container root cannot repair those paths.
The stack runs two containers from the vuln-analysis image:
Warning
Externally reachable installations must enable OAuth2/JWT bearer authentication and enforce network access controls such as host firewalls, security groups, or an authenticated ingress. Jupyter listens on all container interfaces, but the default Compose host publication is loopback-only and must not be widened without equivalent authentication and network restrictions.
-
vuln-analysis— the interactive JupyterLab environment, published on loopback port8000by default. SetVULN_ANALYSIS_JUPYTER_HOST_PORTto choose another host port; legacyWORKFLOW_HOST_JUPYTER_PORTvalues are intentionally ignored. -
vuln-analysis-api— the analysis HTTP API, runningnat serveas the container's main workload under Tini and published on port26466(with the Dask dashboard on8787). A crash exits the container andrestart: alwaysrestarts the service. A Docker healthcheck polls/ready, which requires the NAT API, Dask scheduler, and at least one worker. Check the analysis service status with:bash deploy/compose.sh ps
Async job metadata is stored in the
job-statevolume. When the API starts, persisted jobs insubmittedorrunningare changed to the terminalinterruptedstate. A one-shotvuln-analysis-job-state-initservice gives the configured non-root API user access to that Docker-managed volume; it does not mount or modify the host checkout.bash deploy/compose.sh downpreserves this volume. Adding-vremoves all project volumes—includingjob-state, nginx logs, and both nginx proxy caches—so it is a full reset, not the routine application-cache pruning workflow documented in the root README. A returned pipeline withsuccess:falseis stored as terminalfailure, retains the fullPipelineResultinoutput, and includes a conciseerror. Synchronous/generaterequests return HTTP 422 with that same failed result body; uncaught NAT exceptions use theworkflow_errorenvelope.The service overrides NAT's local-cluster defaults with one concurrent async-job worker and a best-effort per-worker memory limit of 40% of detected system/container memory. NAT adds one worker intended for cleanup, so the default is two Dask process workers with approximately 80% of detected memory configured across them. Dask can exceed these limits, so monitor representative jobs; the settings reduce default resource pressure but are not a hard container-memory cap.
The nginx service has separate LLM and vulnerability-intelligence proxy-cache volumes, each configured with a 20 GiB maximum. These Docker-managed caches are regenerable but are not included in
vuln-analysis cache infoorcache prune. Inspect Docker storage withdocker system df -v. Preservejob-stateunless intentionally resetting persisted async-job metadata.On a larger host, set
VULN_ANALYSIS_MAX_RUNNING_ASYNC_JOBSandVULN_ANALYSIS_DASK_WORKER_MEMORY_LIMITin the root.env, then recreate the service:bash deploy/compose.sh up -d vuln-analysis-api
See Sizing the local Dask cluster for an illustrative larger-host configuration, the worker/concurrency formulas, non-worker overhead, threaded workers, and external schedulers.
The vuln-analysis-api service hosts the HTTP API. To run one-off commands (nat run,
nat eval) or work interactively, open a shell in the JupyterLab container:
bash deploy/compose.sh exec vuln-analysis bashYou land in /workspace (the repo, mounted from the host) with the project's virtual
environment at /opt/vuln-analysis-venv already activated. Keeping the container environment
outside /workspace prevents Compose from creating, hiding, or changing ownership of the host
checkout's .venv. From here you can run any of the pipeline commands from the top-level
README — nat run, nat serve, nat eval — exactly as documented,
for example:
nat run --config_file=configs/config.yml --input_file=data/examples/pipeline_input.jsonRunning them in the container routes API calls through the nginx-cache proxy (via
NV_BASE_URL/TAVILY_API_BASE_URL), so repeated inference and search requests can be served
from cache — faster runs and fewer paid API calls than running the same commands on the host.
Tavily's credential-only /usage readiness request is explicitly excluded from the proxy
cache. Type exit to
leave the shell; the containers keep running.
To run an LLM NIM locally instead of using NVIDIA-hosted endpoints, layer in the overlay:
bash deploy/compose.sh -f deploy/docker-compose.nim.yml up -dThis requires NVIDIA GPUs and the NVIDIA Container Toolkit.
An nginx-ssl service is defined under the ssl profile. Provide nginx/cert.pem and
nginx/key.pem, then start it with --profile ssl.
The compose files live here, but the Docker build context is the repo root
(context: ../) so the Dockerfile can copy the package source, scripts, and
notebooks. All other relative paths (nginx/, the ../:/workspace mount, and the
../.env env_file) are resolved relative to this directory. Always invoke Compose
from the repo root as shown above so these paths line up. The image-managed Python
environment is /opt/vuln-analysis-venv, outside the bind-mounted checkout; local .venv
ownership and contents are therefore unaffected by starting the stack.