teraslice 3.0.0-dev.11 → 3.0.0-dev.13
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/dist/src/lib/cluster/services/cluster/backends/kubernetesV2/k8sResource.js +0 -2
- package/dist/src/lib/config/index.js +1 -3
- package/dist/src/lib/config/schemas/system.js +13 -13
- package/dist/src/lib/workers/helpers/worker-shutdown.js +1 -8
- package/dist/test/config/schemas/system_schema-spec.js +4 -15
- package/dist/test/services/assets-spec.js +2 -2
- package/dist/test/storage/assets_storage-spec.js +2 -2
- package/dist/test/test.config.js +21 -6
- package/dist/test/workers/helpers/configs.js +1 -1
- package/package.json +14 -11
|
@@ -55,8 +55,6 @@ export class K8sResource {
|
|
|
55
55
|
const shutdownTimeoutMs = get(this.terasliceConfig, 'shutdown_timeout', 60000);
|
|
56
56
|
const shutdownTimeoutSeconds = Math.round(shutdownTimeoutMs / 1000);
|
|
57
57
|
const config = {
|
|
58
|
-
// assetsDirectory: get(this.terasliceConfig, 'assets_directory', ''),
|
|
59
|
-
// assetsVolume: get(this.terasliceConfig, 'assets_volume', ''),
|
|
60
58
|
clusterName,
|
|
61
59
|
clusterNameLabel,
|
|
62
60
|
configMapName,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { get } from '@terascope/core-utils';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { formats } from '@terascope/job-components';
|
|
5
4
|
import { configSchema } from './schemas/system.js';
|
|
6
5
|
const filePath = fileURLToPath(new URL('.', import.meta.url));
|
|
7
6
|
export function clusterName(configFile) {
|
|
@@ -12,11 +11,10 @@ export function getTerasliceConfig(sysconfig) {
|
|
|
12
11
|
name: 'teraslice',
|
|
13
12
|
default_config_file: path.join(filePath, 'default-sysconfig.js'),
|
|
14
13
|
config_schema: configSchema,
|
|
15
|
-
schema_formats: formats,
|
|
16
14
|
cluster_name: clusterName,
|
|
17
15
|
shutdownMessaging: false,
|
|
18
16
|
start_workers: false,
|
|
19
17
|
}, sysconfig);
|
|
20
18
|
}
|
|
21
|
-
export {
|
|
19
|
+
export { configSchema, };
|
|
22
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -32,18 +32,18 @@ export const schema = {
|
|
|
32
32
|
},
|
|
33
33
|
assets_volume: {
|
|
34
34
|
doc: 'name of shared asset volume (k8s)',
|
|
35
|
-
default:
|
|
36
|
-
format: '
|
|
35
|
+
default: undefined,
|
|
36
|
+
format: 'optional_string'
|
|
37
37
|
},
|
|
38
38
|
autoload_directory: {
|
|
39
39
|
doc: 'directory to look for assets to auto deploy when teraslice boots up',
|
|
40
40
|
default: path.join(process.cwd(), './autoload'),
|
|
41
|
-
format: '
|
|
41
|
+
format: 'optional_string'
|
|
42
42
|
},
|
|
43
43
|
hostname: {
|
|
44
44
|
doc: 'IP or hostname for server',
|
|
45
45
|
default: ip.address(),
|
|
46
|
-
format: '
|
|
46
|
+
format: 'required_string'
|
|
47
47
|
},
|
|
48
48
|
workers: {
|
|
49
49
|
doc: 'Number of workers per server',
|
|
@@ -58,7 +58,7 @@ export const schema = {
|
|
|
58
58
|
master_hostname: {
|
|
59
59
|
doc: 'hostname where the cluster_master resides, used to notify all node_masters where to connect',
|
|
60
60
|
default: 'localhost',
|
|
61
|
-
format: '
|
|
61
|
+
format: 'required_string'
|
|
62
62
|
},
|
|
63
63
|
port: {
|
|
64
64
|
doc: 'port for the cluster_master to listen on',
|
|
@@ -68,7 +68,7 @@ export const schema = {
|
|
|
68
68
|
name: {
|
|
69
69
|
doc: 'Name for the cluster itself, its used for naming log files/indices',
|
|
70
70
|
default: 'teracluster',
|
|
71
|
-
format: '
|
|
71
|
+
format: 'elasticsearch_name'
|
|
72
72
|
},
|
|
73
73
|
state: {
|
|
74
74
|
doc: 'Elasticsearch cluster where job state, analytics and logs are stored',
|
|
@@ -273,12 +273,12 @@ export const schema = {
|
|
|
273
273
|
kubernetes_image: {
|
|
274
274
|
doc: 'Specify a custom image name for kubernetes, this only applies to kubernetes systems',
|
|
275
275
|
default: 'terascope/teraslice',
|
|
276
|
-
format: '
|
|
276
|
+
format: 'optional_string'
|
|
277
277
|
},
|
|
278
278
|
kubernetes_namespace: {
|
|
279
279
|
doc: 'Specify a custom kubernetes namespace, this only applies to kubernetes systems',
|
|
280
280
|
default: 'default',
|
|
281
|
-
format: '
|
|
281
|
+
format: 'optional_string'
|
|
282
282
|
},
|
|
283
283
|
kubernetes_overrides_enabled: {
|
|
284
284
|
doc: '',
|
|
@@ -288,17 +288,17 @@ export const schema = {
|
|
|
288
288
|
kubernetes_priority_class_name: {
|
|
289
289
|
doc: 'Priority class that the Teraslice master, execution controller, and stateful workers should run with',
|
|
290
290
|
default: undefined,
|
|
291
|
-
format: '
|
|
291
|
+
format: 'optional_string'
|
|
292
292
|
},
|
|
293
293
|
kubernetes_config_map_name: {
|
|
294
294
|
doc: 'Specify the name of the Kubernetes ConfigMap used to configure worker pods',
|
|
295
295
|
default: 'teraslice-worker',
|
|
296
|
-
format: '
|
|
296
|
+
format: 'optional_string'
|
|
297
297
|
},
|
|
298
298
|
kubernetes_image_pull_secret: {
|
|
299
299
|
doc: 'Name of Kubernetes secret used to pull docker images from private repository',
|
|
300
|
-
default:
|
|
301
|
-
format: '
|
|
300
|
+
default: undefined,
|
|
301
|
+
format: 'optional_string'
|
|
302
302
|
},
|
|
303
303
|
kubernetes_worker_antiaffinity: {
|
|
304
304
|
doc: 'Enable Teraslice woker pod AntiAffinity in Kubernetes',
|
|
@@ -318,7 +318,7 @@ export const schema = {
|
|
|
318
318
|
asset_storage_bucket: {
|
|
319
319
|
doc: 'Name of S3 bucket used to store assets. Can only be used if "asset_storage_connection_type" is "s3".',
|
|
320
320
|
default: undefined,
|
|
321
|
-
format:
|
|
321
|
+
format: 'optional_string'
|
|
322
322
|
},
|
|
323
323
|
};
|
|
324
324
|
export function configSchema() {
|
|
@@ -28,7 +28,7 @@ export function shutdownHandler(context, shutdownFn) {
|
|
|
28
28
|
|| process.env.assignment
|
|
29
29
|
|| 'unknown-assignment';
|
|
30
30
|
// this is native clustering only
|
|
31
|
-
const isProcessRestart = process.env.
|
|
31
|
+
const isProcessRestart = process.env.__process_restart;
|
|
32
32
|
const api = {
|
|
33
33
|
exiting: false,
|
|
34
34
|
exit
|
|
@@ -132,13 +132,6 @@ export function shutdownHandler(context, shutdownFn) {
|
|
|
132
132
|
}
|
|
133
133
|
process.stdout.on('error', handleStdError);
|
|
134
134
|
process.stderr.on('error', handleStdError);
|
|
135
|
-
// event is fired from terafoundation when an error occurs during instantiation of a client
|
|
136
|
-
// **DEPRECATED:** This handler should be removed on teraslice v1
|
|
137
|
-
events.once('client:initialization:error', (err) => {
|
|
138
|
-
logError(logger, err, `${assignment} received a client initialization error, ${exitingIn()}`);
|
|
139
|
-
setStatusCode(1);
|
|
140
|
-
exit('client:initialization:error', err);
|
|
141
|
-
});
|
|
142
135
|
events.once('worker:shutdown:complete', (err) => {
|
|
143
136
|
setStatusCode(0);
|
|
144
137
|
if (err) {
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
// @ts-expect-error no types
|
|
3
|
-
import convict_format_with_validator from 'convict-format-with-validator';
|
|
4
|
-
// @ts-expect-error no types
|
|
5
|
-
import convict_format_with_moment from 'convict-format-with-moment';
|
|
6
|
-
import { formats } from '@terascope/job-components';
|
|
1
|
+
import { SchemaValidator } from '@terascope/core-utils';
|
|
7
2
|
import { config_schema } from '../../../src/lib/config/schemas/system.js';
|
|
8
|
-
// load any convict schema
|
|
9
|
-
convict.addFormats(convict_format_with_validator);
|
|
10
|
-
convict.addFormats(convict_format_with_moment);
|
|
11
|
-
formats.forEach((format) => convict.addFormat(format));
|
|
12
3
|
describe('system_schema', () => {
|
|
13
4
|
const schema = config_schema().schema.teraslice;
|
|
14
5
|
function checkValidation(config) {
|
|
15
6
|
try {
|
|
16
|
-
const validator =
|
|
17
|
-
validator.
|
|
18
|
-
validator.validate();
|
|
19
|
-
return validator.getProperties();
|
|
7
|
+
const validator = new SchemaValidator(schema, 'teraslice');
|
|
8
|
+
return validator.validate(config);
|
|
20
9
|
}
|
|
21
10
|
catch (err) {
|
|
22
11
|
return err.message;
|
|
@@ -31,7 +20,7 @@ describe('system_schema', () => {
|
|
|
31
20
|
expect(schema.state.default).toEqual({ connection: 'default' });
|
|
32
21
|
});
|
|
33
22
|
it('assets_directory is optional but requires a string', () => {
|
|
34
|
-
expect(checkValidation({ assets_directory: 234 })).
|
|
23
|
+
expect(checkValidation({ assets_directory: 234 })).toContain('Invalid parameter assets_directory, it must either be a string or an array of strings');
|
|
35
24
|
});
|
|
36
25
|
});
|
|
37
26
|
//# sourceMappingURL=system_schema-spec.js.map
|
|
@@ -4,7 +4,7 @@ import got from 'got';
|
|
|
4
4
|
import { createClient } from '@terascope/opensearch-client';
|
|
5
5
|
import { createS3Client } from '@terascope/file-asset-apis';
|
|
6
6
|
import { AssetsService } from '../../src/lib/cluster/services/assets';
|
|
7
|
-
import { TEST_INDEX_PREFIX } from '../test.config';
|
|
7
|
+
import { SEARCH_TEST_HOST, TEST_INDEX_PREFIX } from '../test.config';
|
|
8
8
|
import { findPort } from '../../src/lib/utils/port_utils.js';
|
|
9
9
|
describe('Assets Service', () => {
|
|
10
10
|
const contextOptions = {
|
|
@@ -48,7 +48,7 @@ describe('Assets Service', () => {
|
|
|
48
48
|
},
|
|
49
49
|
'elasticsearch-next': {
|
|
50
50
|
default: {
|
|
51
|
-
node: [
|
|
51
|
+
node: [SEARCH_TEST_HOST]
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
}
|
|
@@ -3,7 +3,7 @@ import { TestContext } from '@terascope/job-components';
|
|
|
3
3
|
import { createClient } from '@terascope/opensearch-client';
|
|
4
4
|
import { createS3Client } from '@terascope/file-asset-apis';
|
|
5
5
|
import { AssetsStorage } from '../../src/lib/storage';
|
|
6
|
-
import { TEST_INDEX_PREFIX } from '../test.config';
|
|
6
|
+
import { SEARCH_TEST_HOST, TEST_INDEX_PREFIX } from '../test.config';
|
|
7
7
|
describe('AssetsStorage using S3 backend', () => {
|
|
8
8
|
let storage;
|
|
9
9
|
const options = {
|
|
@@ -32,7 +32,7 @@ describe('AssetsStorage using S3 backend', () => {
|
|
|
32
32
|
connectors: {
|
|
33
33
|
'elasticsearch-next': {
|
|
34
34
|
default: {
|
|
35
|
-
node: [
|
|
35
|
+
node: [SEARCH_TEST_HOST]
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
s3: {
|
package/dist/test/test.config.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import { SchemaValidator } from '@terascope/core-utils';
|
|
1
2
|
import { newId } from '../src/lib/utils/id_utils.js';
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const terasliceTestEnvSchema = {
|
|
4
|
+
SEARCH_TEST_HOST: {
|
|
5
|
+
default: undefined,
|
|
6
|
+
format: String,
|
|
7
|
+
},
|
|
8
|
+
TERASLICE_CLUSTER_NAME: {
|
|
9
|
+
default: null,
|
|
10
|
+
format: 'optional_string',
|
|
11
|
+
},
|
|
12
|
+
TEST_INDEX_PREFIX: {
|
|
13
|
+
default: undefined,
|
|
14
|
+
format: String,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const validator = new SchemaValidator(terasliceTestEnvSchema, 'terasliceTestEnvSchema', undefined, 'allow');
|
|
18
|
+
const envConfig = validator.validate(process.env);
|
|
19
|
+
const { SEARCH_TEST_HOST, TEST_INDEX_PREFIX } = envConfig;
|
|
20
|
+
const TERASLICE_CLUSTER_NAME = envConfig.TERASLICE_CLUSTER_NAME
|
|
21
|
+
|| newId(`${TEST_INDEX_PREFIX}teraslice`, true, 2);
|
|
22
|
+
export { TEST_INDEX_PREFIX, SEARCH_TEST_HOST, TERASLICE_CLUSTER_NAME, };
|
|
8
23
|
//# sourceMappingURL=test.config.js.map
|
|
@@ -4,7 +4,7 @@ import { withoutNil } from '@terascope/core-utils';
|
|
|
4
4
|
// @ts-expect-error
|
|
5
5
|
import Chance from 'chance';
|
|
6
6
|
import { newId } from '../../../src/lib/utils/id_utils.js';
|
|
7
|
-
|
|
7
|
+
import { SEARCH_TEST_HOST } from '../../test.config.js';
|
|
8
8
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
const opsPath = path.join(dirname, '..', 'fixtures', 'ops');
|
|
10
10
|
const chance = new Chance();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teraslice",
|
|
3
3
|
"displayName": "Teraslice",
|
|
4
|
-
"version": "3.0.0-dev.
|
|
4
|
+
"version": "3.0.0-dev.13",
|
|
5
5
|
"description": "Distributed computing platform for processing JSON data",
|
|
6
6
|
"homepage": "https://github.com/terascope/teraslice#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@kubernetes/client-node": "~1.3.0",
|
|
42
|
-
"@terascope/core-utils": "~2.0.0-dev.
|
|
43
|
-
"@terascope/elasticsearch-api": "~5.0.0-dev.
|
|
44
|
-
"@terascope/job-components": "~2.0.0-dev.
|
|
45
|
-
"@terascope/teraslice-messaging": "~2.0.0-dev.
|
|
46
|
-
"@terascope/types": "~2.0.0-dev.
|
|
42
|
+
"@terascope/core-utils": "~2.0.0-dev.10",
|
|
43
|
+
"@terascope/elasticsearch-api": "~5.0.0-dev.11",
|
|
44
|
+
"@terascope/job-components": "~2.0.0-dev.11",
|
|
45
|
+
"@terascope/teraslice-messaging": "~2.0.0-dev.11",
|
|
46
|
+
"@terascope/types": "~2.0.0-dev.8",
|
|
47
47
|
"async-mutex": "~0.5.0",
|
|
48
48
|
"barbe": "~3.0.17",
|
|
49
49
|
"body-parser": "~2.2.0",
|
|
@@ -61,20 +61,23 @@
|
|
|
61
61
|
"semver": "~7.7.2",
|
|
62
62
|
"socket.io": "~4.8.1",
|
|
63
63
|
"socket.io-client": "~4.8.1",
|
|
64
|
-
"terafoundation": "~2.0.0-dev.
|
|
64
|
+
"terafoundation": "~2.0.0-dev.12",
|
|
65
65
|
"uuid": "~13.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@terascope/opensearch-client": "~2.0.0-dev.
|
|
68
|
+
"@terascope/opensearch-client": "~2.0.0-dev.10",
|
|
69
69
|
"@types/archiver": "~6.0.3",
|
|
70
|
+
"@types/body-parser": "^1.19.6",
|
|
71
|
+
"@types/decompress": "^4.2.7",
|
|
70
72
|
"@types/express": "~5.0.3",
|
|
71
73
|
"@types/gc-stats": "~1.4.3",
|
|
74
|
+
"@types/ip": "^1.1.3",
|
|
75
|
+
"@types/js-yaml": "^4.0.9",
|
|
76
|
+
"@types/ms": "~0.7.34",
|
|
77
|
+
"@types/semver": "^7.7.1",
|
|
72
78
|
"archiver": "~7.0.1",
|
|
73
79
|
"bufferstreams": "~3.0.0",
|
|
74
80
|
"chance": "~1.1.13",
|
|
75
|
-
"convict": "~6.2.4",
|
|
76
|
-
"convict-format-with-moment": "~6.2.0",
|
|
77
|
-
"convict-format-with-validator": "~6.2.0",
|
|
78
81
|
"jest-fixtures": "~0.6.0",
|
|
79
82
|
"js-yaml": "~4.1.0",
|
|
80
83
|
"nock": "~13.5.6"
|