Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
158 lines (152 sloc) 5.98 KB
---
title: "Getting Started"
---
<p>
Vespa Cloud is at the moment <a href="mailto:info@vespa.ai?subject=Sign+me+up!">invite only</a>.
</p><p>
To get started, create an application in the <a href="http://console.vespa.ai/">console</a>.
This requires a Google or GitHub account.
Click "Create application" and enter application name.
</p><p>
Prerequisites for the sample apps are git and a X.509 certificate.
A certificate is also generated below.
</p>
<ol>
<li>
<p>
<strong>Download the
<a href="https://github.com/vespa-engine/sample-apps/tree/master/album-recommendation">album-recommendation</a>
sample app</strong>
<pre>
$ git clone https://github.com/vespa-engine/sample-apps.git &amp;&amp; cd sample-apps/album-recommendation
</pre>
</p>
</li>
<li>
<p>
<strong>Create a self-signed certificate</strong><!-- use ec:<(openssl ecparam -name prime256v1) for elliptic curve keys -->
<pre>
$ 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
</pre>
Alternatively, copy existing keys to current work dir.
More details in <a href="security-model#data-plane">Data Plane</a>,
see <em>Client certificate</em>.
</p>
</li>
<li>
<p>
<strong>Create the application package</strong>
<pre>
$ mkdir -p src/main/application/security &amp;&amp; cp data-plane-public-cert.pem src/main/application/security/clients.pem
$ cd src/main/application &amp;&amp; zip -r ../../../application.zip . &amp;&amp; cd ../../..
</pre>
</p>
</li>
<li>
<p>
<strong>Deploy the application</strong>
</p><p>
In the Vespa console, click <em>Deploy</em> on the application created in the start of this guide.
In the "Deploy to dev" section, upload <em>application.zip</em> - click <em>Deploy</em>.
</p><p>
Now is a good time to read <a href="http://cloud.vespa.ai/automated-deployments">automated-deployments</a>,
as first time deployments takes a few minutes.
Track progress in <em>Deploy application</em> and <em>Install application</em> panes.
Seeing CERTIFICATE_NOT_READY / PARENT_HOST_NOT_READY / LOAD_BALANCER_NOT_READY is normal.
The endpoint URL is printed in the <em>Install application</em> section when the deployment is successful -
copy this for the next step.
</p>
</li>
<li>
<p>
<strong>Click <em>Instances</em> at the top, then <em>endpoints</em></strong>
</p><p>
Try the endpoint to validate it is up:
<pre>
$ ENDPOINT=https://end.point.name
$ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem $ENDPOINT
</pre>
</p>
</li>
<li>
<p>
<strong>Feed documents</strong>
<pre>
$ 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
</pre>
</p>
</li>
<li>
<p>
<strong>Recommend albums</strong>
</p><p>
Send user profile in query, find recommended albums in the result set:
<pre>
$ curl --cert data-plane-public-cert.pem --key data-plane-private-key.pem \
"$ENDPOINT/search/?ranking=rank_albums&amp;yql=select%20%2A%20from%20sources%20%2A%20where%20sddocname%20contains%20%22music%22%3B&amp;ranking.features.query(user_profile)=%7B%7Bcat%3Apop%7D%3A0.8%2C%7Bcat%3Arock%7D%3A0.2%2C%7Bcat%3Ajazz%7D%3A0.1%7D"
</pre>
</p>
</li>
<li>
<p>
<strong>Explore the <em>album-recommendation</em> sample app</strong>
</p><p>
Find details on how the simple recommendation engine was made in the
<a href="https://github.com/vespa-engine/sample-apps/blob/master/album-recommendation/README.md">README</a>.
</p>
</li>
</ol>
<hr />
<p>
Next steps:
<ol>
<li>
<p>
<strong>Explore a sample app with custom java code</strong>
</p><p>
Try <a href="https://github.com/vespa-engine/sample-apps/tree/master/album-recommendation-java">album-recommendation-java</a>.
</p>
</li>
<li>
<p>
<strong>Implement a system and staging test</strong>
</p><p>
Vespa Cloud has a secure, feature-rich, continuous deployment pipeline - read more in
<a href="automated-deployments">automated deployments</a>.
</p>
</li>
<li>
<p>
<strong>Deploy to a production zone</strong>
</p><p>
Deploy a <a href="security-model">secure</a> production application.
</p>
</li>
</ol>
</p>
<h2 id="troubleshooting">Troubleshooting</h2>
<ul>
<li>
<strong>Slow deployments:</strong>
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
</li><li>
<strong>HTTP: 502 — Bad Gateway:</strong> 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.
</li><li>
<strong>Retrying — request failed: Java heap space:</strong> 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).
</li>
</ul>
You can’t perform that action at this time.