GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.03k stars 1.62k forks source link

Document requirements for skaffold init --analyze to detect buildpack entrypoint for Python #4377

Open j-windsor opened 4 years ago

j-windsor commented 4 years ago

Expected behavior

Cloud Code python samples (k8s and Cloud Run) do not work out of the box with skaffold buildpack builders, and it is unclear how a python project needs to be architected to cause skaffold to detect buildpacks as a builder.

It looks like this is a more general GCP buildpacks issue as well. https://github.com/GoogleCloudPlatform/buildpacks/issues/45

Information

dgageot commented 4 years ago

Buildpacks need both a requirements.txt that indicates that it's a Python project and a Procfile that indicates the entrypoint. skaffold init mimics that behaviour and requires those two files. That's not convenient but we can't really do better right now. We'd have to improve the buildpacks so that they sometimes guess the python entrypoint.

dgageot commented 4 years ago

A behaviour that is better with Buildpacks alone is that if you run a build in a Python project that only has a requirements.txt but no Procfile, it should give you a clear error message. skaffold init doesn't

j-windsor commented 4 years ago

I feel like we could at least put the requirements in documentation somewhere if it is not already.

dgageot commented 4 years ago

I wonder if we could change the way skaffold init works for Python projects and assume a project with only a requirements.txt is a valid Python project. When the user first builds that project, it would fail if there's no Procfile but at least, the message would clearly state what needs fixing. It would maybe be more aligned with users' expectations. @briandealwis wdyt?

briandealwis commented 4 years ago

It does feel like init should provide a list of caveats + suggested remedies for prospective artifacts.