Getting to Production
This guide assumes you have gone through the Getting Started guide
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 Getting Started Custom Code 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 -P fat-test-application 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
WARNING! Following this guide will remove production instances and all data within them. The data is unrecoverable.
To safe-guard against accidentally removing production applications, there are multiple steps involved in deprovisioning an application:
- Remove the deployment from
<deployment version="1.0" />
- Add a
validation-overrides.xmlfile. This will allow Vespa Cloud to remove production deployments:
<validation-overrides> <allow until="2020-02-28" comment="Removing aws-us-east-1c">deployment-removal</allow> </validation-overrides>
- Build the application package and submit as normal