Getting to Production
This guide assumes you have gone through the Quick Start
and deployed an application to the
To complete this guide you need to have Maven 3.6.1 and Java 11 installed.
Also try the album-recommendation-searcher guide - this is a complete production deployment guide.
Adding Java and Maven
To be able to deploy an application to the
the application needs tests that validate it.
These tests are executed automatically on each deployment -
see Automated Deployments.
Below we are using the files that fit with album-recommendation, the application used in the Getting Started guide.
pom.xmlfile to the application root. This is the Maven project configuration, and is needed to build with the Vespa Cloud test framework. See this example.
- Update the
pom.xmlto match the names for your tenant and application.
... <properties> ... <tenant>MYTENANT</tenant> <application>MYAPP</tenant> </properties> ...
- Add the tests that build the test framework.
These tests reside in the
src/test/javadirectory of the application. You can copy the sample tests that are in this directory.
Adding deployment files
<deployment version="1.0"> <prod> <region active="true">aws-us-east-1c</region> </prod> </deployment>
Deploying the application
Now you are ready to build and deploy the application:
- Add the compile version information to the application package:
$ mvn clean vespa:compileVersion -DapiKeyFile=$HOME/Downloads/TENANTNAME.pem
- Compile the application package with test artifacts:
$ mvn package \ -Dvespa.compile.version="$(cat target/vespa.compile.version)"
- Submit the application package to Vespa Cloud for deployment:
$ mvn vespa:submit -DapiKeyFile=$HOME/Downloads/TENANTNAME.pem
The application is now being deployed - track progress of the deployment job in the Vespa Cloud Console.
The Vespa Cloud application is now running in a production zone. Congratulations! After this you can further enhance the production application:
- Create a CI/CD pipeline (e.g. using GitHub Actions)
- For failover, deploy in multiple zones and use a global endpoint
Removing a production instance
Follow the guide at Deleting an application to remove instances or applications.