buildpacks / pack

CLI for building apps using Cloud Native Buildpacks
https://buildpacks.io
Apache License 2.0
2.59k stars 289 forks source link

`pack suggest-stacks` #156

Closed ekcasey closed 5 years ago

ekcasey commented 5 years ago

Background Assumptions

pack support both app developers and buildpacks authors.

We expect: # of app developers >> # of buildpack authors >> # of stack maintainers

Therefore our users will naturally include app developers who want to consume a builder image and a smaller contingent of buildpack authors who want to consume a stack.

(we don't meaningfully support the use cases of stack maintainers yet)

Problem statement:

When buildpack authors are creating a builder, the stack section of the builder.toml is required. However, it's currently hard to discover what existing stacks are available to use. This might lead users to try to create their own stack when an existing stack could have worked for them, which is less than ideal (they won't get the security benefits of using a maintained stack, and support and guidance for creating a stack is slim).

Proposed Solution:

In the same way that pack suggest-builders helps app developers find an appropriate builder image (complete with buildpacks), pack suggest-stacks can help aspiring buildpack authors find an appropriate stack.

When I run pack suggest-stacks Then I see the following output

$ pack suggest-stacks

Stacks maintained by the Cloud Native Buildpacks project:

    Stack ID: io.buildpacks.stacks.bionic
    Maintainer: Cloud Native Buildpacks
    Desciption: Minimal bionic images
    Build Image: cnbs/build:bionic
    Run Image: cnbs/run:bionic

Stacks maintained by the community:

    Stack ID: heroku-18
    Maintainer: Heroku
    Desctipion: (TO BE PROVIDED BY HEROKU)
    Build Image: heroku/pack:18-build
    Run Image: heroku/pack:18

    Stack ID: org.cloudfoundry.stacks.cflinuxfs3
    Maintainer: Cloud Foundry
    Desctipion: (TO BE PROVIDED BY CLOUD FOUNDRY)
    Build Image: cfbuildpacks/cflinuxfs3-cnb-experimental:build
    Run Image: cfbuildpacks/cflinuxfs3-cnb-experimental:run
mgibson1121 commented 5 years ago

@ekcasey Great story 👍

ameyer-pivotal commented 5 years ago

@mgibson1121 @ekcasey Thoughts on alignment for the output? Any opposition to something like this?

    Stack ID:    io.buildpacks.stacks.bionic
    Maintainer:  Cloud Native Buildpacks
    Desciption:  Minimal bionic images
    Build Image: cnbs/build:bionic
    Run Image:   cnbs/run:bionic
mgibson1121 commented 5 years ago

@ameyer-pivotal lgtm, but upon re-reading, maybe description should be first?

ameyer-pivotal commented 5 years ago

@mgibson1121 FYI, we decided against the alignment suggestion because it looked weird

mgibson1121 commented 5 years ago

This story passes acceptance

ekcasey commented 5 years ago

done on master, will ship in v0.3.0