Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scripts

БесплатноЗапускает вложенные скриптыНе проверен

Generate tuned manifests and evaluate node tuning snapshots

openshift-engот openshift-eng★ 123 звезды на GitHub9 установок в других каталогах

Об этом скилле

Node Tuning Helper Scripts

Detailed instructions for invoking the helper utilities that back /node-tuning commands:

  • generate_tuned_profile.py renders Tuned manifests (tuned.openshift.io/v1).
  • analyze_node_tuning.py inspects live nodes or sosreports for tuning gaps.

When to Use These Scripts

  • Translate structured command inputs into Tuned manifests for the Node Tuning Operator.
  • Iterate on generated YAML outside the assistant or integrate the generator into automation.
  • Analyze CPU isolation, IRQ affinity, huge pages, sysctl values, and networking counters from live clusters or archived sosreports.

Prerequisites

  • Python 3.8 or newer (python3 --version).
  • Repository checkout so the scripts under plugins/node-tuning/skills/scripts/ are accessible.
  • Optional: oc CLI when validating or applying manifests.
  • Optional: Extracted sosreport directory when running the analysis script offline.
  • Optional (remote analysis): oc CLI access plus a valid KUBECONFIG when capturing /proc//sys or sosreport via oc debug node/<name>. The sosreport workflow pulls the registry.redhat.io/rhel9/support-tools image (override with --toolbox-image or TOOLBOX_IMAGE) and requires registry access. HTTP(S) proxy env vars from the host are forwarded automatically when present, but using a proxy is optional.

Script: generate_tuned_profile.py

Implementation Steps

  1. Collect Inputs

    • --profile-name: Tuned resource name.
    • --summary: [main] section summary.
    • Repeatable options: --include, --main-option, --variable, --sysctl, --section (SECTION:KEY=VALUE).
    • Target selectors: --machine-config-label key=value, --match-label key[=value].
    • Optional: --priority (default 20), --namespace, --output, --dry-run.
    • Use --list-nodes/--node-selector to inspect nodes and --label-node NODE:KEY[=VALUE] (plus --overwrite-labels) to tag machines.
  2. Inspect or Label Nodes (optional)

    # List all worker nodes
    python3 plugins/node-tuning/skills/scripts/generate_tuned_profile.py --list-nodes --node-selector "node-role.kubernetes.io/worker" --skip-manifest
    
    # Label a specific node for the worker-hp pool
    python3 plugins/node-tuning/skills/scripts/generate_tuned_profile.py \
      --label-node ip-10-0-1-23.ec2.internal:node-role.kubernetes.io/worker-hp= \
      --overwrite-labels \
      --skip-manifest
    
  3. Render the Manifest

    python3 plugins/node-tuning/skills/scripts/generate_tuned_profile.py \
      --profile-name "$PROFILE" \
      --summary "$SUMMARY" \
      --sysctl net.core.netdev_max_backlog=16384 \
      --match-label tuned.openshift.io/custom-net \
      --output .work/node-tuning/$PROFILE/tuned.yaml
    
    • Omit --output to write <profile-name>.yaml in the current directory.
    • Add --dry-run to print the manifest to stdout.
  4. Review Output

    • Inspect the generated YAML for accuracy.
    • Optionally format with yq or open in an editor for readability.
  5. Validate and Apply

    • Dry-run: oc apply --server-dry-run=client -f <manifest>.
    • Apply: oc apply -f <manifest>.

Error Handling

  • Missing required options raise ValueError with descriptive messages.
  • The script exits non-zero when no target selectors (--machine-config-label or --match-label) are supplied.
  • Invalid key/value or section inputs identify the failing argument explicitly.

Examples

python3 plugins/node-tuning/skills/scripts/generate_tuned_profile.py \
  --profile-name realtime-worker \
  --summary "Realtime tuned profile" \
  --include openshift-node --include realtime \
  --variable isolated_cores=1 \
  --section bootloader:cmdline_ocp_realtime=+systemd.cpu_affinity=${not_isolated_cores_expanded} \
  --machine-config-label machineconfiguration.openshift.io/role=worker-rt \
  --priority 25 \
  --output .work/node-tuning/realtime-worker/tuned.yaml
python3 plugins/node-tuning/skills/scripts/generate_tuned_profile.py \
  --profile-name openshift-node-hugepages \
  --summary "Boot time configuration for hugepages" \
  --include openshift-node \
  --section bootloader:cmdline_openshift_node_hugepages="hugepagesz=2M hugepages=50" \
  --machine-config-label machineconfiguration.openshift.io/role=worker-hp \
  --priority 30 \
  --output .work/node-tuning/openshift-node-hugepages/hugepages-tuned-boottime.yaml

Script: analyze_node_tuning.py

Purpose

Inspect either a live node (/proc, /sys) or an extracted sosreport snapshot for tuning signals (CPU isolation, IRQ affinity, huge pages, sysctl state, networking counters) and emit actionable recommendations.

Usage Patterns

  • Live node analysis
    python3 plugins/node-tuning/skills/scripts/analyze_node_tuning.py --format markdown
    
  • Remote analysis via oc debug
    python3 plugins/node-tuning/skills/scripts/analyze_node_tuning.py \
      --node worker-rt-0 \
      --k
    
Полный SKILL.md на GitHub

Установить scripts в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

analyze_node_tuning.pygenerate_tuned_profile.py

FAQ

Что делает скилл scripts?

Generate tuned manifests and evaluate node tuning snapshots

Как установить скилл scripts?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scripts запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить scripts с