mlspace-plugin 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. mlspace_mcp/__init__.py +3 -0
  2. mlspace_mcp/__main__.py +125 -0
  3. mlspace_mcp/_status.py +18 -0
  4. mlspace_mcp/auth.py +109 -0
  5. mlspace_mcp/bodyspec.py +184 -0
  6. mlspace_mcp/client.py +170 -0
  7. mlspace_mcp/client_setup.py +235 -0
  8. mlspace_mcp/config.py +283 -0
  9. mlspace_mcp/errors.py +241 -0
  10. mlspace_mcp/formatting.py +502 -0
  11. mlspace_mcp/init_cli.py +356 -0
  12. mlspace_mcp/job_hooks.py +242 -0
  13. mlspace_mcp/jsonc.py +90 -0
  14. mlspace_mcp/overview.py +421 -0
  15. mlspace_mcp/registry.py +632 -0
  16. mlspace_mcp/resource_refs.py +188 -0
  17. mlspace_mcp/server.py +190 -0
  18. mlspace_mcp/setup_ui.py +103 -0
  19. mlspace_mcp/skills/mlspace-call-deployed-model-predict/SKILL.md +36 -0
  20. mlspace_mcp/skills/mlspace-deploy-inference-service/SKILL.md +42 -0
  21. mlspace_mcp/skills/mlspace-diagnose-data-transfer/SKILL.md +41 -0
  22. mlspace_mcp/skills/mlspace-diagnose-failed-training-job/SKILL.md +64 -0
  23. mlspace_mcp/skills/mlspace-diagnose-job-launch-rejection/SKILL.md +44 -0
  24. mlspace_mcp/skills/mlspace-diagnose-unhealthy-inference/SKILL.md +40 -0
  25. mlspace_mcp/skills/mlspace-discover-launchable-resources/SKILL.md +45 -0
  26. mlspace_mcp/skills/mlspace-launch-training-job/SKILL.md +66 -0
  27. mlspace_mcp/skills/mlspace-list-running-jobs/SKILL.md +43 -0
  28. mlspace_mcp/skills/mlspace-resume-notebook-and-set-autoshutdown/SKILL.md +44 -0
  29. mlspace_mcp/skills/mlspace-stage-s3-to-nfs/SKILL.md +45 -0
  30. mlspace_mcp/skills/mlspace-transfer-compute-node/SKILL.md +63 -0
  31. mlspace_mcp/spec/body_schemas.json +7506 -0
  32. mlspace_mcp/spec/openapi.json +28347 -0
  33. mlspace_mcp/tls.py +46 -0
  34. mlspace_mcp/tools/__init__.py +1 -0
  35. mlspace_mcp/tools/allocations.py +92 -0
  36. mlspace_mcp/tools/async_inference.py +77 -0
  37. mlspace_mcp/tools/build_image.py +76 -0
  38. mlspace_mcp/tools/dalle.py +52 -0
  39. mlspace_mcp/tools/data_transfer.py +260 -0
  40. mlspace_mcp/tools/docker_registry.py +156 -0
  41. mlspace_mcp/tools/inference.py +88 -0
  42. mlspace_mcp/tools/jobs.py +155 -0
  43. mlspace_mcp/tools/notebooks.py +174 -0
  44. mlspace_mcp/tools/queues.py +202 -0
  45. mlspace_mcp/tools/resources.py +86 -0
  46. mlspace_mcp/tools/tensorboards.py +112 -0
  47. mlspace_mcp/tools/workspaces.py +92 -0
  48. mlspace_mcp/workspace_context.py +107 -0
  49. mlspace_plugin-0.2.1.dist-info/METADATA +427 -0
  50. mlspace_plugin-0.2.1.dist-info/RECORD +53 -0
  51. mlspace_plugin-0.2.1.dist-info/WHEEL +4 -0
  52. mlspace_plugin-0.2.1.dist-info/entry_points.txt +2 -0
  53. mlspace_plugin-0.2.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: mlspace-diagnose-job-launch-rejection
3
+ description: "Diagnose a rejected job launch on Cloud.ru MLSpace. Why was my job submit refused (no job created): no quota vs no queue vs PAYG vs wrong name. Uses the mlspace_allocations, mlspace_queue_inspect, mlspace_resources, mlspace_workspaces tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Diagnose a rejected job launch
9
+
10
+ Why was my job submit refused (no job created): no quota vs no queue vs PAYG vs wrong name.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `region` — Region the submit targeted.
19
+ - `instance_type` — Instance type that was rejected.
20
+ - `allocation_name` — Allocation named in the error, if any.
21
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
22
+
23
+ ## Procedure
24
+
25
+ Goal: explain a rejected POST /jobs when no job was created. Read actions only.
26
+ 1. Preserve the submitted target, region, instance_type and provider error. Distinguish
27
+ regional type mismatch, allocation eligibility, queue configuration and visibility;
28
+ do not cycle through types or submit a paid probe to infer quota.
29
+ 2. workspaces allocations in that target -> observed allocation IDs and region_key.
30
+ workspaces allocation_queues for the relevant allocation. Empty queues are ambiguous
31
+ (feature disabled, wrong ID, no visible queues); they do not prove GPU unavailable.
32
+ 3. allocations get and allocations list_instance_types where accessible. Report actual
33
+ resources_status/instance-type observations. Zero visible nodes or a 403/405 is not
34
+ complete evidence about PAYG eligibility, all hardware or all workspace capacity.
35
+ 4. mlspace_resources configs (cluster_type=MT) -> compare the requested region key and
36
+ instance_type against the actual regional catalogue and compatible images.
37
+ 5. For a known queue, mlspace_queue_inspect(queue_id, target) -> queue membership,
38
+ pending demand across priorities, observable workloads and candidate node load.
39
+ Keep failures and incomplete cross-workspace visibility explicit.
40
+ Output: the provider rejection, supporting observations, unresolved checks and next
41
+ step. A missing allocation/queue association may require the workspace owner/admin;
42
+ name the exact association to verify. Catalog presence does not prove launchability,
43
+ and a notebook is not an established GPU-job workaround without its own eligibility
44
+ and capacity evidence. Verify physical hardware from observed device facts, not labels.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: mlspace-diagnose-unhealthy-inference
3
+ description: "Diagnose an unhealthy inference service on Cloud.ru MLSpace. Why is my deployed model returning 5xx / unhealthy (status-level only). Uses the mlspace_inference tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Diagnose an unhealthy inference service
9
+
10
+ Why is my deployed model returning 5xx / unhealthy (status-level only).
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `service_name` **(required)** — Inference service name.
19
+ - `region` — Service region, if known.
20
+ - `stop_billing` — If true, suggest scaling replicas to 0.
21
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
22
+
23
+ ## Procedure
24
+
25
+ Goal: diagnose an unhealthy / 5xx inference service — to the level the API allows.
26
+ 1. Resolve service+region: if region empty, mlspace_inference list and match
27
+ metadata.name == service_name.
28
+ 2. mlspace_inference get (inference_name, region) -> K8S manifest.
29
+ 3. Read status.conditions[]: the Ready condition + *Ready (Predictor/Routes/Ingress/
30
+ LatestDeployment). Report which are False and their messages.
31
+ 4. Read spec replicas.min/max (defaults min=0, max=3); if min=0 and 0 ready, the service
32
+ may be scaled to zero (cold) — that explains 503s on first hit.
33
+ 5. (optional, opt-in, PAID) only if the user wants to reproduce: inference predict with a
34
+ minimal payload to capture the live error.
35
+ Output: identity/placement, the failing conditions + messages, replica readiness, and the
36
+ most likely cause at status level.
37
+ HARD CEILING — say this plainly: inference exposes NO pod logs, NO events, NO container
38
+ status. Crash-loop / OOM / image-pull / app-level 5xx CANNOT be seen here; hand off to the
39
+ MLSpace console for pod logs. (Only jobs have logs/pods.)
40
+ If stop_billing=true and min>0: suggest inference update to scale replicas to 0 (a write).
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: mlspace-discover-launchable-resources
3
+ description: "Discover what you can launch on Cloud.ru MLSpace. Valid instance types, base images and free GPUs in a region before launching. Uses the mlspace_allocations, mlspace_docker_registry, mlspace_queue_inspect, mlspace_resources, mlspace_workspaces tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Discover what you can launch
9
+
10
+ Valid instance types, base images and free GPUs in a region before launching.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `region` — Target region.
19
+ - `cluster_type` — MT (jobs/notebooks) or INF (inference).
20
+ - `allocation_id` — Allocation id, if known; access varies by endpoint.
21
+ - `include_custom_images` — Also list registry images.
22
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
23
+
24
+ ## Procedure
25
+
26
+ Goal: list compatible instance types/images and observed capacity before launching.
27
+ 1. mlspace_resources configs (cluster_type=MT for jobs/notebooks; INF for inference).
28
+ Use the target region's actual instances_types keys, resource limits and
29
+ datahub_images/custom_images. Include zero-GPU cpu.* types. An empty images list
30
+ does not establish a compatible pairing; do not recommend an arbitrary image.
31
+ 2. mlspace_resources nodes and mlspace_resources nodes_load for observable regional
32
+ node/load facts. Available GPU readings are point-in-time and do not guarantee
33
+ scheduling or idle nodes across workspaces. Missing readings remain unknown.
34
+ 3. workspaces allocations in the selected target; if an allocation_id is available,
35
+ allocations get/get_nodes/list_instance_types for additional observed facts.
36
+ Report success/403/405/empty results per endpoint. Do not infer allocation access
37
+ categorically from service-account vs personal credentials.
38
+ 4. For a known queue, mlspace_queue_inspect(queue_id, target) examines candidate node
39
+ facts, job/notebook/pod observations and pending priorities across selected observations.
40
+ Keep paused notebooks visible; their configured GPUs are not active consumption.
41
+ Do not sum shared views or claim complete cross-workspace coverage.
42
+ 5. Optionally docker_registry current_registry -> list_repos -> list_tags for images.
43
+ Output: catalogue compatibility, observed capacity, actual scope/time and unresolved
44
+ eligibility or visibility. PAYG may reject a catalogue-valid type; read-only inspection
45
+ cannot promise a successful launch.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: mlspace-launch-training-job
3
+ description: "Launch a training job on Cloud.ru MLSpace. Start/submit a training job (resolves instance type + base image). Write action. Uses the mlspace_jobs, mlspace_resources tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Launch a training job
9
+
10
+ Start/submit a training job (resolves instance type + base image). Write action.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `script` **(required)** — Entrypoint: binary command/executable or NFS script path.
19
+ - `region` **(required)** — Target region; required for every job type.
20
+ - `gpus` — GPU count for the instance type; use 0 for CPU-only.
21
+ - `image_hint` — Base image keyword, e.g. pytorch.
22
+ - `job_type` — JobType; binary accepts a command/executable path.
23
+ - `n_workers` — Number of worker nodes.
24
+ - `queue_name` — Queue to schedule in.
25
+ - `extra_body` — JSON of extra RunJobRequest fields.
26
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
27
+
28
+ ## Procedure
29
+
30
+ Goal: submit a training job (jobs.run is a write action; refused if the server
31
+ runs with MLSPACE_READONLY=true).
32
+ PRECONDITION (critical, easy to miss): `region` must be explicit. Interpret `script`
33
+ according to `type`. For type=binary it is a non-empty command or executable path
34
+ (for example `ls -lah` or `python /home/jovyan/launch.py -f script.py`) and is forwarded
35
+ unchanged; do not force it under /home/jovyan. Verify that the command/executable exists
36
+ in the selected image. For other job types, `script` must already exist on that same
37
+ region's NFS under /home/jovyan (e.g. /home/jovyan/proj/train.py). `/home/jovyan` is
38
+ region-scoped: an SR006 notebook and an A100-MT job can see different contents at the
39
+ same path. The Public API has no remote stat operation, so the MCP cannot prove NFS
40
+ existence. If set, checkpoint_dir/logs_dir must use that same regional NFS.
41
+ 1. Parse: script/command, explicit region from the actual MT catalogue,
42
+ GPU count, image hint, job type (default
43
+ binary; pytorch/torchrun/etc), n_workers. `gpus=0` means a CPU-only job.
44
+ 2. mlspace_resources configs cluster_type=MT. Pick regions[].key == target region.
45
+ 3. instance_type: among that region's instances_types[], pick by GPU count — for
46
+ gpus>0 the one whose resource.limits['nvidia.com/gpu'] equals it; for gpus=0 a
47
+ `cpu.*` type, where that limit is null or absent (it is a nullable STRING, so
48
+ compare loosely). Use its `key`. Require a non-empty compatible `images` list;
49
+ catalog presence alone does not prove PAYG/allocation eligibility.
50
+ 4. base_image: filter the region's datahub_images/custom_images by the hint on .name;
51
+ combine name + tag into the "name:tag" string. (Do NOT read instances_types[].images
52
+ for this — the wrapper collapses those into pre-joined "name:tag1,tag2" reference
53
+ strings; use them only to check WHICH images an instance type supports.)
54
+ 5. (optional) queue_name/allocation_name are free-form strings; pass verbatim.
55
+ max_retry is only supported inside allocations; omit it for PAYG jobs.
56
+ 6. Build RunJobRequest: {script, base_image, instance_type, region, type, n_workers,
57
+ plus any extra_body}. ECHO it and the relevant entrypoint evidence (binary command
58
+ available in the image, or NFS script staged in that exact region) to the user for
59
+ confirmation before submitting.
60
+ 7. jobs run (body=...). Capture job_name.
61
+ 8. Verify: jobs get (job_name) for initial status; jobs logs (tail=50) for first output.
62
+ Re-run shortcut: jobs restart (body={job_name}) to repeat an existing job.
63
+ Caveat: this spends compute. Confirm the resolved body with the user first. A valid
64
+ /home/jovyan prefix is necessary but not sufficient for NFS entrypoints: wrong-region
65
+ NFS fails fast and still burns startup capacity. Use the returned resource_ref for subsequent reads; report command/NFS availability
66
+ as unverified when no execution-environment evidence is available.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: mlspace-list-running-jobs
3
+ description: "List running / pending jobs on Cloud.ru MLSpace. What's the status of my jobs / what's running or pending. Uses the mlspace_jobs, mlspace_jobs_overview tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # List running / pending jobs
9
+
10
+ What's the status of my jobs / what's running or pending.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `region` — Region to scope to (omit to sweep all).
19
+ - `status_filter` — Comma statuses, default Running,Pending.
20
+ - `job_author` — Author email to filter by.
21
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
22
+
23
+ ## Procedure
24
+
25
+ Goal: show in-flight / recent jobs over the requested connected contexts.
26
+ 1. Use mlspace_jobs_overview(targets=explicit_scope_or_omitted,
27
+ status=["Running","Pending"], author=explicit_author_or_omitted). Parse status_filter
28
+ if supplied; author is a user filter, not proof of identity. The helper discovers
29
+ each workspace's actual MT regions and paginates them; no fixed region list.
30
+ 2. If region was requested, filter observed rows by provenance.region and label that scope.
31
+ The helper has no region argument. For a narrow provider-side region query use jobs
32
+ list with target, region, status and job_author, advancing offset through all pages.
33
+ 3. Read items as {source, data, provenance, resource_ref?}. Show workspace, region,
34
+ job_name, status, job_author and time when returned; retain the exact resource_ref.
35
+ 4. Sort Running before Pending. State actual checked scope, failures and truncation;
36
+ observed counts from a partial read are not full totals or proof of a unique name.
37
+ 5. Use jobs get/logs on a chosen object's reference for follow-up, without another sweep.
38
+ Example tool call (omit targets for the full connected set):
39
+ ```json
40
+ {"tool":"mlspace_jobs_overview","arguments":{"status":["Running","Pending"]}}
41
+ ```
42
+ Output: compact observed status board with source and completeness. States are
43
+ observations over time, not a transactional snapshot.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: mlspace-resume-notebook-and-set-autoshutdown
3
+ description: "Resume a notebook + set autoshutdown on Cloud.ru MLSpace. Wake a paused Jupyter notebook and set idle autoshutdown to control cost. Write action. Uses the mlspace_notebooks, mlspace_notebooks_overview tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Resume a notebook + set autoshutdown
9
+
10
+ Wake a paused Jupyter notebook and set idle autoshutdown to control cost. Write action.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `notebook_name` **(required)** — Notebook to resume.
19
+ - `idle_minutes` — Idle minutes before autoshutdown.
20
+ - `workspace_id` — Workspace for the autoshutdown rule.
21
+ - `instance_type` — Override instance type on resume.
22
+ - `region` — Override region on resume.
23
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
24
+
25
+ ## Procedure
26
+
27
+ Goal: resume a paused Jupyter notebook and set workspace autoshutdown (write
28
+ actions; refused under MLSPACE_READONLY=true).
29
+ 1. For an unlocated notebook use mlspace_notebooks_overview and match data.name;
30
+ retain source/resource_ref and data.uid (not id). For a known target use
31
+ mlspace_notebooks list with search=notebook_name and paginate; resolve ambiguity.
32
+ 2. If already running/resuming/creating -> skip resume, report state.
33
+ 3. mlspace_notebooks resume using resource_ref (or target, namespace, notebook_uuid=uid)
34
+ and body={region, instance_type} from the chosen notebook unless overridden.
35
+ Check the returned instanceType: the API may retain the previous size on resume.
36
+ 4. Use the chosen notebook's context for workspace_id (auto-filled from target).
37
+ If an explicit workspace_id disagrees, resolve that conflict before changing rules.
38
+ autoshutdown is WORKSPACE-WIDE; tell the user it affects all notebooks there.
39
+ 5. mlspace_notebooks autoshutdown_get (workspace_id) to show the current rule.
40
+ 6. mlspace_notebooks autoshutdown_set (workspace_id, body = AutoShutdownV2Config:
41
+ nested {by_timer:{...}, by_load:{...}, by_schedule:{...}}; for an idle timer set
42
+ by_timer with the timeout — read the action's body hint for the exact fields).
43
+ Output: resume result + the autoshutdown rule set + the workspace-wide warning.
44
+ Caveat: autoshutdown is per-workspace, not per-notebook.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: mlspace-stage-s3-to-nfs
3
+ description: "Stage S3 data to NFS (one-off or nightly) on Cloud.ru MLSpace. Copy/sync S3 -> NFS for a GPU job, optionally on a schedule. Write action. Uses the mlspace_data_transfer tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Stage S3 data to NFS (one-off or nightly)
9
+
10
+ Copy/sync S3 -> NFS for a GPU job, optionally on a schedule. Write action.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `source_hint` — Which S3 connector/bucket.
19
+ - `destination_hint` — Which NFS/cluster connector.
20
+ - `source_path` — Path within the source.
21
+ - `destination_path` — Path within the NFS share.
22
+ - `schedule` — Crontab for nightly runs, e.g. '0 2 * * *'.
23
+ - `transfer_name` — Name for the transfer.
24
+ - `cluster_name` — Target cluster name (required, not auto-derivable).
25
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
26
+
27
+ ## Procedure
28
+
29
+ Goal: copy/sync S3 -> NFS, optionally on a nightly schedule (write actions;
30
+ refused under MLSPACE_READONLY=true).
31
+ 1. data_transfer list_connectors. SOURCE: an object-storage connector (s3amazon/
32
+ s3custom/s3google). DEST: an NFS/cluster connector. Capture both connector ids.
33
+ 2. cluster_name is REQUIRED and is NOT readable from the connector — ask the user or
34
+ take it from context; do not guess from get_connector.
35
+ 3. (optional, S3 only) try_connector to pre-check connectivity (+ its /try/logs).
36
+ 4. Ensure source_path + destination_path are known (ask if absent). Strategy:
37
+ one-off=write_all; nightly incremental + a crontab schedule (e.g. "0 2 * * *").
38
+ 5. list_transfers; if one matches this source->dest and the user means "edit", capture
39
+ its id for update instead of create.
40
+ 6. create_transfer (body=TransferInputViewModelV5: name, connector ids, paths,
41
+ cluster_name, strategy, optional crontab) OR update_transfer(id_, full body).
42
+ To just enable/disable: switch_transfer(id_, body={"active": true|false}).
43
+ 7. Verify: list_history(transfer_id) -> latest run id + status; get_history_status.
44
+ Output: which connectors were used, the created/updated transfer id + schedule, and the
45
+ first run's status. Echo the body before writing. Caveat: cluster_name must be supplied.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: mlspace-transfer-compute-node
3
+ description: "Inspect and transfer a compute node between queues on Cloud.ru MLSpace. Check shared workload before recommending or moving a compute node. Write only on request. Uses the mlspace_contexts, mlspace_notebooks, mlspace_queue_inspect, mlspace_queues tools."
4
+ license: MIT
5
+ compatibility: Requires the `mlspace` MCP server from this plugin (Cloud.ru MLSpace credentials needed).
6
+ ---
7
+
8
+ # Inspect and transfer a compute node between queues
9
+
10
+ Check shared workload before recommending or moving a compute node. Write only on request.
11
+
12
+ This skill drives the `mlspace` MCP server shipped in the same plugin. If its
13
+ tools are not connected, say so instead of guessing — none of these steps can be
14
+ carried out any other way.
15
+
16
+ ## Arguments
17
+
18
+ - `source_queue_id` **(required)** — Source queue ID.
19
+ - `destination_queue_id` — Destination queue ID.
20
+ - `destination_target` — Destination connected workspace ID or unambiguous name.
21
+ - `node_name` — Compute node name; omit to inspect source candidates.
22
+ - `target` — Connected workspace ID or unambiguous name, if scoped.
23
+
24
+ ## Procedure
25
+
26
+ Goal: inspect and, when requested, move a COMPUTE NODE between queues. A Jupyter
27
+ server is a workload, not the node to move. Never substitute notebooks pause/modify.
28
+ 1. Resolve the source queue_id/target and destination_queue_id/destination_target
29
+ within mlspace_contexts. If placement is delegated, compare eligible destinations
30
+ and report the choice without another workspace question.
31
+ 2. mlspace_queue_inspect(queue_id=source_queue_id, target=target,
32
+ candidate_nodes=[node_name]) (omit candidate_nodes to inspect source queue nodes).
33
+ Leave targets omitted to inspect the fixed selected set, unless the user explicitly
34
+ restricts observation. Examine checked_scope/failures/complete, queue/allocation
35
+ association, candidate membership, allocation node facts and node loads alongside
36
+ jobs/notebooks/pods and all pending priorities. Pending is demand, not running load;
37
+ paused notebook configuration alone is not capacity that can be freed.
38
+ 3. mlspace_queues get (queue_id=destination_queue_id, target=destination_target) and
39
+ mlspace_queues instance_types (queue_id=destination_queue_id,
40
+ target=destination_target) to check the destination/allocation compatibility.
41
+ Match concrete identities; a friendly workspace name or request context does not
42
+ establish owner identity. Repeated shared views cannot be summed.
43
+ 4. Report candidates, observed competing workload, freshness, failed/unread scopes
44
+ and unknown cross_workspace_coverage. Even complete=true does not prove all shared
45
+ workload is visible. If visibility is incomplete, do not call the move impact-free;
46
+ explain the remaining check before recommending a candidate as idle.
47
+ 5. If the user requested execution and placement/node are resolved, use supported
48
+ mlspace_queues add_nodes (target=destination_target, queue_id=destination_queue_id,
49
+ body={"nodes":[node_name], "force_withdrawal":false}). Follow the action's existing
50
+ write/confirm rules; never add a new mandatory workspace confirmation. Do not
51
+ silently escalate force_withdrawal on refusal; explain its consequences and use it
52
+ only when forced withdrawal was explicitly authorized. There is no remove_nodes
53
+ action to invent. Provider acceptance remains subject to queue/allocation policy.
54
+ Example calls (replace these illustrative IDs with resolved addresses):
55
+ ```json
56
+ {"tool":"mlspace_queue_inspect","arguments":{"queue_id":"source-queue","target":"workspace-a","candidate_nodes":["node-a"]}}
57
+ ```
58
+ ```json
59
+ {"tool":"mlspace_queues","arguments":{"action":"add_nodes","target":"workspace-b","queue_id":"destination-queue","body":{"nodes":["node-a"],"force_withdrawal":false}}}
60
+ ```
61
+ 6. Read source and destination queue membership and relevant node loads again. Report
62
+ actual results and unresolved impact; HTTP success alone does not prove idle load
63
+ or uninterrupted workloads. For an inspection-only request, stop before add_nodes.