-
Notifications
You must be signed in to change notification settings - Fork 46
Add service for Slurm topology collection #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
giongto35
wants to merge
1
commit into
main
Choose a base branch
from
thanhnh/scontrol-topology-scuba-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [Unit] | ||
| Description=Collect Slurm topology | ||
| After=network.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=cluster_monitor | ||
| Environment="PATH=/usr/local/bin:/public/slurm/20.11.3/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/slurm/bin" | ||
| LogsDirectory=scontrol_topology_logs | ||
| ExecStart=/usr/bin/gcm scontrol_topology | ||
| Restart=on-failure | ||
| RestartSec=300 | ||
| Slice=hc_resources.slice | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
website/docs/GCM_Monitoring/collectors/scontrol_topology.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| # scontrol_topology | ||
|
|
||
| ## Overview | ||
|
|
||
| Collects Slurm topology from `scontrol show topo` every 60 seconds. Run one | ||
| instance per cluster, on the same controller-side host as `scontrol.service`. | ||
|
|
||
| The collector supports block topology (`BlockName`, `BlockIndex`, and | ||
| `BlockSize`) and switch topology (`SwitchName`, `Level`, `LinkSpeed`, and | ||
| `Switches`). Slurm hostlists are expanded into the `Nodes` tag set, and | ||
| `node_count` records the full number of nodes before the 10,000-entry safety | ||
| limit is applied. | ||
|
|
||
| **Data Type**: `DataType.LOG`, **Schema**: `ScontrolTopology` | ||
|
|
||
| ## Execution Scope | ||
|
|
||
| Single node in the cluster. The host must have permission to run | ||
| `scontrol show topo`. | ||
|
|
||
| ## Output Schema | ||
|
|
||
| The collector publishes one record per block or switch returned by Slurm. | ||
| Fields that do not apply to the cluster's topology plugin are omitted. | ||
|
|
||
| ```python | ||
| { | ||
| "cluster": str, # Cluster identifier | ||
| "derived_cluster": str | None, # Derived identifier for heterogeneous clusters | ||
|
|
||
| # Block topology | ||
| "BlockName": str | None, | ||
| "BlockIndex": int | None, | ||
| "BlockSize": int | None, | ||
|
|
||
| # Switch topology | ||
| "SwitchName": str | None, | ||
| "Level": int | None, | ||
| "LinkSpeed": int | None, | ||
| "Switches": str | None, # Child switch expression | ||
|
|
||
| "Nodes": list[str] | None, # Expanded Slurm hostlist | ||
| "node_count": int, # Number of nodes before truncation | ||
| } | ||
| ``` | ||
|
|
||
| Node lists longer than 10,000 entries are truncated to protect the collector; | ||
| `node_count` still contains the untruncated count. | ||
|
|
||
| ## Packaged Service | ||
|
|
||
| The packaged `scontrol_topology.service` runs the collector with the settings | ||
| from the `[gcm.scontrol_topology]` section of `/etc/fb-gcm/config.toml`. The | ||
| packaged configuration uses the OpenTelemetry exporter; configure its endpoint | ||
| and resource attributes for your observability backend before enabling the | ||
| service. | ||
|
|
||
| ```bash | ||
| systemctl enable --now scontrol_topology.service | ||
| systemctl status scontrol_topology.service | ||
| ``` | ||
|
|
||
| Only enable the service on one monitoring host per cluster to avoid duplicate | ||
| rows. | ||
|
|
||
| ## Command-Line Options | ||
|
|
||
| | Option | Type | Default | Description | | ||
| |--------|------|---------|-------------| | ||
| | `--cluster` | String | Auto-detected | Cluster identifier | | ||
| | `--sink` | String | `stdout` | Sink destination; see [Exporters](../exporters/README.md) | | ||
| | `--sink-opt` | Multiple | - | Sink-specific option in OmegaConf dot-list syntax | | ||
| | `--log-level` | Choice | `INFO` | Logging verbosity | | ||
| | `--log-folder` | Path | `sacct_running_logs` | Parent directory for collector logs | | ||
| | `--stdout` | Flag | False | Write collector logs to standard output | | ||
| | `--heterogeneous-cluster-v1` | Flag | False | Compute a derived cluster identifier | | ||
| | `--interval` | Integer | 60 | Seconds between collection cycles | | ||
| | `--once` | Flag | False | Collect once and exit | | ||
| | `--retries` | Integer | 2 | Maximum sink write retries | | ||
| | `--dry-run` | Flag | False | Publish records to standard output | | ||
| | `--chunk-size` | Integer | `1M` | Maximum sink write chunk size in bytes | | ||
|
|
||
| Values in `/etc/fb-gcm/config.toml` override these command-line defaults for | ||
| the packaged service. | ||
|
|
||
| ## Usage Examples | ||
|
|
||
| ### One-Time Collection | ||
|
|
||
| Inspect a snapshot without sending it to a remote backend: | ||
|
|
||
| ```bash | ||
| gcm scontrol_topology --once --sink stdout | ||
| ``` | ||
|
|
||
| ### OpenTelemetry Export | ||
|
|
||
| Publish through an OTLP-compatible backend: | ||
|
|
||
| ```bash | ||
| gcm scontrol_topology --once \ | ||
| --sink otel \ | ||
| --sink-opt otel_endpoint=http://localhost:4318 \ | ||
| --sink-opt "log_resource_attributes={'service.name': 'gcm'}" | ||
| ``` | ||
|
|
||
| ### Custom Collection Interval | ||
|
|
||
| Collect every five minutes and publish to a file: | ||
|
|
||
| ```bash | ||
| gcm scontrol_topology \ | ||
| --interval 300 \ | ||
| --sink file \ | ||
| --sink-opt filepath=/tmp/slurm-topology.jsonl | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every 60sec is really aggressive? topology changes happens once an hour on avg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we make it once every 5mins