An application package is a set of files in a specific structure which defines a deployable application. See Vespa quick-start, developing applications or the Blog search tutorial for examples. An application package contains all the configuration, components and auxiliary files needed to specify how a given cloud config-enabled set of subsystems should behave to run the application. It consists of one directory named the same as the application, containing at minimum:
application/services.xml - mandatory specification of services required application/hosts.xml - mapping of host ids to physical hostsAdditionally, services.xml might consume other files or directories from the application package - a quick summary of optional content:
application/components/ - OSGi components to be deployed to container nodes. See component types application/searchdefinitions/ - Vespa document schemas, and optionally how to search them application/search/query-profiles/ - Vespa query profiles; named collections of search request parametersFor a complete list of files and directories in an application package, see the application package reference.
services.xml specifies the services that makes the application - each top-level element specifies one service. Example:
<?xml version="1.0" encoding="utf-8" ?> <services version="1.0"> <container id="default" version="1.0"> <processing/> <!-- Request-response processors go here. --> <search/> <!-- Use to run the search middleware. Searchers go here. --> <docproc/> <!-- Use to run the document processing middleware. DocumentProcessors go here. --> <nodes> <!-- Nodes in the jdisc cluster --> <node hostalias="node1"/> <node hostalias="node2"/> <node hostalias="node3"/> </nodes/> </container> <content id="my-content" version="1.0"> <redundancy>1</redundancy> <documents> <!-- Add document schemas here --> <document type="my-searchable-type" mode="index"/> <document type="my-other-type" mode="store-only"/> </documents> <nodes> <!-- # nodes in the content cluster --> <node hostalias="node4"/> <node hostalias="node5"/> <node hostalias="node6"/> </nodes/> </content> </services>Refer to the services.xml reference for different service types and configuration. The application package may also specify arbitrary binaries to be started and given configuration specified explicitly in the services file, see application-specific services.
The application's custom Java code (in components) is configured in services.xml. E.g, a port number for a remote service:
<container id="default" version="1.0"> <handler id="com.myapp.vespatest.ConfiguredHandler"> <config name="vespatest.port"> <port>12345</port> </config>Read more in configuring components.
Deploy the application package using the vespa-deploy tool. This tool uses the deploy API.
$ vespa-deploy prepare [application-path]The prepare step:
$ vespa-deploy activateThis activates the application package in the configuration servers, all configurations are propagated to services that subscribe to them.
Any change can be made to an application and be set live by calling deploy with the new application package. Vespa will by default prevent any destructive changes. To allow such changes to pass through the validation in deploy prepare, add a suitable validation-overrides.xml to your application package.
During development it can also be handy to just wipe the state of Vespa completely and start over: