Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

#Vespa

Vespa sample applications - Multiple bundles

This sample application demonstrates how to build an application that has split some of its code into a separate bundle. The extra bundle for this application is found in multiple-bundles-lib .

Refer to container components and the bundle plugin for more information.

Docker requirements same as in the quick-start.

Executable example

Validate environment, must be minimum 4G:

Refer to Docker memory for details and troubleshooting:

$ docker info | grep "Total Memory"
or
$ podman info | grep "memTotal"

Check-out, compile and run:

$ git clone --depth 1 https://github.com/vespa-engine/sample-apps.git

Build the "library" bundle:

$ (cd sample-apps/examples/multiple-bundles-lib && mvn clean install)

Build the main bundle and start the docker container:

$ cd sample-apps/examples/multiple-bundles && mvn clean verify
$ docker run --detach --name vespa --hostname vespa-container \
  --publish 127.0.0.1:8080:8080 --publish 127.0.0.1:19071:19071 \
  vespaengine/vespa

Wait for the configserver to start - wait for HTTP/1.1 200 OK:

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

Deploy the application:

$ curl --header Content-Type:application/zip --data-binary @target/application.zip \
  localhost:19071/application/v2/tenant/default/prepareandactivate

Wait for the application to start:

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

Test the application:

$ curl -s http://localhost:8080/search/

Sending multiple requests generates the Fibonacci number sequence in the 'message' field of the search result.

Shutdown and remove the container:

$ docker rm -f vespa