How to host a Vespa application on the cloud
pip install pyvespa
This tutorial assumes that a Vespa application package was defined and stored in the variable
app_package. To illustrate this tutorial, we will use a basic question answering app from our gallery.
from vespa.gallery import QuestionAnswering app_package = QuestionAnswering()
app_packageon Vespa Cloud, you need to login into your account first. You can create one and give it a try for free.
TENANT_NAMEenv variable in the example below.
USER_KEYenv variable to be the path to the downloaded user key.
from vespa.deployment import VespaCloud vespa_cloud = VespaCloud( tenant=os.getenv("TENANT_NAME"), application=os.getenv("APPLICATION_NAME"), key_location=os.getenv("USER_KEY"), application_package=app_package, )
We can have multiple instances of the same application, we can then chose a valid
INSTANCE_NAME to identify the instance created here and set the
DISK_FOLDER to a local path to hold deployment related files such as certifications and Vespa config files.
app = vespa_cloud.deploy( instance=os.getenv("INSTANCE_NAME"), disk_folder=os.getenv("DISK_FOLDER") )
That is it, you can now interact with your deployed application through the