Vespa quick start using Windows
This guide describes how to install and run Vespa on a single machine using Docker on Microsoft Windows 10. See Getting Started for troubleshooting, next steps and other guides.
Prerequisites:
- Docker
- Cmder full version
- Git
- Operating system: Microsoft Windows 10 Pro (Docker requirement)
- Architecture: x86_64
- At least 4GB of memory dedicated to your container instance
-
Clone the Vespa sample apps from github:
$ git clone https://github.com/vespa-engine/sample-apps.git $ set VESPA_SAMPLE_APPS="%CD%\sample-apps"
-
Start a Vespa Docker container:
$ docker run --detach --name vespa --hostname vespa-container --privileged --volume %VESPA_SAMPLE_APPS%:/vespa-sample-apps --publish 8080:8080 vespaengine/vespa
-
Wait for configuration server to start - wait for a 200 OK response:
$ docker exec vespa bash -c "curl -s --head http://localhost:19071/ApplicationStatus"
-
Deploy and activate a sample application:
$ docker exec vespa bash -c "/opt/vespa/bin/vespa-deploy prepare /vespa-sample-apps/album-recommendation-selfhosted/src/main/application" $ docker exec vespa bash -c "/opt/vespa/bin/vespa-deploy activate"
-
Ensure the application is active - wait for a 200 OK response:
$ curl -s --head "http://localhost:8080/ApplicationStatus"
-
Feed documents:
$ cat %VESPA_SAMPLE_APPS%/album-recommendation-selfhosted/src/test/resources/A-Head-Full-of-Dreams.json | curl -s -H "Content-Type:application/json" --data-binary @- "http://localhost:8080/document/v1/mynamespace/music/docid/1" $ cat %VESPA_SAMPLE_APPS%/album-recommendation-selfhosted/src/test/resources/Love-Is-Here-To-Stay.json | curl -s -H "Content-Type:application/json" --data-binary @- "http://localhost:8080/document/v1/mynamespace/music/docid/2" $ cat %VESPA_SAMPLE_APPS%/album-recommendation-selfhosted/src/test/resources/Hardwired...To-Self-Destruct.json | curl -s -H "Content-Type:application/json" --data-binary @- "http://localhost:8080/document/v1/mynamespace/music/docid/3"
-
Make a query:
$ curl -s "http://localhost:8080/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"
View query results in a browser with the query builder UI at http://localhost:8080/querybuilder/, or have a look at raw query results at http://localhost:8080/search/?query=artist:metallica. The query builder has guided queries and YQL autocompletion. Read more in the Query API.
-
Run a document get request:
$ curl -s http://localhost:8080/document/v1/mynamespace/music/docid/2
-
Clean up:
$ docker rm -f vespa