Follow these steps to deploy a Vespa application which includes Java components to the dev zone on Vespa Cloud (for free).
Alternative versions of this guide:
Prerequisites:
Steps:
Create a tenant on Vespa Cloud:
Go to console.vespa-cloud.com and create your tenant (unless you already have one).
Install the Vespa CLI using Homebrew:
$ brew install vespa-cli
Windows/No Homebrew? See the Vespa CLI page to download directly.
Configure the Vespa client:
$ vespa config set target cloud && \
vespa config set application tenant-name.myapp
$ export VESPA_CLI_HOME=$PWD/.vespa TMPDIR=$PWD/.tmp $ mkdir -p $TMPDIR $ vespa config set target cloud $ vespa config set application vespa-team.album-rec-java
Use the tenant name from step 2.
Get Vespa Cloud control plane access:
$ vespa auth login
$ export VESPA_CLI_API_KEY="$(echo "$VESPA_TEAM_API_KEY" | openssl base64 -A -a -d)"
Follow the instructions from the command to authenticate.
Clone a sample application:
$ vespa clone album-recommendation-java myapp && cd myapp
See sample-apps for other sample apps you can clone.
Add a certificate for data plane access to the application:
$ vespa auth cert
Build the application:
$ mvn -U package
Deploy the application:
$ vespa deploy --wait 600
The first deployment may take a few minutes while nodes are provisioned.
$ vespa feed src/test/resources/*.json
Run queries:
$ vespa query "select * from music where album contains 'head'"
$ vespa query \
"select * from music where true" \
"ranking=rank_albums" \
"ranking.features.query(user_profile)={{cat:pop}:0.8,{cat:rock}:0.2,{cat:jazz}:0.1}"
Congratulations, you have deployed your first Vespa application! Application instances in the dev zone will by default keep running for 14 days after the last deployment. You can control this in the console.