Getting Started

Vespa Cloud is at the moment invite only.

To get started, create an application in the console. This requires a Google or GitHub account. Click "Create application" and enter application name.

Prerequisites for the sample apps are git and a X.509 certificate. A certificate is also generated below.

  1. Download the album-recommendation sample app

    $ git clone https://github.com/vespa-engine/sample-apps.git && cd sample-apps/album-recommendation
    

  2. Create a self-signed certificate

    $ openssl req -x509 -nodes -days 14 -newkey rsa:4096 \
      -subj "/C=NO/ST=Trondheim/L=Trondheim/O=My Company/OU=My Department/CN=example.com" \
      -keyout data-plane-private-key.pem -out data-plane-public-cert.pem
    
    Alternatively, copy existing keys to current work dir. More details in Data Plane, see Client certificate.

  3. Create the application package

    $ mkdir -p src/main/application/security && cp data-plane-public-cert.pem src/main/application/security/clients.pem
    $ cd src/main/application && zip -r ../../../application.zip . && cd ../../..
    

  4. Deploy the application

    In the Vespa console, click Deploy on the application created in the start of this guide. In the "Deploy to dev" section, upload application.zip - click Deploy.

    Now is a good time to read automated-deployments, as first time deployments takes a few minutes. Track progress in Deploy application and Install application panes. Seeing CERTIFICATE_NOT_READY / PARENT_HOST_NOT_READY / LOAD_BALANCER_NOT_READY is normal. The endpoint URL is printed in the Install application section when the deployment is successful - copy this for the next step.

  5. Click Instances at the top, then endpoints

    Try the endpoint to validate it is up:

    $ ENDPOINT=https://end.point.name
    $ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem $ENDPOINT
    

  6. Feed documents

    $ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \
      -H "Content-Type:application/json" --data-binary @src/test/resources/A-Head-Full-of-Dreams.json \
      $ENDPOINT/document/v1/mynamespace/music/docid/1
    $ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \
      -H "Content-Type:application/json" --data-binary @src/test/resources/Love-Is-Here-To-Stay.json \
      $ENDPOINT/document/v1/mynamespace/music/docid/2
    $ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \
      -H "Content-Type:application/json" --data-binary @src/test/resources/Hardwired...To-Self-Destruct.json \
      $ENDPOINT/document/v1/mynamespace/music/docid/3
    

  7. Recommend albums

    Send user profile in query, find recommended albums in the result set:

    $ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \
    "$ENDPOINT/search/?ranking=rank_albums&yql=select%20%2A%20from%20sources%20%2A%20where%20sddocname%20contains%20%22music%22%3B&ranking.features.query(user_profile)=%7B%7Bcat%3Apop%7D%3A0.8%2C%7Bcat%3Arock%7D%3A0.2%2C%7Bcat%3Ajazz%7D%3A0.1%7D"
    

  8. Explore the album-recommendation sample app

    Find details on how the simple recommendation engine was made in the README.


Next steps:

  1. Explore a sample app with custom java code

    Try album-recommendation-java.

  2. Implement a system and staging test

    Vespa Cloud has a secure, feature-rich, continuous deployment pipeline - read more in automated deployments.

  3. Deploy to a production zone

    Deploy a secure production application.

Troubleshooting

  • Slow deployments: First time deployments takes a few minutes, seeing CERTIFICATE_NOT_READY / PARENT_HOST_NOT_READY / LOAD_BALANCER_NOT_READY is normal. "Installation succeeded!" in the bottom pane indicates success
  • HTTP: 502 — Bad Gateway: This means the endpoint is not ready, or failing. A Vespa software upgrade will cause this — the application will then be unavailable for 15 minutes or so, as dev instances are not redundant. Look for stopping services in logs to check for this.
  • Retrying — request failed: Java heap space: If this happens when deploying from the laptop, mvn runs out of memory. Use export MAVEN_OPTS=-Xmx3g to increase the heap size to 3G (or larger as needed).