Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple BOM and build plan #139

Merged
merged 7 commits into from
Sep 8, 2020
Merged

Conversation

ekcasey
Copy link
Member

@ekcasey ekcasey commented Aug 21, 2020

Resolves #133

* Resolves #133
* Implements RFC 0053 - https://github.com/buildpacks/rfcs/blob/main/text/0053-decouple-buildpack-plan-and-bom.md

Signed-off-by: Emily Casey <ecasey@vmware.com>
* other minor style fixes

Signed-off-by: Emily Casey <ecasey@vmware.com>
@ekcasey ekcasey requested a review from a team as a code owner August 21, 2020 15:42
@ekcasey ekcasey linked an issue Aug 21, 2020 that may be closed by this pull request
@ekcasey ekcasey added this to the Buildpack 0.5 milestone Aug 21, 2020
- MAY log output from the build process to `stdout`.
- MAY emit error, warning, or debug messages to `stderr`.
- MAY write a list of possible commands for launch to `<layers>/launch.toml`.
- MAY write a list of sub-paths within `<app>` to `<layers>/launch.toml`.
- SHOULD write BOM (Bill-of-Materials) entries to `<layers>/launch.toml` describing any contributions to the app image.
- SHOULD write build BOM entries to `<layers>/build.toml` describing any contributions to the build environment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any convention on the statements' order?
Maybe it's worth writing all of "SHOULD" statements and then the "MAY" statements of each file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that idea but line 436, - MAY read the Buildpack Plan., gives me pause. It feels strange to put that line after - SHOULD write a list containing any unmet Buildpack Plan entries...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can put line 437 after line 443. Then all of the statements that relate to build.toml will be together.


A buildpack MAY add extra entries to `<plan>` that do not correspond to entries added during the detection phase.
For each entry in `<plan>`:
- **If** there is an unmet entry in `build.toml` with a matching `name`, the lifecycle
Copy link

@yaelharel yaelharel Aug 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IF

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally thought IF was the convention before @sclevine corrected it in the platform spec rewrite #87 (comment)

I think the correct thing to do here is fix every other IF in this document to match this one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I've just saw other IF in this document so I thought this is the convention.
I don't mind whether the convention is If or IF :)

For each entry in `<plan>`:
- **If** there is an unmet entry in `build.toml` with a matching `name`, the lifecycle
- MUST include the entry in the `<plan>` of the next buildpack that provided an entry with that name during the detection phase.
- **Else**, the lifecycle

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ELSE

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildpack.md Outdated

For each dependency contributed to the app image, the buildpack:

- SHOULD add a bill-of-materials entry to `bom` describing the dependency, where:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it'll be clearer to write:

- SHOULD add a bill-of-materials entry to the `bom` section describing...

although it's also clear the way it is right now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your suggested wording improves readability but I have doubts about whether "section" is the technically correct word. How do you feel about "array" instead of "section"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

buildpack.md Outdated
```

For each dependency contributed by the buildpack to the build environment, the buildpack:
- SHOULD add a bill-of-materials entry to `bom` describing the dependency, where:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment as above.
Again, it's also clear the way it is right now, so maybe it's only me that think that it will be clearer with the small change.

Copy link
Member

@natalieparellano natalieparellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments. I'm excited about this change, it feels more intuitive than the current way of doing things.

buildpack.md Outdated Show resolved Hide resolved
buildpack.md Outdated Show resolved Hide resolved
@@ -778,14 +807,29 @@ The lifecycle MUST accept slices that do not contain any files or directory. How

The lifecycle MUST include all unmatched files in the app directory in any number of additional layers in the OCI image.

For each label, the buildpack:
### build.toml (TOML)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where we mention that the build.toml from each buildpack will be aggregated by the lifecycle into report.toml. Is that also spec'd?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The report.toml changes should be added to the platform API in a different PR. This PR is strictly for the buildpack API.

#134

ekcasey and others added 2 commits August 21, 2020 17:06
Signed-off-by: Emily Casey <ecasey@vmware.com>

Co-authored-by: Natalie Arellano <narellano@vmware.com>
* https://tools.ietf.org/html/rfc2119

Signed-off-by: Emily Casey <ecasey@vmware.com>
@@ -894,7 +938,7 @@ If an `order` is specified, then `stacks` MUST NOT be specified.
*Key: `api = "<buildpack API version>"`*
- MUST be in form `<major>.<minor>` or `<major>`, where `<major>` is equivalent to `<major>.0`
- MUST describe the implemented buildpack API.
- SHOULD indicate the lowest compatible `<minor>` IF buildpack behavior is consistent with multiple `<minor>` versions of a given `<major>`
- SHOULD indicate the lowest compatible `<minor>` if buildpack behavior is consistent with multiple `<minor>` versions of a given `<major>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a rhyme or reason to when we choose to bold these or not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. I didn't bold this one b/c it wasn't bold before. I could reverse engineer the rational (not at the beginning of the sentence something something...) but I would just be making things up. Maybe @sclevine can articulate the rule here.

Signed-off-by: Emily Casey <ecasey@vmware.com>
Signed-off-by: Emily Casey <ecasey@vmware.com>
buildpack.md Outdated
- MAY augment the Buildpack Plan with more refined metadata.
- MAY remove entries with duplicate names in the Buildpack Plan to refine the metadata.
- MAY remove all entries of the same name from the Buildpack Plan to defer those entries to subsequent `/bin/build` executables.
- SHOULD write a list containing any unmet Buildpack Plan entries to `<layers>/build.toml` to defer those entries to subsequent `/bin/build` executables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we define unmet anywhere in the spec? We explain what happens to unmet entries below, but might be good to define this term before it's used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if the changes in this commit address your concern.

Related: I think the Buildpack API would generally benefit from a terminology section but that change is probably out of scope for this PR. I created an issue for this change - #145

* Adds launch/build bom entries to typical buildpack behavior

Signed-off-by: Emily Casey <ecasey@vmware.com>
@ekcasey ekcasey merged commit 32ca0f7 into buildpack/0.5 Sep 8, 2020
@ekcasey ekcasey deleted the decouple-bom-and-build-plan branch September 8, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC 0053] Decouple Buildpack Plan and BOM
7 participants