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

expand slice layers page #752

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,34 @@
weight=99
+++

A `Slice` represents a layer in the `<app>` directory to be exported during the `export` phase.

Check warning on line 6 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('be exported'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('be exported').", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 6, "column": 58}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

<!--more-->

This page is a stub! The CNB project is applying to [Google Season of Docs](https://developers.google.com/season-of-docs/docs/timeline) to receive support for improving our documentation. Please check back soon.
A buildpack MAY specify sub-paths within `<app>` as `slices` in `launch.toml`. Separate layers MUST be created during the [export](https://buildpacks.io/docs/for-buildpack-authors/concepts/lifecycle-phases/#phase-5-export) phase for each slice with one or more files or directories.

Check failure on line 10 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'buildpack'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'buildpack'?", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 10, "column": 3}}}, "severity": "ERROR"}

Check warning on line 10 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'MAY', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'MAY', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 10, "column": 13}}}, "severity": "INFO"}

Check warning on line 10 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 10, "column": 96}}}, "severity": "INFO"}

Check warning on line 10 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('be created'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('be created').", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 10, "column": 101}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

## Key Points

Check warning on line 12 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Headings] 'Key Points' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Key Points' should use sentence-style capitalization.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 12, "column": 4}}}, "severity": "WARNING"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

* For each `slice`, buildpacks MUST specify zero or more `path globs` such that each path is either:

Check failure on line 14 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'buildpacks'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'buildpacks'?", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 14, "column": 21}}}, "severity": "ERROR"}

Check warning on line 14 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 14, "column": 32}}}, "severity": "INFO"}
* Relative to the root of the app directory without traversing outside of the app directory
* Absolute and contained within the app directory
* `Path globs` MUST:

Check warning on line 17 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 17, "column": 16}}}, "severity": "INFO"}
* Follow the pattern syntax defined in the [Go standard library](https://golang.org/pkg/path/filepath/#Match)
* Match zero or more files or directories
* The `lifecycle` MUST convert the `<app>` directory into one or more layers using slices in each `launch.toml` such that slices from earlier buildpacks are processed before slices from later buildpacks.

Check warning on line 20 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 20, "column": 19}}}, "severity": "INFO"}

Check failure on line 20 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'buildpacks'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'buildpacks'?", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 20, "column": 143}}}, "severity": "ERROR"}

Check warning on line 20 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('are processed'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('are processed').", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 20, "column": 154}}}, "severity": "INFO"}

Check failure on line 20 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'buildpacks'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'buildpacks'?", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 20, "column": 193}}}, "severity": "ERROR"}
* The `lifecycle` MUST process each slice as if all files matched in preceding slices no longer exists in the app directory

Check warning on line 21 in content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'MUST', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md", "range": {"start": {"line": 21, "column": 19}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
* The `lifecycle` MUST accept slices that do not contain any files or directory; however, it MAY warn about such slices
* The `lifecycle` MUST include all unmatched files in the app directory in any number of additional layers in the `OCI image`
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

## Use Cases

* `Slices` aid in optimizing data transfer for files that are commonly shared across applications
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

## Implementation Steps

`Slices` are added to the [launch.toml](https://github.com/buildpacks/spec/blob/main/buildpack.md#launchtoml-toml) file in the `<layers>/<layer>` directory as follows:

If you are familiar with this content and would like to make a contribution, please feel free to open a PR :)
```toml
[[slices]]
paths = ["<app sub-path glob>"]
```
Loading