This lets you deploy an application 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).
Clone a sample application:
$ git clone --depth 1 https://github.com/vespa-engine/sample-apps.git && \ cd sample-apps/album-recommendation
See sample-apps for other sample apps you can clone.
Add a certificate for data plane access to the application:
On Unix or Mac, use openssl:
$ openssl req -x509 -nodes -days 14 -newkey rsa:4096 \ -subj "/CN=cloud.vespa.example" \ -keyout data-plane-private-key.pem -out data-plane-public-cert.pem
On Windows, the certificate has to be created with New-SelfSignedCertificate in PowerShell, and then exported to PEM format using certutil.
Once the certificate has been created, add it to the application package.
$ mkdir -p app/security && \ cp data-plane-public-cert.pem app/security/clients.pem
Create a deployable application package zip:
$ ( cd app && zip -r ../application.zip . )
Deploy the application:
In the console, click Deploy Application.
Use "myapp" as the application name, leave the defaults.
Make sure DEV is selected, and upload the application.zip.
Click Create and deploy.
The first deployment may take a few minutes while nodes are provisioned.
Verify the application endpoint:
$ ENDPOINT=https://name.myapp.tenant-name.aws-us-east-1c.dev.z.vespa-app.cloud/
$ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem $ENDPOINT
You can find the endpoint in the console deployment output, set it for later use and test it. You can also do this in a browser.
$ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \ -H "Content-Type:application/json" \ --data-binary @ext/A-Head-Full-of-Dreams.json \ $ENDPOINT/document/v1/mynamespace/music/docid/a-head-full-of-dreams
$ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \ -H "Content-Type:application/json" \ --data-binary @ext/Love-Is-Here-To-Stay.json \ $ENDPOINT/document/v1/mynamespace/music/docid/love-is-here-to-stay
$ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \ -H "Content-Type:application/json" \ --data-binary @ext/Hardwired...To-Self-Destruct.json \ $ENDPOINT/document/v1/mynamespace/music/docid/hardwired-to-self-destruct
Run queries:
curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \
-X POST -H "Content-Type: application/json" --data '
{
"yql": "select * from music where true",
"ranking": {
"profile": "rank_albums",
"features": {
"query(user_profile)": "{{cat:pop}:0.8,{cat:rock}:0.2,{cat:jazz}:0.1}"
}
}
}' \
$ENDPOINT/search/
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.