boson-project / functions

A directory of information and resources for the Boson Project.
Apache License 2.0
6 stars 5 forks source link

[bug] kn faas deploy fails when used with quay.io #24

Open nainaz opened 3 years ago

nainaz commented 3 years ago

Describe the bug For node runtime, after running kn faas build . Running kn faas deploy fails with Error: knative deployer failed to wait for the service to become ready: timeout: service 'testdaynodefunc' not ready after 60 seconds

To Reproduce Steps to reproduce the behavior:

  1. kn faas init -l node
  2. kn faas build
  3. docker images | grep
  4. kn faas deploy

Expected behavior successful deploy of the function

Screenshots

Deploying Function to cluster:
Creating Knative Service: testdaynodefunc
Waiting for Knative Service to become ready
Error: knative deployer failed to wait for the service to become ready: timeout: service 'testdaynodefunc' not ready after 60 seconds

docker images | grep testday testdayquarkfunction latest fb2b0f91d03c 40 years ago 394MB

Desktop (please complete the following information):

Additional context Looks like push to quay.io is part of deploy step and since quay.io repo needs to be made public beforehand. This fails due to unavailability of the image.

matejvasek commented 3 years ago

@nainaz isn't the repo private?

matejvasek commented 3 years ago

There is inconsistency deploy is prompting for registry whereas build is prompting for image. This should be unified. What should we do? @boson-project/core

Edit this belong to another issue.

lance commented 3 years ago

@matejvasek the problem is that we have moved the push to a registry to happen in the deploy step. However, if you are using quay.io then your first deploy will always fail the first time. You can often make the repository public in time for Knative to not give up, but still that's non-optimal. We either need to move the push to a registry back into the build step, or somehow deal with quay.io being awful.

There is inconsistency deploy is prompting for registry whereas build is prompting for image

I don't think that is the case, is it? IIRC deploy doesn't prompt unless the image has not yet been built.

lance commented 3 years ago

I don't think that is the case, is it? IIRC deploy doesn't prompt unless the image has not yet been built.

I was wrong about this. The deploy command does prompt if the image has not yet been built. But it prompts with the same thing that build prompts with.

matejvasek commented 3 years ago

I don't think that is the case, is it? IIRC deploy doesn't prompt unless the image has not yet been built.

@lance If you use -c flag you are prompted for registry, but value you enter there is ignore and value from faasyaml is used anyway, that's a bug.

matejvasek commented 3 years ago
buildConfig: buildConfig{
            Registry: prompt.ForString("Registry for Function images", c.buildConfig.Registry),
        },

// vs
return buildConfig{
        Path:    prompt.ForString("Path to project directory", c.Path),
        Image:   prompt.ForString("Image name", imageName, prompt.WithRequired(true)),
        Verbose: c.Verbose,
        // Registry not prompted for as it would be confusing when combined with explicit image.  Instead it is
        // inferred by the derived default for Image, which uses Registry for derivation.
    }