An application package is a set of files in a specific structure that defines a deployable application.
It contains all the configuration, components and machine-learned models that is necessary to deploy
and run the application: No configuration is ever done locally on Vespa nodes or over remote APIs.
The application package is a directory, containing at minimum services.xml.
Additionally, services.xml might consume other files or directories from the application package -
see the reference for a full list.
A change to code and configuration is atomically deployed to running instances.
To ensure code and config consistency, config definition
files are compiled to Java code.
With this code/config discrepancies will make the build fail - this is better than production errors.
Read more in configuring components.
Note:
See automated deployments
for how to build a pipeline including tests to fully safeguard a new deployment.
Deploy
Deploy the application package using vespa deploy:
# Deploy an application package from cwd$ vespa deploy
# Deploy an application package from cwd to a prod zone with CD pipeline in Vespa Cloud using deployment.xml$ vespa prod deploy
At deployment, the application package is validated, and destructive changes rejected.
Read more on how to handle application package changes in
validation overrides.
Make changes to schemas,
like adding a field, then deploy.
Most such changes do not require restarts or re-indexing, if they do, deployment fails,
and a validation override might be required - read more.
Convergence
Refer to the deploy reference
for detailed steps run when deploying an application.
Use the /application/v2/tenant API
to validate that the configuration is deployed and activated on all nodes, like
http://localhost:19071/application/v2/tenant/default/application/default/environment/prod/region/default/instance/default/serviceconverge
- example output:
When new components or files specified in config are distributed, the container gets a new file reference,
waits for it to be available and switches to new config when all files are available.
Most application packages are stored as source code in a code repository.
However, some resources are generated and/or too large to store in a code repository,
like models or an FSA.
Machine learned models in Vespa, either TensorFlow,
ONNX, XGBoost, or
LightGBM,
are stored in the application package under the models directory.
This might be inconvenient for some applications,
for instance for models that are frequently retrained on some remote system.
Also, models might be too large to fit within the constraints of the version control system.
The solution is to download the models from the remote location during the application package build.
This is simply implemented by adding a step in pom.xml
(see example):
Any necessary credentials for authentication and authorization should be added to this script,
as well as any unpacking of archives (for TensorFlow models for instance).
Also see the url config type to download resources to container nodes.
services.xml
services.xml specifies the services that makes the application -
each top-level element specifies one service. Example:
Important:
The prepare step does not validate
all changes.
E.g., the container itself is not started with the bundles and bundle configuration at prepare-time.