Skip to content

Latest commit

 

History

History
 
 

part-purchases-demo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

__

Vespa sample applications - Part Purchases Demo

A sample Vespa application to assist with with learning how to group according to the Grouping Guide

Check-out, compile and run:

$ git clone https://github.com/vespa-engine/sample-apps.git
$ VESPA_SAMPLE_APPS=`pwd`/sample-apps
$ docker run --detach --name vespa --hostname vespa-container --privileged \
  --volume $VESPA_SAMPLE_APPS:/vespa-sample-apps --publish 8080:8080 vespaengine/vespa

Wait for the configserver to start:

$ docker exec vespa bash -c 'curl -s --head http://localhost:19071/ApplicationStatus'

Deploy the application:

$ docker exec vespa bash -c '/opt/vespa/bin/vespa-deploy prepare /vespa-sample-apps/part-purchases-demo/src/main/application && \
  /opt/vespa/bin/vespa-deploy activate'

Wait for the application to start:

$ curl -s --head http://localhost:8080/ApplicationStatus

Generate sample from csv

 python ./parts.py -f purchase.csv > purchase.json

Feed the sample data

$ docker exec vespa bash -c 'java -jar /opt/vespa/lib/jars/vespa-http-client-jar-with-dependencies.jar \
      --verbose --file /vespa-sample-apps/part-purchases-demo/purchase.json --host localhost --port 8080';