@lde/search-indexer 0.19.4 → 0.20.1
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/composition.d.ts +6 -5
- package/dist/composition.d.ts.map +1 -1
- package/dist/composition.js +25 -22
- package/dist/config.d.ts +23 -12
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +25 -5
- package/package.json +8 -8
package/dist/composition.d.ts
CHANGED
|
@@ -18,11 +18,12 @@ export declare function datasetSelectorFrom(config: IndexerConfig): DatasetSelec
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function writerFactoryFrom(client: Client, config: IndexerConfig): (searchType: RootType, schema: SearchSchema) => Writer<SearchDocument>;
|
|
20
20
|
/**
|
|
21
|
-
* The distribution resolver the configuration describes: with
|
|
22
|
-
*
|
|
23
|
-
* pipeline-controlled QLever sibling container over the mounted Docker
|
|
24
|
-
* socket; without
|
|
25
|
-
* default (a bare
|
|
21
|
+
* The distribution resolver the configuration describes: with a QLever
|
|
22
|
+
* configured, an {@link ImportResolver} that imports data dumps into a
|
|
23
|
+
* pipeline-controlled QLever – a sibling container over the mounted Docker
|
|
24
|
+
* socket, or a sidecar in the indexer’s pod; without one, `undefined`,
|
|
25
|
+
* leaving the pipeline its endpoint-only default (a bare
|
|
26
|
+
* {@link SparqlDistributionResolver}).
|
|
26
27
|
*/
|
|
27
28
|
export declare function distributionResolverFrom(config: IndexerConfig): DistributionResolver | undefined;
|
|
28
29
|
//# sourceMappingURL=composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EAEb,MAAM,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,GACpB,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,cAAc,CAAC,CAmBxE;AAED
|
|
1
|
+
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EAEb,MAAM,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,GACpB,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,cAAc,CAAC,CAmBxE;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,GACpB,oBAAoB,GAAG,SAAS,CA6BlC"}
|
package/dist/composition.js
CHANGED
|
@@ -44,33 +44,36 @@ export function writerFactoryFrom(client, config) {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* The distribution resolver the configuration describes: with
|
|
48
|
-
*
|
|
49
|
-
* pipeline-controlled QLever sibling container over the mounted Docker
|
|
50
|
-
* socket; without
|
|
51
|
-
* default (a bare
|
|
47
|
+
* The distribution resolver the configuration describes: with a QLever
|
|
48
|
+
* configured, an {@link ImportResolver} that imports data dumps into a
|
|
49
|
+
* pipeline-controlled QLever – a sibling container over the mounted Docker
|
|
50
|
+
* socket, or a sidecar in the indexer’s pod; without one, `undefined`,
|
|
51
|
+
* leaving the pipeline its endpoint-only default (a bare
|
|
52
|
+
* {@link SparqlDistributionResolver}).
|
|
52
53
|
*/
|
|
53
54
|
export function distributionResolverFrom(config) {
|
|
54
55
|
if (!config.qlever) {
|
|
55
56
|
return undefined;
|
|
56
57
|
}
|
|
57
|
-
const { importer, server } = config.qlever.
|
|
58
|
-
? createQlever({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
const { importer, server } = config.qlever.mode === 'remote'
|
|
59
|
+
? createQlever({ mode: 'remote', dataDir: config.qlever.dataDir })
|
|
60
|
+
: config.qlever.network
|
|
61
|
+
? createQlever({
|
|
62
|
+
mode: 'docker',
|
|
63
|
+
image: config.qlever.image,
|
|
64
|
+
dataDir: config.qlever.dataDir,
|
|
65
|
+
network: config.qlever.network,
|
|
66
|
+
// The network-scoped name doubles as the endpoint hostname. It keeps
|
|
67
|
+
// stacks on different networks from removing each other’s QLever;
|
|
68
|
+
// indexers sharing one network would still collide, so run at most
|
|
69
|
+
// one indexer per network.
|
|
70
|
+
containerName: `qlever-${config.qlever.network}`,
|
|
71
|
+
})
|
|
72
|
+
: createQlever({
|
|
73
|
+
mode: 'docker',
|
|
74
|
+
image: config.qlever.image,
|
|
75
|
+
dataDir: config.qlever.dataDir,
|
|
76
|
+
});
|
|
74
77
|
return new ImportResolver(new SparqlDistributionResolver(), {
|
|
75
78
|
importer,
|
|
76
79
|
server,
|
package/dist/config.d.ts
CHANGED
|
@@ -42,9 +42,10 @@ export interface IndexerConfig {
|
|
|
42
42
|
/** Per-dataset processing memory: skip unchanged datasets
|
|
43
43
|
* (`PROVENANCE_FILE` + `PIPELINE_VERSION`). */
|
|
44
44
|
readonly provenance?: ProvenanceConfig;
|
|
45
|
-
/** The QLever import path (`
|
|
46
|
-
* `DATA_DIR`): import data dumps into a
|
|
47
|
-
*
|
|
45
|
+
/** The QLever import path (`QLEVER_MODE` + `QLEVER_IMAGE` +
|
|
46
|
+
* `IMPORT_STRATEGY` + `DATA_DIR`): import data dumps into a
|
|
47
|
+
* pipeline-controlled QLever instead of relying on live SPARQL endpoints
|
|
48
|
+
* alone. */
|
|
48
49
|
readonly qlever?: QleverConfig;
|
|
49
50
|
}
|
|
50
51
|
/** Connection details of the Typesense node the indexer writes to. */
|
|
@@ -63,20 +64,30 @@ export interface ProvenanceConfig {
|
|
|
63
64
|
/** Consumer-declared version of the indexer’s output-affecting logic. */
|
|
64
65
|
readonly pipelineVersion: string;
|
|
65
66
|
}
|
|
66
|
-
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
/**
|
|
68
|
+
* The pipeline-controlled QLever the import path imports into, discriminated
|
|
69
|
+
* by `QLEVER_MODE`.
|
|
70
|
+
*/
|
|
71
|
+
export type QleverConfig = {
|
|
70
72
|
/** When to import a data dump instead of querying a live endpoint. */
|
|
71
73
|
readonly strategy: 'sparql' | 'sparqlWithImportFallback' | 'import';
|
|
72
74
|
/** Directory for downloaded dumps and QLever index caches. */
|
|
73
75
|
readonly dataDir: string;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
} & ({
|
|
77
|
+
/** A sibling container the indexer starts over the Docker socket. */
|
|
78
|
+
readonly mode: 'docker';
|
|
79
|
+
/** QLever Docker image to run, e.g. `adfreiburg/qlever:latest`. */
|
|
80
|
+
readonly image: string;
|
|
81
|
+
/** Docker network the spawned QLever joins (`QLEVER_NETWORK`), reached
|
|
82
|
+
* by container name. Required when the indexer itself runs
|
|
83
|
+
* containerized on a bridge network; without it QLever is published on
|
|
84
|
+
* the host and addressed as `localhost`. */
|
|
78
85
|
readonly network?: string;
|
|
79
|
-
}
|
|
86
|
+
} | {
|
|
87
|
+
/** A sidecar in the indexer’s pod, controlled through the task agent
|
|
88
|
+
* of `@lde/task-runner-http`. The pod sets its image. */
|
|
89
|
+
readonly mode: 'remote';
|
|
90
|
+
});
|
|
80
91
|
/**
|
|
81
92
|
* Read the {@link IndexerConfig} from environment variables. Reports **all**
|
|
82
93
|
* problems in one error – a misconfigured deployment learns everything
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC;iCAC6B;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC;IAC/B;;;;;;;OAOG;IACH,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C;;eAEW;IACX,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC;IACzC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC;wEACoE;IACpE,QAAQ,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;IAChD;wEACoE;IACpE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;oDACgD;IAChD,QAAQ,CAAC,UAAU,CAAC,EA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,MAAM,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,0BAA0B,GAAG,QAAQ,CAAC;IACpE,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG,CACA;IACE,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;iDAG6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,GACD;IACE;8DAC0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB,CACJ,CAAC;AAUF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GACxD,aAAa,CAsFf"}
|
package/dist/config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const QLEVER_MODES = ['docker', 'remote'];
|
|
1
2
|
const IMPORT_STRATEGIES = [
|
|
2
3
|
'sparql',
|
|
3
4
|
'sparqlWithImportFallback',
|
|
@@ -145,23 +146,42 @@ function qleverFromEnvironment(environment, problems) {
|
|
|
145
146
|
const image = environment['QLEVER_IMAGE'];
|
|
146
147
|
const strategy = environment['IMPORT_STRATEGY'];
|
|
147
148
|
const network = environment['QLEVER_NETWORK'];
|
|
148
|
-
|
|
149
|
+
// QLEVER_IMAGE alone is how the Docker mode has always been enabled. An
|
|
150
|
+
// empty QLEVER_MODE, as a template renders an unset one, counts as unset.
|
|
151
|
+
const mode = environment['QLEVER_MODE'] || (image ? 'docker' : undefined);
|
|
152
|
+
if (mode === undefined) {
|
|
149
153
|
if (strategy) {
|
|
150
|
-
problems.push('IMPORT_STRATEGY requires QLEVER_IMAGE: without an import engine there is nothing to import into');
|
|
154
|
+
problems.push('IMPORT_STRATEGY requires QLEVER_IMAGE or QLEVER_MODE=remote: without an import engine there is nothing to import into');
|
|
151
155
|
}
|
|
152
156
|
if (network) {
|
|
153
157
|
problems.push('QLEVER_NETWORK requires QLEVER_IMAGE: without an import engine there is no QLever container to attach');
|
|
154
158
|
}
|
|
155
159
|
return undefined;
|
|
156
160
|
}
|
|
161
|
+
if (!QLEVER_MODES.includes(mode)) {
|
|
162
|
+
problems.push(`QLEVER_MODE must be one of ${QLEVER_MODES.map((name) => `“${name}”`).join(', ')}, got “${mode}”`);
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
157
165
|
if (strategy !== undefined &&
|
|
158
166
|
!IMPORT_STRATEGIES.includes(strategy)) {
|
|
159
167
|
problems.push(`IMPORT_STRATEGY must be one of ${IMPORT_STRATEGIES.map((name) => `“${name}”`).join(', ')}, got “${strategy}”`);
|
|
160
168
|
}
|
|
161
|
-
|
|
162
|
-
image,
|
|
169
|
+
const common = {
|
|
163
170
|
strategy: (strategy ?? 'sparql'),
|
|
164
171
|
dataDir: environment['DATA_DIR'] ?? '/data',
|
|
165
|
-
network,
|
|
166
172
|
};
|
|
173
|
+
if (mode === 'remote') {
|
|
174
|
+
if (image) {
|
|
175
|
+
problems.push('QLEVER_IMAGE cannot be combined with QLEVER_MODE=remote: the pod sets the QLever sidecar’s image');
|
|
176
|
+
}
|
|
177
|
+
if (network) {
|
|
178
|
+
problems.push('QLEVER_NETWORK cannot be combined with QLEVER_MODE=remote: the sidecar shares the indexer’s network namespace');
|
|
179
|
+
}
|
|
180
|
+
return { ...common, mode: 'remote' };
|
|
181
|
+
}
|
|
182
|
+
if (!image) {
|
|
183
|
+
problems.push('QLEVER_MODE=docker requires QLEVER_IMAGE: the image to start QLever containers from');
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
return { ...common, mode: 'docker', image, network };
|
|
167
187
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/search-indexer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "The @lde/search-pipeline indexer as a bootable process and prebuilt Docker image: loads a mounted schema-declaration module, dataset selection, Typesense connection and rebuild mode from the environment, then runs the object-grain searchIndexerPipeline once to completion. The composition layer that binds the engine-agnostic @lde/search-pipeline stages to @lde/search-typesense – the write-path counterpart of @lde/search-api-server.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "git+https://github.com/ldelements/lde.git",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"!**/*.tsbuildinfo"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lde/dataset-registry-client": "^0.
|
|
32
|
-
"@lde/pipeline": "^0.
|
|
33
|
-
"@lde/pipeline-console-reporter": "^0.
|
|
34
|
-
"@lde/search": "^0.
|
|
35
|
-
"@lde/search-pipeline": "^0.
|
|
36
|
-
"@lde/search-typesense": "^0.
|
|
37
|
-
"@lde/sparql-qlever": "^0.
|
|
31
|
+
"@lde/dataset-registry-client": "^0.10.0",
|
|
32
|
+
"@lde/pipeline": "^0.37.0",
|
|
33
|
+
"@lde/pipeline-console-reporter": "^0.28.0",
|
|
34
|
+
"@lde/search": "^0.28.1",
|
|
35
|
+
"@lde/search-pipeline": "^0.30.1",
|
|
36
|
+
"@lde/search-typesense": "^0.33.1",
|
|
37
|
+
"@lde/sparql-qlever": "^0.17.0",
|
|
38
38
|
"commander": "^15.0.0",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
40
|
"typesense": "^3.1.1"
|