anomalydetection-run-gensim-scenario-on-vm
Skill3.8k starsChanged 4 days agoApache-2.0View on GitHub
Record gensim episodes on a remote Linux VM with the anomaly-detection recorder and fetch Parquet recordings for the Agent Anomaly Detection team's testbench evals. Use for "record a gensim scenario on a VM", "set up the gensim VM", or "record a batch of episodes and fetch the parquet". Not a general-purpose gensim or Agent benchmarking workflow.
- Reads credentials
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Run the bundled shell helpers one at a time and check their exit status.
- Distinctive: line 19
Do not claim a live VM run unless you actually performed one.
- Distinctive: line 23
Ask for missing inputs and resolve ambiguity before changing resources:
- Distinctive: line 35
Use at least 4 vCPU / 16 GiB and about 20 GB free disk.
- Very specific: line 48
If creating a VM, use the repo's non-interactive e2e AWS setup first (doc/how-to/test/e2e/).
- Very specific: line 55
Use the SSH target printed by dda inv aws.create-vm.
- Distinctive: line 65
Prefer a pre-provisioned VM.
- Very specific: line 67
Create a cluster only if gadget-dev does not already exist:
- Distinctive: line 81
Use the settings authorized in step 1:
- Very specific: line 114
Use shortened instead of full only when requested: it changes warmup/baseline/disruption/cooldown to 30/60/90/30 s in the VM copy.
- Distinctive: line 159
Use this final-response template per episode:
- Distinctive: line 181
Read only for a failed or unfamiliar step:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Record gensim episodes on a VM
Owner: Agent Anomaly Detection (@DataDog/agent-anomaly-detection).
Run the bundled shell helpers one at a time and check their exit status. Inspect the relevant function when troubleshooting or adapting another Linux image. They do not automatically tear down resources: reuse a healthy VM, cluster, and recorder for a batch instead of provisioning for every episode.
Do not claim a live VM run unless you actually performed one.
1. Collect inputs and authorization
Ask for missing inputs and resolve ambiguity before changing resources:
| Input | Requirement |
| VM | Disposable user@host the user authorizes you to repurpose, or an authorized new AWS VM |
| Scenario | Directory in the gensim-episodes repo containing play-episode.sh and chart/; episode from episodes/*.yaml |
| Env file | Local file defining DD_API_KEY and DD_APP_KEY for dddev; do not read, echo, or print values |
| Recorder image | datadog/agent-dev:<tag> from CI job dev_branch-recorder-full; confirm pipeline and amd64 platform |
| Run settings | Full/shortened mode, cluster name, flush (default 1m), retention (default 90m), optional recording-only mode |
| Output | Fresh absolute directory per run, default /tmp/vm-scenarios/<episode>; do not overwrite an existing directory |
| Batch / teardown | Episodes to run and resources to remove afterwards; retain resources until the batch finishes |
Use at least 4 vCPU / 16 GiB and about 20 GB free disk.
Retention must exceed the whole batch plus the final flush wait; fetch each episode immediately to avoid
eviction. Do not operate on production machines or clusters: these steps install software, change host settings,
deploy workloads, and create dddev monitors/events. Confirm the disposable host and dddev credentials first.
The helpers require --disposable-vm to record that authorization; the flag is not a substitute for obtaining it.
Set SKILL to this skill's absolute directory, and VM to the confirmed SSH target.
Local dependencies: Bash, SSH/SCP, rsync, Python 3, and PyArrow for fetching (use uv run --with pyarrow bash ...).
Set SSH_PORT for a non-default SSH port. Use the user's SSH configuration; verify unknown host fingerprints instead
of disabling host-key checking.
2. Provision or reuse the VM and cluster
If creating a VM, use the repo's non-interactive e2e AWS setup first (doc/how-to/test/e2e/); ask for the GitHub team
if needed for dda inv e2e.setup --team=<team>. From the Agent checkout:
bash "$SKILL/scripts/vm.sh" create-vm --disposable-vm "$STACK" t3.2xlargeUse the SSH target printed by dda inv aws.create-vm. --no-install-agent avoids a competing host Agent.
For a created or reused VM:
bash "$SKILL/scripts/vm.sh" probe "$VM"Require x86_64, passwordless sudo, Docker without sudo, kind, kubectl, Helm, Python 3 with PyYAML, and inotify limits of at least 524288 watches / 1024 instances. Stop on missing prerequisites. Load the bootstrap reference only for missing tools, Docker permissions, or low inotify limits. Prefer a pre-provisioned VM; a custom AMI is an optional future optimization, not part of this run.
Create a cluster only if gadget-dev does not already exist:
bash "$SKILL/scripts/vm.sh" create-cluster --disposable-vm "$VM"The kind asset declares one worker so signals stay in one recorder directory. An existing cluster
is refused rather than replaced. Reuse it only after checking it is the intended disposable cluster and its nodes
are Ready: run bash "$SKILL/scripts/vm.sh" reuse-cluster --disposable-vm "$VM" to export its dedicated kubeconfig
without recreating it. Helpers use ~/gensim/kubeconfig and require kind-gadget-dev; direct kubectl/Helm commands
must use that kubeconfig and explicit context too. Do not import an unrelated current production context.
3. Deploy the recorder once
Use the settings authorized in step 1:
bash "$SKILL/scripts/vm.sh" deploy-recorder --disposable-vm "$VM" "$ENV_FILE" "$TAG" "$CLUSTER_NAME" 1m 90m falseExpected outcome: the recorder runs in the intended cluster with the configured values and a mode-600 env file. Credentials must not appear in command arguments or output. Secrets remain on the disposable VM until removal; do not print the env file or enable shell tracing.
Confirm exactly one recorder Agent pod, all containers Ready, zero restarts, and metrics/log Parquet files after a flush interval. Check host load and probe warnings; stop and resize a saturated VM instead of accepting a degraded run. Reusing the recorder avoids image loads and restarts. Redeployment can discard pod-local data; fetch first.
4. Prepare and run episodes
Copy each scenario into a fresh remote directory; only the VM copy is modified:
bash "$SKILL/scripts/scenario.sh" prepare --disposable-vm "$VM" "$SCENARIO_ID" "$SCENARIO_DIR"
bash "$SKILL/scripts/scenario.sh" run --disposable-vm "$VM" "$SCENARIO_ID" "$EPISODE" "$RELEASE" full qbranch_gensimExpected outcome from prepare: a fresh scenario copy ready to run on the VM, without a competing Agent or stale
results. It refuses to overwrite a remote scenario directory. For another episode of that scenario,
reuse the prepared copy and invoke only run. For a same-name rerun, prepare a different scenario id to preserve results.
Uninstall the previous scenario release before switching scenarios so unrelated workloads do not contaminate the next
recording; keep the VM, cluster, and recorder.
Expected outcome from run: results/<episode>-1.json, results/<episode>.log, and Agent status snapshots for
recording validation. Retain the tool session and wait for completion. Episodes survive SSH disconnections;
inspect the log and running workloads before retrying instead of blindly rerunning.
Use shortened instead of full only when requested: it changes warmup/baseline/disruption/cooldown to 30/60/90/30 s
in the VM copy. Recopy the original scenario before a subsequent full run. Full episodes usually take about 32 min;
the monitor can add up to 300 s waiting for baseline OK.
An Alert-state warning or "success": false in the monitor results does not establish recording failure.
Judge recording success separately from fetched data. Missing episode.json means there is no usable scenario window.
5. Fetch and validate each recording
Pass the actual recorder flush interval in seconds:
uv run --with pyarrow bash "$SKILL/scripts/fetch.sh" "$VM" "$SCENARIO_ID" "$EPISODE" "$OUT" 60Expected outcome: validated recordings for the episode window in a fresh output directory, ready for replay. Fetch failures, corrupt files, and unusable recordings must stop the workflow rather than produce a successful result. Recordings from the original procedure without episode Agent snapshots can still be fetched; report their restart/replacement history as unknown rather than claiming it was verified.
Preserve the original trim rule: keep whole files whose minimum/maximum Time overlaps start_time..end_time,
not filenames (flush time). Integer timestamps may be seconds, milliseconds, microseconds, or nanoseconds.
Both metrics/log families must contain nonempty in-window data. Report observed timestamp coverage and sample gaps;
sparse timestamps are a warning, not a new rejection rule. Investigate coverage warnings before claiming a complete
recording. These checks do not prove every metric series is complete; also report restarts, saturation, and probe errors.
Outputs: episode.json, validation.json, Agent status snapshots, and parquet/ with retained files. Boundary files
may include samples outside the window. advances.jsonl and detect_digests.jsonl, when present, remain untrimmed and
span the Agent run. Unfiltered remote files remain until retention or restart. On failure, retain partial output for
diagnosis and retry into a fresh directory; do not delete user-selected data.
Replay only after validation succeeds, with output named for the episode under a parent of scenario directories:
dda inv anomalydetection.launch-testbench --scenarios-dir "$(dirname "$OUT")" --build6. Teardown and report
Perform only authorized teardown, after fetching all episodes. On the VM, uninstall selected releases with
KUBECONFIG="$HOME/gensim/kubeconfig" helm --kube-context kind-gadget-dev --namespace default uninstall <release>
(or datadog-agent). Delete kind only when selected: kind delete cluster --name gadget-dev.
Destroy a VM created in step 2 only when selected: dda inv aws.destroy-vm --stack-name=<stack> from the checkout.
Report resources and secrets still present when the VM is retained.
Use this final-response template per episode:
| Field | Report |
| Episode | Scenario id, episode, full/shortened mode |
| VM / image | SSH target, created/reused status, exact image tag and source pipeline |
| Output | Absolute path, kept metrics/log file and in-window row counts, removed file count |
| Window | Start/end, flush interval, observed coverage from validation.json |
| Quality | Usable/failed, sample gaps, restarts, saturation/probe errors; distinguish unknown from verified |
| Teardown | Releases/cluster/VM removed, resources and secrets retained |
Example request: "Record a shortened kafka-partition-saturation episode on ubuntu@10.0.1.23 with
datadog/agent-dev:my-branch-recorder-full from pipeline 123, use ~/dddev.env, save under /tmp/vm-scenarios, and keep the VM."
Illustrative result: shortened episode, reused VM, specified image/pipeline, output
/tmp/vm-scenarios/kafka-partition-saturation; 4 metrics files / 1000 rows and 4 log files / 200 rows retained, 2 files
removed; window 10:12–10:16 UTC, flush 60 s, maximum observed gaps 15 s metrics / 30 s logs, no restarts or probe errors
observed; validation passed. VM, cluster, recorder, scenario release, and env file retained as requested.
Fill these fields from real observations, not the example.
Troubleshooting references
Read only for a failed or unfamiliar step:
- Recorder configuration: https://datadoghq.atlassian.net/wiki/spaces/agent/pages/7272235685/Using+the+recorder+to+record+gensim+staging+scenarios
- Lima/kind setup: https://datadoghq.atlassian.net/wiki/spaces/agent/pages/6238700466/Gensim+Hands+On
- Docker permission denied after bootstrap: close the multiplexed SSH connection and reconnect to pick up group membership.
- Exec format errors: confirm an amd64 image for the x86_64 VM.
- Docker 29 image-load errors: use a single-platform image archive instead of
kind load docker-image. - Multiple recorder pods or restarting containers: stop, fix topology/resources, and start a new recording.
To validate helper changes without provisioning resources, run
uv run --no-project --with pyarrow --with pyyaml bash "$SKILL/scripts/test.sh" and ShellCheck on scripts/*.sh.
The tests mock SSH/SCP/dda and use generated Parquet fixtures; they do not validate a live chart or AMI.
Trending
More talk lately.about the whole repository
Who's talking about DataDog/datadog-agent
- aws/aws-sdk-go-v2“[SOLUTION IN THREAD] "not found, ResolveEndpointV2" service modules before 11/15/23 are incompatible …”GitHub · Nov 16, 2023 · 45 reactions
- micrometer-metrics/micrometer“Unix Domain Socket support (StatsD)”GitHub · Aug 17, 2018 · 22 reactions
- golang/go“proposal: x/tools/go/analysis/passes/appends: check for incorrect slice length initialization ”GitHub · Oct 14, 2024 · 18 reactions
- airbytehq/airbyte“[STORAGE-S3] Add Support for Custom S3 Endpoint”GitHub · Aug 16, 2024 · 14 reactions
- prometheus/blackbox_exporter“List of metrics provided in a human-readable format”GitHub · Dec 15, 2021 · 13 reactions
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub and Stack Overflow (54 times).
On GitHub · 46
- Nov 16, 2023[SOLUTION IN THREAD] "not found, ResolveEndpointV2" service modules before 11/15/23 are incompatible against newer root modules — aws/aws-sdk-go-v245 reactions · 33 comments
- Aug 17, 2018Unix Domain Socket support (StatsD) — micrometer-metrics/micrometer22 reactions · 23 comments
- Oct 14, 2024proposal: x/tools/go/analysis/passes/appends: check for incorrect slice length initialization — golang/go18 reactions · 28 comments
- Aug 16, 2024[STORAGE-S3] Add Support for Custom S3 Endpoint — airbytehq/airbyte14 reactions · 21 comments
- Dec 15, 2021List of metrics provided in a human-readable format — prometheus/blackbox_exporter13 reactions · 5 comments
41 more on GitHub
- Feb 26, 2026cmd/go: decide and document official recommendation for typical 'go' version in go.mod for open source libraries — golang/go9 reactions · 13 comments
- Dec 26, 2024[BUG] go.mod tidy fails due to unresolved module in dd-trace-go — DataDog/dd-trace-go9 reactions · 8 comments
- Oct 31, 2018[disk] Blacklist certain partitions by default — DataDog/integrations-core9 reactions · 6 comments
- Mar 27, 2024datadog-agent: panic: must be called from a bundle — NixOS/nixpkgs8 reactions · 5 comments
- Feb 3, 2026cmd/go: go list computes build info for test packages when not needed — golang/go7 reactions · 4 comments
- Jan 28, 2022v1.35.0 breaks any program trying to use a `-v` flag — DataDog/dd-trace-go6 reactions · 5 comments
- May 10, 2021Validator reports false duplicates — dependabot/dependabot-core6 reactions · 2 comments
- Aug 27, 2020ERROR | Cannot write json file: /opt/datadog-agent/run/version-history.json with Agent 7.22 — DataDog/heroku-buildpack-datadog6 reactions · 5 comments
- Feb 17, 2025[receiver/sqlserver] Support query-level log collection [Top Query] — open-telemetry/opentelemetry-collector-contrib4 reactions · 11 comments
- Jul 20, 2026chore(ci): update Datadog Agent version to 7.81.1 — DataDog/saluki3 reactions · 3 comments
- Jun 20, 2025datadog-agent: 7.56.2 -> 7.70.2 — NixOS/nixpkgs3 reactions · 3 comments
- May 17, 2024Service V2 collector — prometheus-community/windows_exporter3 reactions
- Oct 26, 2026chore(ci): update Datadog Agent version to 7.84.6 — DataDog/saluki2 reactions · 3 comments
- Oct 21, 2026feat(nodeagent): add DD_POD_NAME as env var — DataDog/datadog-operator2 reactions · 4 comments
- Oct 19, 2026chore(ci): update Datadog Agent version to 7.84.3 — DataDog/saluki2 reactions · 3 comments
- Oct 12, 2026chore(ci): update Datadog Agent version to 7.84.2 — DataDog/saluki2 reactions · 3 comments
- Oct 9, 2026Revert Python version upgrade on 7.84.x — DataDog/integrations-core2 reactions · 6 comments
- Oct 5, 2026chore(ci): update Datadog Agent version to 7.84.1 — DataDog/saluki2 reactions · 2 comments
- Sep 29, 2026Install DotSlash in the standard build images — DataDog/datadog-agent-buildimages2 reactions · 2 comments
- Sep 28, 2026chore(ci): update Datadog Agent version to 7.83.3 — DataDog/saluki2 reactions · 2 comments
- Sep 28, 2026chore(deps): bump the docker-compose-dev group across 2 directories with 14 updates — DataDog/dd-trace-go2 reactions · 2 comments
- Sep 28, 2026Update go dependencies — DataDog/datadog-operator2 reactions · 3 comments
- Sep 21, 2026chore(ci): update Datadog Agent version to 7.83.2 — DataDog/saluki2 reactions · 2 comments
- Sep 21, 2026chore(deps): bump the docker-compose-dev group across 2 directories with 10 updates — DataDog/dd-trace-go2 reactions · 3 comments
- Sep 15, 2026fix(datadog): configure Core Agent for PAR split mode — DataDog/helm-charts2 reactions
- Sep 14, 2026chore(deps): bump the docker-compose-dev group across 2 directories with 7 updates — DataDog/dd-trace-go2 reactions · 3 comments
- Sep 4, 2026feat(orchestrator): grant KubeAI collection RBAC — DataDog/datadog-operator2 reactions · 1 comment
- Sep 3, 2026chore(ci): update Datadog Agent version to 7.83.0 — DataDog/saluki2 reactions · 2 comments
- Sep 3, 2026fix(metrics): normalize metric names prior to filtering — DataDog/saluki2 reactions · 4 comments
- Aug 26, 2026chore(ci): update Datadog Agent version to 7.82.3 — DataDog/saluki2 reactions · 2 comments
- Aug 26, 2026include selinux-type annotation to dap — DataDog/datadog-operator2 reactions · 1 comment
- Aug 24, 2026[CONTP-2014] Add `instrumentation_controller.*` metrics to default cluster agent integration — DataDog/integrations-core2 reactions · 4 comments
- Aug 24, 2026chore(ci): update Datadog Agent version to 7.82.2 — DataDog/saluki2 reactions · 2 comments
- Aug 21, 2026Revert "Revert "Make sure we keep the testing params when extra params does not override minor version"" — DataDog/agent-linux-install-scriptsays it tested it2 reactions · 4 comments
- Aug 18, 2026feat(datadog-agent-commons): add minimal IPC TLS feature — DataDog/saluki2 reactions · 2 comments
- Aug 17, 2026chore(ci): update Datadog Agent version to 7.82.1 — DataDog/saluki2 reactions · 2 comments
- Aug 17, 2026chore(deps): bump the docker-compose-dev group across 3 directories with 7 updates — DataDog/dd-trace-go2 reactions · 3 comments
- Aug 3, 2026chore(ci): update Datadog Agent version to 7.81.3 — DataDog/saluki2 reactions · 2 comments
- Jul 29, 2026[ACIX-1887] Remove legacy devcontainer image — DataDog/datadog-agent-buildimages2 reactions · 1 comment
- Jul 27, 2026chore(ci): update Datadog Agent version to 7.81.2 — DataDog/saluki2 reactions · 2 comments
- Oct 5, 2024Update ecs_fargate docs to note DD_DOGSTATSD_TAG_CARDINALITY setting — DataDog/integrations-core2 reactions · 2 comments
On Stack Overflow · 8
- Mar 13, 2020How do you pass file_system_blacklist arg to Datadog Docker Agent run command?3 votes
- Dec 11, 2019Containers - Failed to get host IPs3 votes
- May 13, 2020Is there a serverless kubernetes datadog agent?2 votes
- Jun 29, 2018How to set docker labels on ECS agent container?2 votes · 1 answer
- Apr 28, 2022Issues with setting up Autodiscovery Auto-Configuration for Kubernetes integration in Datadog1 vote
3 more on Stack Overflow
- Nov 4, 2020How to configure hostname in ECS Fargate task definition1 vote
- Jan 26, 2023datadog local check setup same as check_mk local check for monitoring0 votes
- Mar 31, 2021How does the serverless datadog forwarder encrypt/encode their logs?0 votes
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bazel/AGENTS.mdAGENTS.md
- omnibus/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- tasks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/agent_corecheck.mdcCursor rule
- .cursor/rules/e2e_tests.mdcCursor rule
- .cursor/rules/general-guidelines.mdcCursor rule
- .cursor/rules/go_module_bazel_migration.mdcCursor rule
- .cursor/rules/system_probe_modules.mdcCursor rule
- agent-supply-chain-newsletterSkill
- alliumSkill
- auto-jiraSkill
- create-componentSkill
- create-config-fieldSkill
- create-core-checkSkill
- create-epic-recapSkill
- create-go-moduleSkill
- create-invoke-taskSkill
- create-prSkill
- create-release-noteSkill
- create-runtime-settingSkill
- create-status-providerSkill
- create-subcommandSkill
- cws-btfhub-syncSkill
- cws-iouring-coverageSkill
- e2e-auditSkill
- explain-lading-configSkill
- follow-prSkill
- gpu-live-metric-validationSkill
- handle-pr-ci-failureSkill
- injector-devSkill
- locate-config-settingSkill
- quality-gate-size-analysisSkill
- review-pr-commentsSkill
- run-e2eSkill
- run-jiraSkill
- run-windows-e2eSkill
- triage-ci-failureSkill
- update-3rd-party-libsSkill
- update-otel-depsSkill
- write-e2eSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

