refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
(() => {
|
|
|
|
|
const CONTROL_ID = 'myelin-fleet-control';
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
const selectedJobs = new Map();
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
|
|
|
|
|
async function syncControl() {
|
|
|
|
|
const nodeView = document.querySelector('.node-view[data-node]');
|
|
|
|
|
if (!nodeView) return;
|
|
|
|
|
const rawNodeId = nodeView.getAttribute('data-node') || '';
|
|
|
|
|
if (!/^\d+$/.test(rawNodeId)) return;
|
|
|
|
|
const logicalNodeId = Number(rawNodeId);
|
|
|
|
|
|
|
|
|
|
let model;
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch('/api/control/status', { cache: 'no-store' });
|
|
|
|
|
if (!response.ok) return;
|
|
|
|
|
const payload = await response.json();
|
|
|
|
|
model = payload.Status;
|
|
|
|
|
} catch (_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const node = model?.nodes?.find(candidate => candidate.logical_node_id === logicalNodeId);
|
|
|
|
|
if (!node) return;
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
let job = { state: 'idle', message: 'No job submitted' };
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch(`/api/control/nodes/${logicalNodeId}/job`, { cache: 'no-store' });
|
|
|
|
|
if (response.ok) job = await response.json();
|
|
|
|
|
} catch (_) {}
|
|
|
|
|
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
const heading = nodeView.querySelector('section.panel > h2');
|
|
|
|
|
if (!heading) return;
|
|
|
|
|
let control = document.getElementById(CONTROL_ID);
|
|
|
|
|
if (!control) {
|
|
|
|
|
control = document.createElement('div');
|
|
|
|
|
control.id = CONTROL_ID;
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
control.style.cssText = 'display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 12px';
|
|
|
|
|
|
|
|
|
|
const fileInput = document.createElement('input');
|
|
|
|
|
fileInput.type = 'file';
|
|
|
|
|
fileInput.accept = '.toml,text/plain,application/toml';
|
|
|
|
|
fileInput.dataset.jobFile = '';
|
|
|
|
|
fileInput.style.cssText = 'max-width:260px;color:var(--muted);font:12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace';
|
|
|
|
|
|
|
|
|
|
const jobButton = document.createElement('button');
|
|
|
|
|
jobButton.type = 'button';
|
|
|
|
|
jobButton.dataset.action = 'job';
|
|
|
|
|
jobButton.textContent = 'Submit job';
|
|
|
|
|
jobButton.style.cssText = 'border:1px solid #5cd5ff;background:transparent;color:#5cd5ff;border-radius:3px;padding:6px 10px;font:600 12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer';
|
|
|
|
|
|
|
|
|
|
const killButton = document.createElement('button');
|
|
|
|
|
killButton.type = 'button';
|
|
|
|
|
killButton.dataset.action = 'kill';
|
|
|
|
|
killButton.style.cssText = 'border:1px solid #ef4444;background:transparent;color:#ef4444;border-radius:3px;padding:6px 10px;font:600 12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer';
|
|
|
|
|
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
const message = document.createElement('span');
|
|
|
|
|
message.dataset.message = '';
|
|
|
|
|
message.style.cssText = 'font:12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--muted)';
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
|
|
|
|
|
control.append(fileInput, jobButton, killButton, message);
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
heading.after(control);
|
|
|
|
|
}
|
|
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
const fileInput = control.querySelector('[data-job-file]');
|
|
|
|
|
const jobButton = control.querySelector('[data-action="job"]');
|
|
|
|
|
const killButton = control.querySelector('[data-action="kill"]');
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
const message = control.querySelector('[data-message]');
|
|
|
|
|
const terminal = node.phase === 'stopped' || node.phase === 'orphan';
|
|
|
|
|
const pending = node.phase === 'kill_requested' || node.phase === 'stopping';
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
const jobReady = node.phase === 'running' && Boolean(node.runtime?.job_actor);
|
|
|
|
|
const jobActive = job.state === 'started' || job.state === 'running';
|
|
|
|
|
const selectedJob = selectedJobs.get(logicalNodeId);
|
|
|
|
|
|
|
|
|
|
fileInput.hidden = !jobReady;
|
|
|
|
|
jobButton.hidden = !jobReady;
|
|
|
|
|
jobButton.disabled = jobActive || !selectedJob;
|
|
|
|
|
jobButton.textContent = jobActive ? 'Job active' : 'Submit job';
|
|
|
|
|
killButton.hidden = terminal;
|
|
|
|
|
killButton.disabled = pending;
|
|
|
|
|
killButton.textContent = pending ? 'Kill requested' : 'Kill';
|
|
|
|
|
killButton.style.opacity = pending ? '.55' : '1';
|
|
|
|
|
|
|
|
|
|
if (job.state !== 'idle') {
|
|
|
|
|
message.textContent = job.message;
|
|
|
|
|
} else if (selectedJob) {
|
|
|
|
|
message.textContent = `Selected ${selectedJob.name}`;
|
|
|
|
|
} else if (terminal) {
|
|
|
|
|
message.textContent = `managed node ${logicalNodeId}: ${node.phase}`;
|
|
|
|
|
} else {
|
|
|
|
|
message.textContent = 'Select a job TOML file';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fileInput.onchange = async () => {
|
|
|
|
|
const file = fileInput.files?.[0];
|
|
|
|
|
if (!file) {
|
|
|
|
|
selectedJobs.delete(logicalNodeId);
|
|
|
|
|
jobButton.disabled = true;
|
|
|
|
|
message.textContent = 'Select a job TOML file';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
const text = await file.text();
|
|
|
|
|
selectedJobs.set(logicalNodeId, { name: file.name, text });
|
|
|
|
|
jobButton.disabled = jobActive;
|
|
|
|
|
message.textContent = `Selected ${file.name}`;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
selectedJobs.delete(logicalNodeId);
|
|
|
|
|
jobButton.disabled = true;
|
|
|
|
|
message.textContent = `Could not read job file: ${error.message}`;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
jobButton.onclick = async () => {
|
|
|
|
|
const selected = selectedJobs.get(logicalNodeId);
|
|
|
|
|
if (!selected) return;
|
|
|
|
|
jobButton.disabled = true;
|
|
|
|
|
message.textContent = 'Submitting job…';
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch(`/api/control/nodes/${logicalNodeId}/job`, {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'content-type': 'application/toml; charset=utf-8' },
|
|
|
|
|
body: selected.text,
|
|
|
|
|
});
|
|
|
|
|
const body = await response.json().catch(() => ({}));
|
|
|
|
|
if (!response.ok) throw new Error(body.error || `HTTP ${response.status}`);
|
|
|
|
|
message.textContent = body.message || 'Job started';
|
|
|
|
|
} catch (error) {
|
|
|
|
|
jobButton.disabled = false;
|
|
|
|
|
message.textContent = error.message;
|
|
|
|
|
}
|
|
|
|
|
};
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
killButton.onclick = async () => {
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
if (!window.confirm(`Kill managed node ${logicalNodeId}? Vast.ai contracts are destroyed and billing stops.`)) return;
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
killButton.disabled = true;
|
|
|
|
|
message.textContent = 'Submitting kill…';
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
const commandId = `fleet-kill-${globalThis.crypto?.randomUUID?.() || Date.now()}`;
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch(`/api/control/nodes/${logicalNodeId}/kill`, {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'content-type': 'application/json' },
|
|
|
|
|
body: JSON.stringify({ command_id: commandId }),
|
|
|
|
|
});
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
const body = await response.json().catch(() => ({}));
|
|
|
|
|
throw new Error(body.error || `HTTP ${response.status}`);
|
|
|
|
|
}
|
|
|
|
|
message.textContent = 'Kill accepted';
|
|
|
|
|
} catch (error) {
|
feat(myelin): add actor-backed job data plane and uploads
Replace the eventfd/ring job bootstrap with one inherited arena descriptor, actor-owned sessions, sealed blob leases, awaitable inbox wakeups, and zero-copy Python mappings. Route VastAI mock provisioning through image-backed local Docker workers and preserve pinned child and controller routes across directory updates.
Add TOML job-file submission to the Fleet UI with generic started, running, and completed feedback, reusable remote job controller routing, cancellation and kill invariants, Tinygrad fixture and image support, and comprehensive Rust, Python, CUDA, and lifecycle-ordering coverage.
2026-08-21 14:45:10 +00:00
|
|
|
killButton.disabled = false;
|
refactor(myelin): rework control and runtime integration
Add actor-backed manual node provisioning, control-plane endpoints, and fleet UI assets with durable provider lifecycle handling.
Simplify Myelin orchestration, node runtime, staging, and telemetry paths while removing obsolete engine-builder, dashboard-view, and local-mock implementations.
Align runtime delivery, data-plane, distribution, job-runner, process, telemetry, dashboard, Vast.ai integrations, and their tests with the revised actor and transport contracts.
2026-08-19 10:20:01 +00:00
|
|
|
message.textContent = error.message;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const page = document.getElementById('page');
|
|
|
|
|
if (page) new MutationObserver(syncControl).observe(page, { childList: true, subtree: true });
|
|
|
|
|
syncControl();
|
|
|
|
|
setInterval(syncControl, 1000);
|
|
|
|
|
})();
|