Forum: Other

Post: XML Schema for project.xml

XML Schema for project.xml
eribeiro
May 18, 2010
I would suggest to create a XML Schema for the project.xml. A xml schema would be great when it comes to validate the project.xml created. In fact, I have already created a half baked xsd. If you are interested then I can post it here.

Best regards,
Edward
Project file schema
rbetts
May 18, 2010
Edward,

A schema exists. In fact, we use it internally with JAXB to parse our project files. You can find it in the repository at:
trunk/src/frontend/org/voltdb/compiler/ProjectFileSchema.xsd

Thank you,
*--Ryan.
Cool. I didn't access the SVN
eribeiro
May 18, 2010
Cool. I didn't access the SVN repo already, but it's good to know that it's already there.

Thanks,
Edward
Could the XSD files be hosted
kdombeck
Nov 2, 2010
Could the XSD files be hosted for project.xml and deployment.xml?

Example:

<?xml version="1.0"?>
<deployment xmlns="http://www.voltdb.com/schema/deployment"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.voltdb.com/schema/deployment http://www.voltdb.com/schema/deployment/DeploymentFileSchema-1.0.xsd">
<cluster hostcount="1"
sitesperhost="2"
leader="localhost" />
</deployment>


Also it would be nice if it was included in your sample xml files that are provided.
project and deployment schema locations
rbetts
Nov 4, 2010
Could the XSD files be hosted for project.xml and deployment.xml?


We will add the deployment and project files to the distribution kit. You can follow that task here, if you wish: https://issues.voltdb.com/browse/ENG-871.

We expose source via Jira's fisheye tool (https://source.voltdb.com). We also have a non-ssl svn mirror with http access. This effectively hosts the schemas by branch and tag. Our svn repository uses the usual svn branches/trunk/tags conventions.

http://svnmirror.voltdb.com/eng/trunk/src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd

http://svnmirror.voltdb.com/eng/trunk/src/frontend/org/voltdb/compiler/ProjectFileSchema.xsd

*--Ryan.
==
EDIT: We've switched to GitHub since this post, so these links won't work.
snapshot myth
alexlzl
Feb 10, 2011
I am trying to enable auto snapshot with Voltdb 1.2.1.02. The online documentation is so out of date, and I couldn't find a good example of a working deployment.xml. So I took the "try and fail" path. Unfortunately, based on your published schema here: http://svnmirror.voltdb.com/eng/trunk/src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd, the following deployment.xml should work:
<?xml version="1.0"?>
<deployment>
<cluster hostcount="2" sitesperhost="6" leader="10.5.80.64" kfactor="1" />
<snapshot frequency="3m" retain="10" prefix="keyvalue" />
<paths>
<voltroot path="/glass/booyah/voltdb" />
<snapshots path="/glass/booyah/voltdb/autobackup/" />
</paths>
</deployment>


However, the error message I got when starting the server is below, any idea why? I thought "users" and "httpd" are optional?
ERROR 2011-02-11 01:38:33,693 [main] HOST: Error schema validating deployment.xml file. cvc-complex-type.2.4.a: Invalid content was found starting with element 'snapshot'. One of '{users, httpd}' is expected.
Help with finding the schema
rbetts
Feb 10, 2011
I am trying to enable auto snapshot with Voltdb 1.2.1.02. The online documentation is so out of date, and I couldn't find a good example of a working deployment.xml. So I took the "try and fail" path. Unfortunately, based on your published schema here:

http://svnmirror.voltdb.com/eng/trunk/src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd
, the following deployment.xml should work:..


Sorry for your frustration. Our 1.2 deployment schema differs from the schema currently available on the trunk. You can find the 1.2.1.x schema here:

http://svnmirror.voltdb.com/eng/branches/voltdb-1.2.1/src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd

However, on 1.2.1, the auto-snapshot functionality is configured via the project file, which is different from the deployment file. The project file schema for 1.2.1 is here:
http://svnmirror.voltdb.com/eng/branches/voltdb-1.2.1/src/frontend/org/voltdb/compiler/ProjectFileSchema.xsd

We have tried to separate "application" or project description from configuration that might differ across multiple deployments (for example, a QA deployment and a production deployment) of the same application. Thus the two separate files.
Is this the section of the documentation you found unsatisfactory?

https://community.voltdb.com/docs/UsingVoltDB/SaveSnapshotAuto


Reading that quickly, it appears correct to me. Of course we always welcome feedback and corrections.
If it is any consolation - we will be adding the schema to our download distribution in our next release, as is tracked here:
https://issues.voltdb.com/browse/ENG-871
to clarify
alexlzl
Feb 14, 2011
Sorry for your frustration. Our 1.2 deployment schema differs from the schema currently available on the trunk. You can find the 1.2.1.x schema here:
http://svnmirror.voltdb.com/eng/branches/voltdb-1.2.1/src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd ...


Thank you for the explanation. To clarify, does that mean: currently on 1.2 release the snapshot is part of project.xml is a "mistake", and in trunk/future release, it will be moved to deployment.xml?

I hope that's the case, to me, snapshot should be a configuration property set at deployment time (different for each environment). However project.xml is for development time and exist inside the catalog jar file. This means either I have to build a different jar for each environment (which violates the rule of same build for all env), or I have to play stunts to replace the value inside the jar before deployment.

Also, where can I find documentation about "partition-detection"? What's the purpose of its own "snapshot" child element?
re: clarification
rbetts
Feb 16, 2011
Thank you for the explanation. To clarify, does that mean: currently on 1.2 release the snapshot is part of project.xml is a "mistake", and in trunk/future release, it will be moved to deployment.xml?...


snapshot should be a configuration property set at deployment time (different for each environment). However project.xml is for development time and exist inside the catalog jar file. This means either I have to build a different jar for each environment (which violates the rule of same build for all env), or I have to play stunts to replace the value inside the jar before deployment.
In 1.3, all snapshot configuration is moved to the deployment file. While we always intended to separate project content from deployment content, the implementation of the deployment file is relatively new; we made some changes, hopefully improvements, to the organization of the project and deployment configuration in 1.3.

Also, where can I find documentation about "partition-detection"? What's the purpose of its own "snapshot" child element?

Partition detection is documented here:




KsafeNetPart