aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/resources/schema/containercluster.rnc
blob: 08092f10020de6a21e7ca4243d415cbc07e77765 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
ContainerCluster = element container {
    attribute version { "1.0" } &
    attribute id { xsd:NCName }? &
    Include* &
    ContainerServices &    
    DocumentBinding* &
    NodesOfContainerCluster? &
    ClientAuthorize?
}

ContainerServices =
    SearchInContainer? &
    DocprocInContainer? &
    ProcessingInContainer? &
    ModelEvaluation? &
    DocumentApi? &
    Components* &
    Component* &
    Handler* &
    Server* &
    Http? &
    AccessLog* &
    SecretStore? &
    ZooKeeper? &
    GenericConfig* &
    Clients?

# TODO(ogronnesby): Change this configuration syntax
ClientAuthorize = element client-authorize { empty }

Components = element components {
    Include* &
    Component*
}

Include = element \include {
    attribute dir { text }
}

Http = element http {
    (Filtering & HttpServer+) |
    HttpServer+ |
    empty
}

Filtering = element filtering {
    attribute strict-mode { xsd:boolean }? &
    HttpFilter* &
    AccessControl? &
    element request-chain {
        HttpFilterChain
    }* &
    element response-chain {
        HttpFilterChain
    }*
}

HttpServer =  element server {
    attribute port { xsd:nonNegativeInteger }? &
    attribute required { xsd:boolean }? &
    attribute default-request-chain { xsd:string }? &
    attribute default-response-chain { xsd:string }? &
    ComponentId &
    (Ssl | SslProvider)? &
    GenericConfig*
}

AccessLog = element accesslog {
    attribute type { string "yapache" | string "vespa" | string "json" | string "disabled" }? &
    attribute fileNamePattern { string }? &
    attribute compressOnRotation { xsd:boolean }? &
    attribute symlinkName { string }? &
    attribute compressionType { string "gzip" | string "zstd" }? &
    attribute queueSize { xsd:nonNegativeInteger }? &
    attribute bufferSize { xsd:nonNegativeInteger }? &
    attribute rotationInterval { string }?
}

SecretStore = element secret-store {
    attribute type { string "oath-ckms" | string "cloud" } &
    element group {
      attribute name { string } &
      attribute environment { string "alpha" | string "corp" | string "prod" | string "aws" | string "aws_stage" }
    } * &
    element store {
      attribute id { string } &
      element aws-parameter-store {
        attribute account { string } &
        attribute aws-region { string }
      } *
    }?
}

ZooKeeper = element zookeeper {
    attribute session-timeout-seconds { string }?
}

ModelEvaluation = element model-evaluation {
    element onnx {
        element models {
            element model {
                attribute name { string } &
                element intraop-threads { xsd:nonNegativeInteger }? &
                element interop-threads { xsd:nonNegativeInteger }? &
                element execution-mode { string "sequential" | string "parallel" }? &
                element gpu-device {
                  xsd:nonNegativeInteger
                }?
            }*
        }?
    }?
}

Ssl = element ssl {
    element private-key-file { string } &
    element certificate-file { string } &
    element ca-certificates-file { string }? &
    element client-authentication { string "disabled" | string "want" | string "need" }? &
    element cipher-suites { string }? &
    element protocols { string }?
}

SslProvider = element ssl-provider {
    BundleSpec
}

Threadpool = element threadpool {
    ((
        # TODO Vespa 9 Remove max-threads / min-threads / queue-size
        element max-threads { xsd:nonNegativeInteger } &
        element min-threads { xsd:nonNegativeInteger } &
        element queue-size { xsd:nonNegativeInteger }
    )|(
        element threads { xsd:double { minExclusive = "0.0" } & attribute boost { xsd:double { minExclusive = "0.0" } }? }? &
        element queue { xsd:double { minInclusive = "0.0" } }?
    ))
}

Significance = element significance {
    element model { attribute language { xsd:string } & ModelReference }*
}

Clients = element clients {
    Client*
}

Client = element client {
    ComponentId &
    attribute permissions { string } &
    (
        element certificate { attribute file { string } }+
    |
        element token { attribute id { string } }+
    )
}

# SEARCH:

SearchInContainer = element search {
    Include* &
    ServerBindings? &
    Searcher* &
    SearchChain* &
    Provider* &
    Renderer* &
    GenericConfig* &
    Threadpool? &
    Significance?
}

SearchChain = element chain {
    GenericSearchChain
}

GenericSearchChain =
    ComponentId &
    SearchChainInheritance &
    attribute searchers { text }? &
    Searcher* &
    Phase* &
    GenericConfig*

SearchChainInheritance =
    attribute inherits { text }? &
    attribute excludes { text }? &
    element inherits {
        element chain { ComponentSpec }* &
        element exclude { ComponentSpec }*
    }?


# DOCPROC:

DocprocInContainer = element document-processing {
    Include* &
    DocprocClusterAttributes? &
    DocumentProcessorV3* &
    ChainInDocprocInContainerCluster* &
    GenericConfig*
}
ChainInDocprocInContainerCluster = element chain {
    DocprocChainV3Contents
}
SchemaMapping = element map {
  element field {
    attribute doctype { text }?,
    attribute in-document { text },
    attribute in-processor { text }
  }+
}

# TODO Here we need a thorough cleaning
DocprocClusterAttributes = attribute compressdocuments { xsd:boolean }? &
  attribute numnodesperclient { xsd:positiveInteger }? & # TODO: Remove in Vespa 9
  attribute preferlocalnode { xsd:boolean }? & # TODO: Remove in Vespa 9
  attribute maxmessagesinqueue { xsd:nonNegativeInteger }? &
  attribute maxqueuebytesize { xsd:string { minLength = "1" } }? &  # TODO: Remove in Vespa 9
  attribute maxqueuewait { xsd:positiveInteger }? &
  attribute maxconcurrentfactor { xsd:double { minExclusive = "0.0" maxExclusive = "1.0" } }? &
  attribute documentexpansionfactor { xsd:double { minExclusive = "0.0" } }? &
  attribute containercorememory { xsd:nonNegativeInteger }?


DocprocChainV3Contents = attribute name { xsd:NCName }? &
        ComponentId &
        SchemaMapping? &
        DocprocChainInheritance &
        attribute documentprocessors { text }? &
        DocumentProcessorV3* &
        Phase* &
        GenericConfig*


DocprocChainInheritance =
    attribute inherits { text }? &
    attribute excludes { text }? &
    element inherits {
        element docprocchain { ComponentSpec }* &
        element exclude { ComponentSpec }*
    }?

DocumentProcessorV3 =
    element documentprocessor {
        BundleSpec &
        SchemaMapping? &
        GenericSearcherOrDocumentProcessor
    }


# PROCESSING:

ProcessingInContainer = element processing {
    Include* &
    ServerBindings? &
    Processor* &
    Chain* &
    ProcessingRenderer* &
    GenericConfig*
}



# DOCUMENT API:

DocumentApi = element document-api {
   ServerBindings &
   GenericConfig* &
   element ignore-undefined-fields { xsd:boolean }? &
   element abortondocumenterror { xsd:boolean }? &
   element retryenabled { xsd:boolean }? &
   element route { text }? &
   element maxpendingdocs { xsd:positiveInteger }? &
   element maxpendingbytes { xsd:positiveInteger }? &
   element retrydelay { xsd:double { minInclusive = "0.0" } }? &
   element timeout { xsd:double { minInclusive = "0.0" } }? &
   element tracelevel { xsd:positiveInteger }? &
   element mbusport { xsd:positiveInteger }? &
   DocumentRestApi? &
   HttpClientApi?
}

DocumentRestApi = element rest-api { empty }

HttpClientApi = element http-client-api {
    Threadpool?
}

# NODES:

NodesOfContainerCluster = element nodes {
    attribute jvm-options { text }? & # Remove in Vespa 9
    attribute jvm-gc-options { text }? & # Remove in Vespa 9
    attribute preload { text }? &
    attribute allocated-memory { text }? &  # Remove in Vespa 9
    attribute cpu-socket-affinity { xsd:boolean }? &
    element jvm {
        attribute options { text }? &
        attribute gc-options { text }? &
        attribute allocated-memory { text }?
    } ? &
    Resources? &
    element environment-variables {
      anyElement +
    } ? &
    (
      (
        attribute of { xsd:string } &
        attribute required { xsd:boolean }?
      )
      |
      attribute type { xsd:string }
      |
      (
        attribute count { xsd:positiveInteger | xsd:string  }? &
        attribute flavor { xsd:string }? &
        attribute required { xsd:boolean }? &
        attribute exclusive { xsd:boolean }? &
        attribute docker-image { xsd:string }?
      )
      |
      element node {
        attribute hostalias { xsd:NCName } &
        attribute cpu-socket { xsd:positiveInteger }? &
        GenericConfig*
      }+
    )
}

#DOCUMENT BINDINGS:

DocumentBinding = element document {
    attribute type { xsd:NCName } &
    attribute class { xsd:NCName } &
    attribute bundle { xsd:NCName }
}