Follow these steps to deploy an application to the dev zone in the Vespa Cloud. Find more details and tips in the developer guide. Alternative versions of this guide:
Prerequisites:
Install the Vespa client:
Using Homebrew:
$ brew install vespa-cli
Alternatively, download it for Windows, Linux and macOS.
Create a tenant in the Vespa Cloud:
Create a tenant at console.vespa-cloud.com (unless you already have one). This requires a Google or GitHub account, and will start your free trial. Make note of the tenant name, it is used in the next steps.
Configure the Vespa client:
$ vespa config set target cloud && \
vespa config set application tenant-name.myapp
Use the tenant name from step 2.
This guide uses myapp
as application name and default
as instance name -
learn more.
Authorize Vespa Cloud access:
$ vespa auth login
Follow the instructions from the command to authenticate.
Get a sample application:
$ vespa clone album-recommendation myapp && cd myapp
An application package is the full application configuration. See sample-apps for a full list.
Add public certificate:
$ vespa auth cert
This creates a self-signed certificate for application data plane access (reads and writes), and adds it to the application package files. See the security model for more details.
Deploy the application:
$ vespa deploy --wait 600
The first deployment will take a few minutes while nodes are provisioned - track progress using the link in the response. Subsequent deployments on existing nodes will be quicker.
Feed documents:
$ vespa feed ext/*.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}"
These requests use the Query API.
Vespa sample applications is a repository of applications that can be deployed on a local machine or in Vespa Cloud. These are great resources to get more familiar with Vespa. To deploy using Vespa Cloud, run the following steps instead:
$ git clone --depth 1 https://github.com/vespa-engine/sample-apps.git && \ cd sample-apps/the-sample-application $ vespa clone the-sample-application myapp && \ cd myapp
vespa deploy
, do this instead, using your own tenant name:
$ vespa config set target cloud && \
vespa config set application tenant-name.myapp
$ vespa auth login
$ vespa auth cert
$ vespa deploy --wait 600
The data-plane credentials used by the Vespa CLI are stored in .vespa - sample output:
Success: Certificate written to /Users/me/.vespa/mytenant.myapp.default/data-plane-public-cert.pem Success: Private key written to /Users/me/.vespa/mytenant.myapp.default/data-plane-private-key.pem
Check VPN settings / network if vespa auth login
returns
auth0: failed to get device flow config:
Get "https://api-ctl.vespa-cloud.com:4443/auth0/v1/device-flow-config":
read tcp 10.120.68.54:59179->174.129.25.61:4443: read: connection reset by peer
.