Skip to content

Commit a421317

Browse files
author
Natalie Arellano
committed
Finish TODO
Signed-off-by: Natalie Arellano <[email protected]>
1 parent 6e17e0b commit a421317

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed

content/docs/reference/spec/migration/platform-api-0.11-0.12.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,40 +51,52 @@ If `-force` is not provided,
5151
* `io.buildpacks.base.distro.name` label (if specified)
5252
* `io.buildpacks.base.distro.version` label (if specified)
5353
* If `-run-image` is provided it must be found in `io.buildpacks.lifecycle.metadata` in either `runImage.image` or `runImage.mirrors`
54-
* `io.buildpacks.rebasable` must be `true` (see below)
54+
* `io.buildpacks.rebasable` must be `true` (see image extensions below)
5555

5656
### Run image extensions is supported (experimental)
5757

58-
In Platform 0.12 extensions can be used to extend not only build-time base images, but runtime base images as well.
59-
60-
TODO
58+
In Platform 0.12, extensions can be used to extend not only build-time base images, but runtime base images as well.
59+
60+
To use the feature, platforms should:
61+
* Invoke `analyzer` as usual for Platform 0.12
62+
* Invoke `detector` with the `-run` flag, to specify the location of a `run.toml` file containing run image information
63+
* When extensions switch the run image, this is used to log a warning if the new run image is not a known run image
64+
* Invoke `restorer` with the `-dameon` flag (newly added in this Platform API version) if the export target is a daemon
65+
* When extensions switch the run image, the `restorer` must re-read target data from the new run image in order to provide this information to buildpacks; if `-daemon` is provided the `restorer` will look for the run image in a daemon instead of a registry
66+
* When extensions extend the run image, the `-daemon` flag has no effect as the `restorer` must be able to pull the run image manifest from a registry
67+
* Invoke `extender` as usual to extend the builder image (see [migration guide](TODO) for Platform 0.10)
68+
* Inspect the contents of `analyzed.toml` - if `run-image.extend` is `true` we must run the `extender` on the run image
69+
* Using the **run image** as the basis for the container, invoke `extender` with flags `-kind run` and `-extended <extended dir>`
70+
* `<extended dir>` is the directory where layers from applying each `run.Dockerfile` to the run image will be saved for use by the `exporter`; it defaults to `<layers>/extended`
71+
* Invoke `exporter` with the `-extended` flag
72+
73+
Note that unlike buildpack-provided layers, layers from extensions may NOT be safe to rebase.
74+
The `io.buildpacks.rebasable` label on the exported application image will be `false` if rebase is unsafe.
75+
The `-force` flag must be provided to the `rebaser` in order to rebase images with unsafe extension layers,
76+
and should be used with great care.
6177

6278
### OCI layout is a supported export format (experimental)
6379

64-
In Platform 0.12, a new capability to [export application images on disk in OCI layout format](https://github.com/buildpacks/rfcs/blob/main/text/0119-export-to-oci.md) was added.
80+
Platform 0.12 adds a new capability to [export application images on disk in OCI layout format](https://github.com/buildpacks/rfcs/blob/main/text/0119-export-to-oci.md).
81+
82+
#### Before build
6583

66-
Platform must prepare a [layout directory](https://github.com/buildpacks/rfcs/blob/main/text/0119-export-to-oci.md#how-it-works) containing input images in OCI layout format, and provide the location of the directory to the lifecycle.
84+
To use the feature, platforms must prepare a [layout directory](https://github.com/buildpacks/rfcs/blob/main/text/0119-export-to-oci.md#how-it-works) containing input images (`<run-image>` or `<previous-image>` if available) in OCI layout format,
85+
following the [rules](https://github.com/buildpacks/spec/blob/platform/v0.12/platform.md#map-an-image-reference-to-a-path-in-the-layout-directory) to convert the image reference to a path.
86+
87+
#### During build
6788

68-
#### Lifecycle phases affected
89+
The feature is enabled by providing a `-layout` flag or by setting the `CNB_USE_LAYOUT` environment variable to `true` for the following lifecycle phases:
6990

70-
The lifecycle phases affected by this new behavior are:
7191
- [Analyze](https://buildpacks.io/docs/concepts/components/lifecycle/analyze/)
7292
- [Restore](https://buildpacks.io/docs/concepts/components/lifecycle/restore/)
7393
- [Export](https://buildpacks.io/docs/concepts/components/lifecycle/export/)
7494
- [Create](https://buildpacks.io/docs/concepts/components/lifecycle/create/)
7595

76-
**Note** [Rebasing](https://buildpacks.io/docs/concepts/components/lifecycle/rebase/) an image exported to OCI layout format is not supported.
77-
78-
#### Before executing the lifecycle
79-
80-
Input images required by any phase, like the `run-image` or `previous-image`, must be saved on disk in OCI layout format in the layout directory following the
81-
[rules](https://github.com/buildpacks/spec/blob/platform/v0.12/platform.md#map-an-image-reference-to-a-path-in-the-layout-directory) to convert the reference to a path.
82-
83-
#### During lifecycle execution
96+
Additionally, the path to the layout directory must be specified, either by providing a `-layout-dir` flag or by setting the `CNB_LAYOUT_DIR` environment variable.
8497

85-
For the phases affected, the feature is enabled by providing a new `-layout` flag or by setting the `CNB_USE_LAYOUT` environment variable to `true`.
86-
* If the feature is enabled:
87-
* A path to a directory where the images are located and saved must be specified, either by providing a `-layout-dir` flag or by setting the `CNB_LAYOUT_DIR` environment variable.
98+
**Note**: [Rebasing](https://buildpacks.io/docs/concepts/components/lifecycle/rebase/) an image exported to OCI layout format
99+
and extending OCI layout base images with Dockerfiles are currently not supported.
88100

89101
## Base Image Author
90102

content/docs/reference/spec/migration/platform-api-0.9-0.10.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ Note: image extensions are not supported for Windows container images.
7171
* To create a builder with extensions, ensure the `pack` version in use is at least `0.28.0` and enable experimental features: `pack config experimental`.
7272
* Enable experimental features in the lifecycle by setting `CNB_EXPERIMENTAL_MODE=warn` or `CNB_EXPERIMENTAL_MODE=silent` in the lifecycle execution environment for ALL lifecycle phases
7373
* Invoke `analyzer` as usual
74-
* Invoke `detector` with a new optional argument: `-generated`, to specify the directory where Dockerfiles generated by image extensions will be output (defaults to `<layers>/generated`) and include image extensions in `order.toml`
74+
* Invoke `detector` with a new optional flag: `-generated`, to specify the directory where Dockerfiles generated by image extensions will be output (defaults to `<layers>/generated`) and include image extensions in `order.toml`
7575
* Dockerfiles for customizing the build image can be found in `<generated>/build/<image extension ID>/Dockerfile`
7676
* Dockerfiles for customizing the run image can be found in `<generated>/run/<image extension ID>/Dockerfile`
7777
* The new run image will be written to `analyzed.toml`
78-
* Invoke `restorer` with a new required argument (when using extensions): `-build-image`, a tag reference to the builder image in use
78+
* Invoke `restorer` with a new required flag (when using extensions): `-build-image`, a tag reference to the builder image in use
7979
* A new volume mount is introduced with target `/kaniko`; this volume must be writable by the `restorer` user
8080
* Invoke `extender` (new lifecycle binary), instead of `builder`; the extender will use kaniko to apply the relevant generated Dockerfiles to the build image and then drop privileges to run the `build` phase
8181
* The same volume from `restore` should be mounted at `/kaniko`

0 commit comments

Comments
 (0)