knative / func

Knative Functions client API and CLI
Apache License 2.0
275 stars 138 forks source link

Replace usage of pack CLI libraries with the buildpack lifecycle reference implementation #181

Closed lance closed 3 years ago

lance commented 3 years ago

The pack CLI is an implementation of buildpack's platform specification and is an opinionated tool designed specifically for users who have a Docker daemon running on their development machine. But this is not a necessary requirement for conforming to the buildpack specification. We need to remove the usage of the pack libraries and replace that with direct usage of the lifecycle reference implementation. This will allow us to fully control the user experience and prerequisites for creating Function images.

I think it should probably be one of the first things we tackle after Dev Preview is out. I say "partial" implementation above, because the platform spec has things like detection in it that we can forego, since we deal directly with builder images and have enough information in faas.yaml to know how to build the project anyway.

Per the spec,

a single app image build consists of the following phases:

  1. Detection
  2. Analysis
  3. Cache Restoration
  4. Build*
  5. Export

A platform MUST execute these phases either by invoking the following phase-specific lifecycle binaries in order:

  1. /cnb/lifecycle/detector
  2. /cnb/lifecycle/analyzer
  3. /cnb/lifecycle/restorer
  4. /cnb/lifecycle/builder
  5. /cnb/lifecycle/exporter

or by executing /cnb/lifecycle/creator.

See: https://github.com/buildpacks/lifecycle/blob/main/cmd/lifecycle/creator.go

lance commented 3 years ago

Closing this as we have decided this is not the route we should take.