core: manage cluster through ui

This commit is contained in:
Koushik Dutta
2024-12-09 21:19:10 -08:00
parent 6173d67bb0
commit ff448e9c7f
3 changed files with 18 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ import { ConsoleServiceNativeId, PluginSocketService, ReplServiceNativeId } from
import { ScriptCore, ScriptCoreNativeId, newScript } from './script-core';
import { TerminalService, TerminalServiceNativeId } from './terminal-service';
import { UsersCore, UsersNativeId } from './user';
import { ClusterCore, ClusterCoreNativeId } from './cluster';
const { deviceManager, endpointManager } = sdk;
@@ -27,6 +28,7 @@ class ScryptedCore extends ScryptedDeviceBase implements HttpRequestHandler, Dev
publicRouter: any = Router();
mediaCore: MediaCore;
scriptCore: ScriptCore;
clusterCore: ClusterCore;
aggregateCore: AggregateCore;
automationCore: AutomationCore;
users: UsersCore;
@@ -102,6 +104,16 @@ class ScryptedCore extends ScryptedDeviceBase implements HttpRequestHandler, Dev
this.indexHtml = readFileAsString('dist/index.html');
(async () => {
await deviceManager.onDeviceDiscovered(
{
name: 'Cluster',
nativeId: ClusterCoreNativeId,
interfaces: [ScryptedInterface.Settings, ScryptedInterface.Readme],
type: ScryptedDeviceType.Builtin,
},
);
})();
(async () => {
await deviceManager.onDeviceDiscovered(
{
@@ -214,6 +226,8 @@ class ScryptedCore extends ScryptedDeviceBase implements HttpRequestHandler, Dev
}
async getDevice(nativeId: string) {
if (nativeId === ClusterCoreNativeId)
return this.clusterCore ||= new ClusterCore(ClusterCoreNativeId);
if (nativeId === 'launcher')
return new LauncherMixin('launcher');
if (nativeId === 'mediacore')

View File

@@ -97,9 +97,9 @@
],
"env": {
"SCRYPTED_CLUSTER_WORKER_NAME": "Macaroni 2",
"SCRYPTED_CLUSTER_LABELS": "@scrypted/coreml,compute",
"SCRYPTED_CLUSTER_LABELS": "@scrypted/coreml,compute,compute.preferred",
"SCRYPTED_CLUSTER_MODE": "client",
"SCRYPTED_CLUSTER_SERVER": "192.168.2.124",
"SCRYPTED_CLUSTER_SERVER": "192.168.2.130",
"SCRYPTED_CLUSTER_SECRET": "swordfish",
"SCRYPTED_CAN_RESTART": "true",
"SCRYPTED_VOLUME": "/Users/koush/.scrypted-cluster/volume-client",

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/server",
"version": "0.123.61",
"version": "0.123.62",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/server",
"version": "0.123.61",
"version": "0.123.62",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {