teraslice 1.7.2 → 2.0.0

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.
@@ -41,7 +41,7 @@ class Service {
41
41
  }
42
42
 
43
43
  async function main() {
44
- const context = makeTerafoundationContext();
44
+ const context = await makeTerafoundationContext();
45
45
  const cmd = new Service(context);
46
46
 
47
47
  cmd.shutdownHandler = shutdownHandler(context, () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "teraslice",
3
3
  "displayName": "Teraslice",
4
- "version": "1.7.2",
4
+ "version": "2.0.0",
5
5
  "description": "Distributed computing platform for processing JSON data",
6
6
  "homepage": "https://github.com/terascope/teraslice#readme",
7
7
  "bugs": {
@@ -25,13 +25,13 @@
25
25
  "build": "tsc --build",
26
26
  "build:watch": "yarn build --watch",
27
27
  "start": "node service.js",
28
- "test": "TEST_ELASTICSEARCH='true' ts-scripts test . --",
29
- "test:debug": "TEST_ELASTICSEARCH='true' ts-scripts test --debug . --",
30
- "test:elasticsearch6": "TEST_ELASTICSEARCH='true' ts-scripts test . --",
31
- "test:elasticsearch7": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' ts-scripts test . --",
32
- "test:opensearch1": "TEST_OPENSEARCH='true' ts-scripts test . --",
33
- "test:opensearch2": "TEST_OPENSEARCH='true' OPENSEARCH_VERSION='2.8.0' ts-scripts test . --",
34
- "test:watch": "TEST_ELASTICSEARCH='true' ts-scripts test --watch . --"
28
+ "test": "NODE_OPTIONS='--experimental-vm-modules' TEST_ELASTICSEARCH='true' ts-scripts test . --",
29
+ "test:debug": "NODE_OPTIONS='--experimental-vm-modules' TEST_ELASTICSEARCH='true' ts-scripts test --debug . --",
30
+ "test:elasticsearch6": "NODE_OPTIONS='--experimental-vm-modules' TEST_ELASTICSEARCH='true' ts-scripts test . --",
31
+ "test:elasticsearch7": "NODE_OPTIONS='--experimental-vm-modules' TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' ts-scripts test . --",
32
+ "test:opensearch1": "NODE_OPTIONS='--experimental-vm-modules' TEST_OPENSEARCH='true' ts-scripts test . --",
33
+ "test:opensearch2": "NODE_OPTIONS='--experimental-vm-modules' TEST_OPENSEARCH='true' OPENSEARCH_VERSION='2.8.0' ts-scripts test . --",
34
+ "test:watch": "NODE_OPTIONS='--experimental-vm-modules' TEST_ELASTICSEARCH='true' ts-scripts test --watch . --"
35
35
  },
36
36
  "resolutions": {
37
37
  "debug": "^4.3.4",
@@ -39,14 +39,13 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@terascope/elasticsearch-api": "^3.20.2",
42
- "@terascope/job-components": "^0.75.1",
43
- "@terascope/teraslice-messaging": "^0.42.2",
42
+ "@terascope/job-components": "^1.0.0",
43
+ "@terascope/teraslice-messaging": "^1.0.0",
44
44
  "@terascope/types": "^0.17.2",
45
45
  "@terascope/utils": "^0.59.2",
46
46
  "async-mutex": "^0.5.0",
47
47
  "barbe": "^3.0.16",
48
48
  "body-parser": "^1.20.2",
49
- "convict": "^6.2.4",
50
49
  "decompress": "^4.2.1",
51
50
  "easy-table": "^1.2.0",
52
51
  "event-loop-stats": "^1.4.1",
@@ -61,10 +60,10 @@
61
60
  "ms": "^2.1.3",
62
61
  "nanoid": "^3.3.4",
63
62
  "porty": "^3.1.1",
64
- "semver": "^7.6.1",
63
+ "semver": "^7.6.2",
65
64
  "socket.io": "^1.7.4",
66
65
  "socket.io-client": "^1.7.4",
67
- "terafoundation": "^0.64.1",
66
+ "terafoundation": "^1.0.0",
68
67
  "uuid": "^9.0.1"
69
68
  },
70
69
  "devDependencies": {
@@ -74,7 +73,9 @@
74
73
  "archiver": "^7.0.1",
75
74
  "bufferstreams": "^3.0.0",
76
75
  "chance": "^1.1.11",
77
- "got": "^11.8.3",
76
+ "convict": "^6.2.4",
77
+ "convict-format-with-moment": "^6.2.0",
78
+ "convict-format-with-validator": "^6.2.0",
78
79
  "jest-fixtures": "^0.6.0",
79
80
  "js-yaml": "^4.1.0",
80
81
  "nock": "^13.5.1"
package/service.js CHANGED
@@ -42,7 +42,7 @@ if (['execution_controller', 'worker'].includes(assignment)) {
42
42
  },
43
43
  });
44
44
 
45
- new ClusterContext(terasliceConfig);
45
+ await ClusterContext.createContext(terasliceConfig);
46
46
  }
47
47
 
48
48
  function deprecatedUseOf(name) {
package/worker-service.js CHANGED
@@ -7,12 +7,10 @@ import { makeExecutionContext } from './dist/src/lib/workers/context/execution-c
7
7
  import { makeTerafoundationContext } from './dist/src/lib/workers/context/terafoundation-context.js';
8
8
  import { ExecutionController } from './dist/src/lib/workers/execution-controller/index.js';
9
9
  import { Worker } from './dist/src/lib/workers/worker/index.js';
10
- import { getPackageJSON } from './dist/src/lib/utils/file_utils.js';
11
10
 
12
11
  class Service {
13
12
  constructor(context) {
14
13
  this.executionConfig = this._getExecutionConfigFromEnv();
15
- this.executionConfig.teraslice_version = getPackageJSON().version;
16
14
  this.context = context;
17
15
 
18
16
  this.logger = this.context.logger;
@@ -69,16 +67,22 @@ class Service {
69
67
  }
70
68
  }
71
69
 
72
- const context = makeTerafoundationContext();
73
- const cmd = new Service(context);
70
+ async function main() {
71
+ const context = await makeTerafoundationContext();
72
+ const cmd = new Service(context);
74
73
 
75
- cmd.shutdownHandler = shutdownHandler(context, (event, err) => {
76
- if (!cmd.instance) return Promise.resolve();
77
- return cmd.instance.shutdown(true, event, err);
78
- });
74
+ cmd.shutdownHandler = shutdownHandler(context, (event, err) => {
75
+ if (!cmd.instance) return Promise.resolve();
76
+ return cmd.instance.shutdown(true, event, err);
77
+ });
79
78
 
80
- Promise.resolve()
81
- .then(() => cmd.initialize())
82
- .then(() => cmd.run())
83
- .then(() => cmd.shutdown())
84
- .catch((err) => cmd.shutdown(err));
79
+ try {
80
+ await cmd.initialize();
81
+ await cmd.run();
82
+ await cmd.shutdown();
83
+ } catch (err) {
84
+ cmd.shutdown(err);
85
+ }
86
+ }
87
+
88
+ main();