summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2019-10-07 17:29:23 +0200
committerGitHub <noreply@github.com>2019-10-07 17:29:23 +0200
commit01d6eb22a024c7dc5d5a72ff6fcc32ee49097b54 (patch)
tree03fcb68fa77f856bf0c8959bb8fbc49e1783dc61
parent5bedd856c54812faa780d52236c1cf6394ed3fd9 (diff)
parenta6069a4ccd7453d9ed0133465fbdffae02d3c06a (diff)
Merge pull request #10904 from vespa-engine/bratseth/allow-deployment-instances
Allow deployment instances
-rw-r--r--config-model/src/main/resources/schema/deployment.rnc44
-rw-r--r--config-model/src/test/schema-test-files/deployment-with-instances.xml54
-rwxr-xr-xconfig-model/src/test/sh/test-schema.sh4
3 files changed, 90 insertions, 12 deletions
diff --git a/config-model/src/main/resources/schema/deployment.rnc b/config-model/src/main/resources/schema/deployment.rnc
index 7b15a1c062d..1e1d9ad3aa9 100644
--- a/config-model/src/main/resources/schema/deployment.rnc
+++ b/config-model/src/main/resources/schema/deployment.rnc
@@ -7,13 +7,37 @@ start = element deployment {
attribute major-version { text }? &
attribute athenz-domain { xsd:string }? &
attribute athenz-service { xsd:string }? &
- Upgrade? &
- BlockChange* &
- Notifications? &
- Endpoints? &
- Test? &
- Staging? &
- Prod*
+ Step
+}
+
+Step =
+ StepExceptInstance &
+ Instance*
+
+StepExceptInstance =
+ Delay* &
+ ParallelInstances* &
+ Upgrade? &
+ BlockChange* &
+ Notifications? &
+ Endpoints? &
+ Test? &
+ Staging? &
+ Prod*
+
+Instance = element instance {
+ attribute id { xsd:string } &
+ attribute athenz-domain { xsd:string }? &
+ attribute athenz-service { xsd:string }? &
+ StepExceptInstance
+}
+
+ParallelRegions = element parallel {
+ Region*
+}
+
+ParallelInstances = element parallel {
+ Instance*
}
Upgrade = element upgrade {
@@ -57,7 +81,7 @@ Prod = element prod {
attribute tester-flavor { xsd:string }? &
Region* &
Delay* &
- Parallel*
+ ParallelRegions*
}
Region = element region {
@@ -71,10 +95,6 @@ Delay = element delay {
attribute seconds { xsd:long }?
}
-Parallel = element parallel {
- Region*
-}
-
EndpointRegion = element region {
text
}
diff --git a/config-model/src/test/schema-test-files/deployment-with-instances.xml b/config-model/src/test/schema-test-files/deployment-with-instances.xml
new file mode 100644
index 00000000000..e23404df093
--- /dev/null
+++ b/config-model/src/test/schema-test-files/deployment-with-instances.xml
@@ -0,0 +1,54 @@
+<!-- Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
+<deployment version='1.0' major-version='6' athenz-domain='vespa' athenz-service='service'>
+ <upgrade policy='canary'/>
+
+ <test/>
+ <staging/>
+
+ <block-change revision='true' version='false' days="mon,tue" hours="14,15"/>
+
+ <instance id="one,two">
+ <block-change days="mon,tue" hours="14,15" time-zone="CET"/>
+ <prod global-service-id='qrs' athenz-service='other-service'>
+ <region active='true'>us-west-1</region>
+ <delay hours='3'/>
+ <region active='true'>us-central-1</region>
+ <delay hours='3' minutes='7' seconds='13'/>
+ <region active='true'>us-east-3</region>
+ <parallel>
+ <region active='true'>us-north-1</region>
+ <region active='true'>us-south-1</region>
+ </parallel>
+ <parallel>
+ <region active='true'>us-north-2</region>
+ <region active='true'>us-south-2</region>
+ </parallel>
+ </prod>
+ <endpoints>
+ <endpoint id="foo" container-id="bar">
+ <region>us-east</region>
+ </endpoint>
+ <endpoint container-id="bar" />
+ </endpoints>
+ </instance>
+
+ <delay hours='2'/>
+
+ <parallel>
+ <instance id="three">
+ <test/>
+ <staging/>
+ </instance>
+ <instance id="four" athenz-service='four-service' athenz-domain='my-domain'>
+ <upgrade policy='conservative'/>
+ <block-change days="mon,tue,wed" hours="14,15"/>
+ <prod>
+ <region active='true'>us-central-1</region>
+ </prod>
+ <endpoints>
+ <endpoint container-id="barz" />
+ </endpoints>
+ </instance>
+ </parallel>
+
+</deployment>
diff --git a/config-model/src/test/sh/test-schema.sh b/config-model/src/test/sh/test-schema.sh
index e037cdf3c28..4b34d975c0d 100755
--- a/config-model/src/test/sh/test-schema.sh
+++ b/config-model/src/test/sh/test-schema.sh
@@ -25,6 +25,10 @@ cmd="java -jar $jar target/generated-sources/trang/resources/schema/deployment.r
echo $cmd
$cmd
+cmd="java -jar $jar target/generated-sources/trang/resources/schema/deployment.rng src/test/schema-test-files/deployment-with-instances.xml"
+echo $cmd
+$cmd
+
cmd="java -jar $jar target/generated-sources/trang/resources/schema/validation-overrides.rng src/test/schema-test-files/validation-overrides.xml"
echo $cmd
$cmd