pyvespa icon indicating copy to clipboard operation
pyvespa copied to clipboard

Instructions on deploying to Vespa Cloud Prod

Open neo-anderson opened this issue 1 year ago • 11 comments

It seems like the process for deploying to Prod is different from dev deployments. Prod deployment page asks for 2 zip files. I downloaded the application zip file from Vespa Cloud, but I see that it's possible to do this with to_files call. However, I'm not sure how to generate the test package. Please help me understand the process.

neo-anderson avatar Nov 10 '22 21:11 neo-anderson

pyvespa allows only deployment to dev. pyvespa was built primarily to allow data scientists to experiment more quickly. It was not made for production use.

thigm85 avatar Nov 11 '22 00:11 thigm85

Understood. What is the right way to convert the experiment into a production app? Currently, I have a sample app in dev that I'd like to deploy to prod. I generated the application package but prod deployment requires a test package as well. Do I have to manually create json files specifying the tests to run and then do vespa prod submit ?

neo-anderson avatar Nov 11 '22 00:11 neo-anderson

@jobergum @bratseth ☝️

thigm85 avatar Nov 11 '22 08:11 thigm85

Hi, I'll get back to you shortly on this

kkraune avatar Nov 11 '22 08:11 kkraune

Hi again! The process to go from a pyvespa app to Vespa Cloud production is not as smooth as it should be, so many thanks for submitting this! I have reproduced/found the following problems:

  • The Vespa Cloud console does not allow uploading the application zip only (as you noticed) - I have created a ticket for the console to look into that
  • If there were test files in the pyvespa project, it would not generate the test zip
  • Documentation for this process in pyvespa is weak/missing

I will take a step back and look into how this process should be, document it and follow up on bug fixes. This will take a little time, I hope you are able to work around using the Vespa Cloud documentation to deploy application packages

kkraune avatar Nov 11 '22 13:11 kkraune

Thanks for looking into this.

  1. It's not just the console. vespa prod submit CLI command didn't work until I added a test package.
  2. What would test files in a pyvespa project look like?
  3. It would be great if you could include a simple test in the documentation to demonstrate the process. pyvespa generated or otherwise.

I am trying to find a work around. I'm not sure how to create a simple test to pass the checks and deploy the app to prod. Currently, I have this under tests/system-tests.

{
    "name": "Very simple test",
    "comment": "Just want to deploy",
    "steps": [
        {
            "name": "query for foo",
            "request": {
                "parameters": {
                    "yql": "select * from sources * where True"
                }
            }
        }
    ]
}

neo-anderson avatar Nov 11 '22 18:11 neo-anderson

Hi, sorry for the trouble! I think there was a code change on Vespa Cloud today for this, I am not sure if it is fully rolled out yet - you can please let me know tomorrow if the CLI still fails after testing again then.

kkraune avatar Nov 14 '22 17:11 kkraune

@mpolden does the vespa CLI require a test package for prod deployment?

kkraune avatar Nov 15 '22 06:11 kkraune

CLI itself shouldn't require a test package, but maybe the controller API does.

mpolden avatar Nov 15 '22 21:11 mpolden

Without the tests folder, this is what I get:

> vespa prod submit
Warning: We recommend doing this only from a CD job
Hint: See https://cloud.vespa.ai/en/getting-to-production
Error: could not submit application for deployment: '' should be an application package zip or dir, but does not exist

After I added a tests/system-test and a test file:

Warning: We recommend doing this only from a CD job
Hint: See https://cloud.vespa.ai/en/getting-to-production
Success: Submitted . for deployment
See https://console.vespa-cloud.com/tenant/dummycorp/application/myapp/prod/deployment for deployment progress

neo-anderson avatar Nov 16 '22 00:11 neo-anderson

I created https://github.com/vespa-engine/vespa/issues/24907 to track this issue wrt. to Vespa CLI.

mpolden avatar Nov 17 '22 10:11 mpolden