plugin-cluster-manager 1.1.5 → 1.1.7
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.
- package/README.md +17 -5
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +5 -5
- package/dist/locale/en-US.json +28 -4
- package/dist/locale/vi-VN.json +28 -4
- package/dist/locale/zh-CN.json +28 -4
- package/dist/server/actions/event-queue-monitor.js +123 -1
- package/dist/server/actions/orchestrator.js +1 -1
- package/dist/server/actions/plugin-operations.js +171 -0
- package/dist/server/collections/cluster-manager-plugins.js +44 -0
- package/dist/server/plugin.js +8 -2
- package/package.json +9 -4
- package/src/client/ClusterManagerLayout.tsx +16 -10
- package/src/client/EventQueueMonitor.tsx +349 -202
- package/src/client/PluginOperations.tsx +234 -0
- package/src/locale/en-US.json +28 -4
- package/src/locale/vi-VN.json +28 -4
- package/src/locale/zh-CN.json +28 -4
- package/src/server/actions/event-queue-monitor.ts +234 -95
- package/src/server/actions/orchestrator.ts +1 -1
- package/src/server/actions/plugin-operations.ts +151 -0
- package/src/server/collections/cluster-manager-plugins.ts +19 -0
- package/src/server/orchestrator/PackageManager.ts +84 -17
- package/src/server/plugin.ts +28 -20
- package/dist/client/AclCacheManager.d.ts +0 -2
- package/dist/client/CacheMonitor.d.ts +0 -2
- package/dist/client/ClusterManagerLayout.d.ts +0 -2
- package/dist/client/ClusterNodes.d.ts +0 -2
- package/dist/client/ContainerOrchestrator.d.ts +0 -2
- package/dist/client/EventQueueMonitor.d.ts +0 -2
- package/dist/client/LockMonitor.d.ts +0 -2
- package/dist/client/PackageInstaller.d.ts +0 -2
- package/dist/client/RedisMonitor.d.ts +0 -2
- package/dist/client/TaskManager.d.ts +0 -2
- package/dist/client/WorkflowExecutions.d.ts +0 -2
- package/dist/client/index.d.ts +0 -5
- package/dist/client/utils.d.ts +0 -12
- package/dist/index.d.ts +0 -2
- package/dist/server/actions/acl-cache.d.ts +0 -53
- package/dist/server/actions/cache-monitor.d.ts +0 -23
- package/dist/server/actions/cluster-nodes.d.ts +0 -49
- package/dist/server/actions/event-queue-monitor.d.ts +0 -13
- package/dist/server/actions/lock-monitor.d.ts +0 -19
- package/dist/server/actions/orchestrator.d.ts +0 -58
- package/dist/server/actions/package-manager.d.ts +0 -6
- package/dist/server/actions/redis-monitor.d.ts +0 -12
- package/dist/server/actions/tasks.d.ts +0 -7
- package/dist/server/actions/workflow-executions.d.ts +0 -7
- package/dist/server/adapters/redis-lock-adapter.d.ts +0 -15
- package/dist/server/adapters/redis-node-registry.d.ts +0 -12
- package/dist/server/adapters/redis-pubsub-adapter.d.ts +0 -16
- package/dist/server/collections/app.d.ts +0 -8
- package/dist/server/collections/cluster-manager-acl-cache.d.ts +0 -22
- package/dist/server/collections/cluster-manager-cache-mgr.d.ts +0 -22
- package/dist/server/collections/cluster-manager-cluster.d.ts +0 -22
- package/dist/server/collections/cluster-manager-lock.d.ts +0 -22
- package/dist/server/collections/cluster-manager-queue.d.ts +0 -22
- package/dist/server/collections/cluster-manager-redis.d.ts +0 -22
- package/dist/server/collections/cluster-manager-workflow.d.ts +0 -22
- package/dist/server/collections/cluster-manager.d.ts +0 -22
- package/dist/server/collections/orchestrator-settings.d.ts +0 -59
- package/dist/server/collections/orchestrator-stacks.d.ts +0 -102
- package/dist/server/collections/worker-orchestrator.d.ts +0 -22
- package/dist/server/collections/worker-packages-configs.d.ts +0 -3
- package/dist/server/collections/worker-packages.d.ts +0 -22
- package/dist/server/index.d.ts +0 -1
- package/dist/server/orchestrator/PackageManager.d.ts +0 -37
- package/dist/server/orchestrator/docker-adapter.d.ts +0 -41
- package/dist/server/orchestrator/index.d.ts +0 -4
- package/dist/server/orchestrator/k8s-adapter.d.ts +0 -50
- package/dist/server/orchestrator/leader-election.d.ts +0 -48
- package/dist/server/orchestrator/types.d.ts +0 -84
- package/dist/server/plugin.d.ts +0 -26
- package/dist/server/utils/node.d.ts +0 -6
- package/dist/server/utils/redis.d.ts +0 -29
- package/dist/shared/packages.d.ts +0 -23
package/dist/server/plugin.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@nocobase/server';
|
|
2
|
-
import { RedisNodeRegistry } from './adapters/redis-node-registry';
|
|
3
|
-
import type { IOrchestratorAdapter } from './orchestrator/types';
|
|
4
|
-
import { LeaderElection } from './orchestrator/leader-election';
|
|
5
|
-
export declare class PluginClusterManagerServer extends Plugin {
|
|
6
|
-
nodeRegistry: RedisNodeRegistry;
|
|
7
|
-
orchestrator: IOrchestratorAdapter | null;
|
|
8
|
-
leaderElection: LeaderElection | null;
|
|
9
|
-
beforeLoad(): Promise<void>;
|
|
10
|
-
load(): Promise<void>;
|
|
11
|
-
private registerPubSubAdapter;
|
|
12
|
-
/**
|
|
13
|
-
* Initialize the Container Orchestrator subsystem.
|
|
14
|
-
* Config is loaded from DB (orchestratorSettings collection) first,
|
|
15
|
-
* then falls back to ORCHESTRATOR_ADAPTER env var.
|
|
16
|
-
* This allows manual configuration via the NocoBase admin UI.
|
|
17
|
-
*/
|
|
18
|
-
private initOrchestrator;
|
|
19
|
-
/**
|
|
20
|
-
* Connect (or reconnect) the orchestrator adapter based on settings.
|
|
21
|
-
* Can be called at startup or when user saves new settings via UI.
|
|
22
|
-
*/
|
|
23
|
-
connectAdapter(settings: any): Promise<boolean>;
|
|
24
|
-
private isWorkerOnlyNode;
|
|
25
|
-
}
|
|
26
|
-
export default PluginClusterManagerServer;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate a universally unique identifier for this specific Node.js process.
|
|
3
|
-
* Combines app name, worker mode, hostname, port, and PID to ensure uniqueness
|
|
4
|
-
* even when multiple workers run on the exact same host.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getLocalNodeId(app: any): string;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Context } from '@nocobase/actions';
|
|
2
|
-
export declare function getRedisClient(app?: any): any;
|
|
3
|
-
/**
|
|
4
|
-
* Get the shared Redis connection from the app's connection manager.
|
|
5
|
-
* Returns undefined if Redis is not configured.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getRedis(ctx: Context): any;
|
|
8
|
-
/**
|
|
9
|
-
* Get Redis connection or throw 503 if not available.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getRedisOrThrow(ctx: Context): any;
|
|
12
|
-
/**
|
|
13
|
-
* Scan Redis keys using SCAN (cursor-based) instead of the blocking KEYS command.
|
|
14
|
-
* Safe for production use — never blocks the Redis event loop.
|
|
15
|
-
*
|
|
16
|
-
* @param redis - Redis client instance
|
|
17
|
-
* @param pattern - Glob pattern to match keys (e.g. "acl:can:*")
|
|
18
|
-
* @param batchSize - Number of keys to scan per iteration (default 200)
|
|
19
|
-
*/
|
|
20
|
-
export declare function scanKeys(redis: any, pattern: string, batchSize?: number): Promise<string[]>;
|
|
21
|
-
/**
|
|
22
|
-
* Delete keys in chunked batches to avoid exceeding Redis command argument limits.
|
|
23
|
-
*
|
|
24
|
-
* @param redis - Redis client instance
|
|
25
|
-
* @param keys - Array of keys to delete
|
|
26
|
-
* @param chunkSize - Max keys per DEL command (default 500)
|
|
27
|
-
* @returns Total number of keys deleted
|
|
28
|
-
*/
|
|
29
|
-
export declare function deleteKeysChunked(redis: any, keys: string[], chunkSize?: number): Promise<number>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_WORKER_PACKAGES: {
|
|
2
|
-
apt: string[];
|
|
3
|
-
python: string[];
|
|
4
|
-
npm: string[];
|
|
5
|
-
};
|
|
6
|
-
export interface WorkerPackageMap {
|
|
7
|
-
apt?: string[];
|
|
8
|
-
npm?: string[];
|
|
9
|
-
python?: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface CustomPackageMap {
|
|
12
|
-
python?: string[];
|
|
13
|
-
node?: string[];
|
|
14
|
-
npm?: string[];
|
|
15
|
-
}
|
|
16
|
-
export declare function normalizePackages(packages?: Array<string | undefined>): string[];
|
|
17
|
-
export declare function parsePackageText(value: unknown, fallback?: string[]): string[];
|
|
18
|
-
export declare function formatPackageText(packages?: string[]): string;
|
|
19
|
-
export declare function packagesFromConfig(config: {
|
|
20
|
-
aptPackages?: unknown;
|
|
21
|
-
pythonPackages?: unknown;
|
|
22
|
-
npmPackages?: unknown;
|
|
23
|
-
}): WorkerPackageMap;
|