Skip to content

Commit b60c1d4

Browse files
authored
Merge pull request #4599 from vespa-engine/bjormel/application-variant
Document the new `application` dimension
2 parents 3389356 + 343138a commit b60c1d4

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

en/operations/deployment-variants.html

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# Copyright Vespa.ai. All rights reserved.
3-
title: "Instance, region, cloud and environment variants"
3+
title: "Application, instance, region, cloud and environment variants"
44
applies_to: cloud
55
redirect_from:
66
- en/reference/deployment-variants.html
@@ -9,7 +9,8 @@
99
<p>
1010
Sometimes it is useful to create configuration that varies depending on properties of the deployment,
1111
for example to set region specific endpoints of services used by <a href="/en/applications/searchers.html">Searchers</a>,
12-
or use smaller clusters for a "beta" instance.
12+
use smaller clusters for a "beta" instance, or vary configuration when the same application package is shared across
13+
multiple applications.
1314
</p>
1415
<p>
1516
This is supported both for <a href="#services.xml-variants">services.xml</a> and
@@ -21,14 +22,14 @@
2122
<h2 id="services.xml-variants">services.xml variants</h2>
2223
<p>
2324
<a href="../reference/applications/services/services.html">services.xml</a> files support different configuration settings
24-
for different <em>tags</em>, <em>instances</em>, <em>environments</em>, <em>clouds</em> and <em>regions</em>.
25+
for different <em>tags</em>, <em>applications</em>, <em>instances</em>, <em>environments</em>, <em>clouds</em> and <em>regions</em>.
2526
To use this, import the <em>deploy</em> namespace:
2627
</p>
2728
<pre>{% highlight xml %}
2829
<services version="1.0" xmlns:deploy="vespa">
2930
{% endhighlight %}</pre>
3031
<p>
31-
Deploy directives are used to specify with which tags, and in which instance, environment,
32+
Deploy directives are used to specify with which tags, and in which application, instance, environment,
3233
cloud and/or <a href="https://cloud.vespa.ai/en/reference/zones">region</a> an XML element should be included:
3334
</p>
3435
<pre>{% highlight xml %}
@@ -56,6 +57,11 @@ <h2 id="services.xml-variants">services.xml variants</h2>
5657
count="4">
5758
<resources vcpu="16.0" memory="256Gb" disk="3750Gb"/>
5859
</nodes>
60+
<nodes deploy:application="my-app"
61+
deploy:environment="prod"
62+
count="30">
63+
<resources vcpu="16.0" memory="128Gb" disk="3750Gb"/>
64+
</nodes>
5965
<nodes deploy:tags="myTag1 myTag2" count="8" />
6066
</content>
6167
{% endhighlight %}</pre>
@@ -104,7 +110,7 @@ <h2 id="services.xml-variants">services.xml variants</h2>
104110

105111

106112
<h3 id="advanced">Specifying multiple targets</h3>
107-
<p>More than one tag, instance, region or environment can be specified in the attribute, separated by space.</p>
113+
<p>More than one tag, application, instance, region or environment can be specified in the attribute, separated by space.</p>
108114
<p>
109115
Note that <code>tags</code> by default only apply in production instances,
110116
and are matched whenever the tags of the element and the tags of the instance intersect.
@@ -137,40 +143,40 @@ <h3 id="advanced">Specifying multiple targets</h3>
137143
<h2 id="query-profile-variants">Query profile variants</h2>
138144
<p>
139145
<a href="/en/querying/query-profiles.html">Query profiles</a> support different configuration settings
140-
for different <em>instances</em>, <em>environments</em> and <em>regions</em> through
146+
for different <em>applications</em>, <em>instances</em>, <em>environments</em> and <em>regions</em> through
141147
<a href="/en/querying/query-profiles.html#query-profile-variants">query profile variants</a>.
142148
This allows you to set different query parameters for a query type depending on these deployment attributes.
143149
</p>
144150
<p>
145151
To use this feature, create a regular query profile variant with any of
146-
<code>instance</code>, <code>environment</code> and <code>region</code> as dimension names and
152+
<code>application</code>, <code>instance</code>, <code>environment</code> and <code>region</code> as dimension names and
147153
let your query profile vary by that. For example:
148154
</p>
149155
<pre>{% highlight xml %}
150156
<query-profile id="default">
151157

152-
<dimensions>instance, environment, region</dimensions>
158+
<dimensions>application, instance, environment, region</dimensions>
153159

154160
<field name="a">My default value</field>
155161

156162
<!-- Value for (any deployment of) the beta instance -->
157-
<query-profile for="beta">
163+
<query-profile for="*, beta">
158164
<field name="a">My beta value</field>
159165
</query-profile>
160166

161167
<!-- Value for (any) dev deployment -->
162-
<query-profile for="*, dev">
168+
<query-profile for="*, *, dev">
163169
<field name="a">My dev value</field>
164170
</query-profile>
165171

166172
<!-- Value for the default instance in prod -->
167-
<query-profile for="default, prod">
173+
<query-profile for="*, default, prod">
168174
<field name="a">My main instance prod value</field>
169175
</query-profile>
170176

171177
</query-profile>
172178
{% endhighlight %}</pre>
173179
<p>You can pick and combine these dimensions in any way you want with other dimensions sent as query parameters, e.g:</p>
174180
<pre>{% highlight xml %}
175-
<dimensions>device, instance, usecase</dimensions>
181+
<dimensions>device, application, instance, usecase</dimensions>
176182
{% endhighlight %}</pre>

0 commit comments

Comments
 (0)