8 Commits

10 changed files with 4072 additions and 1761 deletions

33
changelog.md Normal file
View File

@ -0,0 +1,33 @@
# Changelog
## 2024-12-19 - 1.2.1 - fix(taskmanager)
Remove checkinSlackTask from SparkTaskManager for streamlined task management
- checkinSlackTask has been removed from the task manager class.
- Removal of the slack check-in task allows the system to focus on essential update tasks.
## 2024-12-18 - 1.2.0 - feat(core)
Initial commit of the Spark project with core functionalities for server management and integration with Docker.
- Add core functionalities for server maintenance and configuration.
- Integrate Docker for advanced task scheduling and service management.
- Provide CLI commands for daemon management and task execution.
## 2024-12-18 - 1.1.0 - feat(core)
Update package dependencies and improve API integration.
- Updated devDependencies and dependencies in package.json.
- Integrated new package @serve.zone/api.
- Updated identityArg in SparkLocalConfig for userHomeDir kvStore.
## 2024-06-13 - 1.0.85 to 1.0.90 - Core Updates
Routine updates and fixes to core functionality.
- Updated core component throughout versions for enhanced stability
- Incremental improvements applied on versions 1.0.85 to 1.0.90
## 2024-05-08 - 1.0.82 to 1.0.85 - Core Enhancements
Consistent updates made to improve core operations.
- Updates focused on core functionality for improved performance
- Series of updates applied from versions 1.0.82 to 1.0.85

View File

@ -5,7 +5,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "losslessone/services/initzone", "gitscope": "losslessone/services/initzone",
"gitrepo": "spark", "gitrepo": "spark",
"description": "A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure.", "description": "A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure and used by @serve.zone/cloudly as a cluster node server system manager.",
"npmPackagename": "@losslessone_private/spark", "npmPackagename": "@losslessone_private/spark",
"license": "MIT", "license": "MIT",
"projectDomain": "https://lossless.one", "projectDomain": "https://lossless.one",
@ -24,7 +24,11 @@
"task scheduling", "task scheduling",
"CLI", "CLI",
"logging", "logging",
"server maintenance" "server maintenance",
"serve.zone",
"cluster management",
"system manager",
"server configuration"
] ]
} }
}, },

View File

@ -1,8 +1,8 @@
{ {
"name": "@serve.zone/spark", "name": "@serve.zone/spark",
"version": "1.0.89", "version": "1.2.1",
"private": false, "private": false,
"description": "A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure.", "description": "A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure and used by @serve.zone/cloudly as a cluster node server system manager.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"author": "Task Venture Capital GmbH", "author": "Task Venture Capital GmbH",
@ -16,29 +16,30 @@
"spark": "./cli.js" "spark": "./cli.js"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.80", "@git.zone/tsbuild": "^2.2.0",
"@git.zone/tsrun": "^1.2.39", "@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.60", "@git.zone/tstest": "^1.0.60",
"@push.rocks/tapbundle": "^5.0.4", "@push.rocks/tapbundle": "^5.5.3",
"@types/node": "20.14.2" "@types/node": "22.10.2"
}, },
"dependencies": { "dependencies": {
"@apiclient.xyz/docker": "^1.2.2", "@apiclient.xyz/docker": "^1.2.7",
"@push.rocks/npmextra": "^5.0.17", "@push.rocks/npmextra": "^5.1.2",
"@push.rocks/projectinfo": "^5.0.1", "@push.rocks/projectinfo": "^5.0.1",
"@push.rocks/qenv": "^6.0.5", "@push.rocks/qenv": "^6.1.0",
"@push.rocks/smartcli": "^4.0.11", "@push.rocks/smartcli": "^4.0.11",
"@push.rocks/smartdaemon": "^2.0.3", "@push.rocks/smartdaemon": "^2.0.3",
"@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartfile": "^11.0.20", "@push.rocks/smartfile": "^11.0.23",
"@push.rocks/smartjson": "^5.0.20", "@push.rocks/smartjson": "^5.0.20",
"@push.rocks/smartlog": "^3.0.7", "@push.rocks/smartlog": "^3.0.7",
"@push.rocks/smartlog-destination-local": "^9.0.0", "@push.rocks/smartlog-destination-local": "^9.0.0",
"@push.rocks/smartpath": "^5.0.5", "@push.rocks/smartpath": "^5.0.5",
"@push.rocks/smartshell": "^3.0.5", "@push.rocks/smartshell": "^3.2.2",
"@push.rocks/smartupdate": "^2.0.4", "@push.rocks/smartupdate": "^2.0.4",
"@push.rocks/taskbuffer": "^3.0.10", "@push.rocks/taskbuffer": "^3.0.10",
"@serve.zone/interfaces": "^1.0.74" "@serve.zone/api": "^4.5.1",
"@serve.zone/interfaces": "^4.5.1"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@ -71,6 +72,10 @@
"task scheduling", "task scheduling",
"CLI", "CLI",
"logging", "logging",
"server maintenance" "server maintenance",
"serve.zone",
"cluster management",
"system manager",
"server configuration"
] ]
} }

5726
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
- this package is part of serve.zone and that spark's main purpose is the be used by @serve.zone/cloudly as a cluster node server system manager. - make sure to mention that this package is part of serve.zone and **spark's main purpose** is the be used by @serve.zone/cloudly as a cluster node server system manager.
- it is used to maintain and configure servers on the base OS level - it is used to maintain and configure servers on the base OS level

View File

@ -1,5 +1,5 @@
# @serve.zone/spark # @serve.zone/spark
A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure. A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the serve.zone infrastructure. It's mainly designed to be utilized by @serve.zone/cloudly as a cluster node server system manager, maintaining and configuring servers on the base OS level.
## Install ## Install
To install `@serve.zone/spark`, run the following command in your terminal: To install `@serve.zone/spark`, run the following command in your terminal:
@ -22,7 +22,7 @@ import { Spark } from '@serve.zone/spark';
``` ```
### Initializing Spark ### Initializing Spark
Create an instance of the `Spark` class to start using Spark. This instance will serve as the main entry point for interacting with the Spark functionalities. Create an instance of the `Spark` class to start using Spark. This instance will serve as the main entry point for interacting with Spark functionalities.
```typescript ```typescript
const sparkInstance = new Spark(); const sparkInstance = new Spark();
@ -45,7 +45,7 @@ await sparkInstance.sparkUpdateManager.updateServices();
``` ```
### Managing Configuration and Logging ### Managing Configuration and Logging
Spark allows for extensive configuration and logging customization. Use the `SparkLocalConfig` and logging features to tailor Spark's operation to your needs. Spark allows extensive configuration and logging customization. Use the `SparkLocalConfig` and logging features to tailor Spark's operation to your needs.
```typescript ```typescript
// Accessing the local configuration // Accessing the local configuration
@ -280,9 +280,6 @@ createDockerSecret();
This example shows how to create a Docker secret using Spark's `SparkUpdateManager` class, ensuring that sensitive information is securely stored and managed. This example shows how to create a Docker secret using Spark's `SparkUpdateManager` class, ensuring that sensitive information is securely stored and managed.
## Conclusion
`@serve.zone/spark` is a comprehensive toolkit for orchestrating and managing server environments and Docker-based services. By leveraging its CLI and programmatic interfaces, you can automate and streamline server operations, configurations, updates, and task scheduling, ensuring your infrastructure is responsive, updated, and maintained efficiently.
## License and Legal Information ## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.

View File

@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @push.rocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/spark', name: '@serve.zone/spark',
version: '1.0.89', version: '1.2.1',
description: 'A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure.' description: 'A comprehensive tool for maintaining and configuring servers, integrating with Docker and supporting advanced task scheduling, targeted at the Servezone infrastructure and used by @serve.zone/cloudly as a cluster node server system manager.'
} }

View File

@ -9,7 +9,7 @@ export class SparkLocalConfig {
this.sparkRef = sparkRefArg; this.sparkRef = sparkRefArg;
this.kvStore = new plugins.npmextra.KeyValueStore({ this.kvStore = new plugins.npmextra.KeyValueStore({
typeArg: 'userHomeDir', typeArg: 'userHomeDir',
identityArg: 'spark', identityArg: 'servezone_spark',
}); });
} }
} }

View File

@ -8,7 +8,6 @@ export class SparkTaskManager {
public taskmanager: plugins.taskbuffer.TaskManager; public taskmanager: plugins.taskbuffer.TaskManager;
// tasks // tasks
public checkinSlackTask: plugins.taskbuffer.Task;
public updateSpark: plugins.taskbuffer.Task; public updateSpark: plugins.taskbuffer.Task;
public updateHost: plugins.taskbuffer.Task; public updateHost: plugins.taskbuffer.Task;
public updateCloudly: plugins.taskbuffer.Task; public updateCloudly: plugins.taskbuffer.Task;
@ -17,16 +16,6 @@ export class SparkTaskManager {
this.sparkRef = sparkRefArg; this.sparkRef = sparkRefArg;
this.taskmanager = new plugins.taskbuffer.TaskManager(); this.taskmanager = new plugins.taskbuffer.TaskManager();
// checkinOnSlack
this.checkinSlackTask = new plugins.taskbuffer.Task({
name: 'checkinSlack',
taskFunction: async () => {
logger.log('ok', 'running hourly checkin now');
logger.log('info', 'completed hourly checkin');
},
});
// updateSpark // updateSpark
this.updateSpark = new plugins.taskbuffer.Task({ this.updateSpark = new plugins.taskbuffer.Task({
name: 'updateSpark', name: 'updateSpark',
@ -80,7 +69,6 @@ export class SparkTaskManager {
* start the taskmanager * start the taskmanager
*/ */
public async start() { public async start() {
this.taskmanager.addAndScheduleTask(this.checkinSlackTask, '0 0 * * * *');
this.taskmanager.addAndScheduleTask(this.updateSpark, '0 * * * * *'); this.taskmanager.addAndScheduleTask(this.updateSpark, '0 * * * * *');
this.taskmanager.addAndScheduleTask(this.updateHost, '0 0 0 * * *'); this.taskmanager.addAndScheduleTask(this.updateHost, '0 0 0 * * *');
this.taskmanager.addAndScheduleTask(this.updateCloudly, '30 */2 * * * *'); this.taskmanager.addAndScheduleTask(this.updateCloudly, '30 */2 * * * *');
@ -91,7 +79,6 @@ export class SparkTaskManager {
* stops the taskmanager * stops the taskmanager
*/ */
public async stop() { public async stop() {
this.taskmanager.descheduleTask(this.checkinSlackTask);
this.taskmanager.descheduleTask(this.updateSpark); this.taskmanager.descheduleTask(this.updateSpark);
this.taskmanager.descheduleTask(this.updateHost); this.taskmanager.descheduleTask(this.updateHost);
this.taskmanager.descheduleTask(this.updateCloudly); this.taskmanager.descheduleTask(this.updateCloudly);

View File

@ -5,8 +5,9 @@ export { path };
// @serve.zone scope // @serve.zone scope
import * as servezoneInterfaces from '@serve.zone/interfaces'; import * as servezoneInterfaces from '@serve.zone/interfaces';
import * as servezoneApi from '@serve.zone/api';
export { servezoneInterfaces }; export { servezoneInterfaces, servezoneApi };
// @apiclient.xyz scope // @apiclient.xyz scope
import * as docker from '@apiclient.xyz/docker'; import * as docker from '@apiclient.xyz/docker';