Closed sclevine closed 5 years ago
Steps to accept:
pack version: v0.1.0-build.20-darwin
pack location: https://storage.cloud.google.com/cloud-native-buildpacks-pack-binaries/development/pack-0.1.0-build.20-darwin
lifecycle version: 3.0.0-alpha.3-build.9
builder location: gcr.io/cncf-buildpacks-ci/packs/samples:3.0.0-alpha.3-build.9
Download pack and make it executable.
run pack build
with --builder gcr.io/cncf-buildpacks-ci/packs/samples:3.0.0-alpha.3-build.9
flag.
restorer
step should note that there is nothing to restore
.cacher
should output an adding layer
log line for each cache=true
layercacher
should not add cache layers when cache=false
.Rerun pack build
with --builder gcr.io/cncf-buildpacks-ci/packs/samples:3.0.0-alpha.3-build.9
and the same image name
restorer
should output a restoring cached layer
line for each layer previously cached by the cacher.cacher
should output a reusing layer
line for each cached layer that has not changedRerun pack build
with --builder gcr.io/cncf-buildpacks-ci/packs/samples:3.0.0-alpha.3-build.9
and cancel the build in the middle.
pack build
should not behave any differently (we are no longer affect by a corrupted cache after interrupted or failed builds)Rerun pack build
with --builder gcr.io/cncf-buildpacks-ci/packs/samples:3.0.0-alpha.3-build.9
and the --clear-cache
flag.
pack
should report that it is clearing the cache image.restorer
and cacher
should behave as they did during the first image build.exporter
is not the last lifecycle phase, should we reprint the exported image sha at the bottom of the pack
output?pack-cache-f958bbee0669180ca00b3d32062a48c2 latest e46d50050934 6 seconds ago 58.3MB
some_node_app_2 latest f2012f73204a 10 seconds ago 324MB
<none> <none> ab763ab4499b About a minute ago 58.3MB
<none> <none> 6f5bf7e274ba About a minute ago 324MB
<none> <none> 1cb3fb72d7b1 6 minutes ago 58.3MB
<none> <none> 7be014b7660e 6 minutes ago 324MB
gcr.io/cncf-buildpacks-ci/packs/samples 3.0.0-alpha.3-build.9 a038ae01bb8e 2 days ago 283MB
gcr.io/cncf-buildpacks-ci/packs/run 3.0.0-alpha.3-build.9 eaea915bd7fa 2 days ago 256MB
Tested w/ @sclevine. Seems like we're not cleaning up the old cache images. Each time I run pack build with the builder @ekcasey specified, the old cache image is left behind. Also, the image name appears to be very long in some places and short in others, which is confusing. Can probably use first seven characters. Rejecting the story because of the cache image issue, but would be nice to fix the sha length if the ticket is going back to in progress anyway.
Looks good!
Lifecycle
cacher
lifecycle images should have two new binaries
cacher
andrestorer
When A platform invokes
cacher -layers=<layers-dir> -group=<group.toml> -image=<cache-image-tag>
Then a image<cache-image-tag>
should be written to the docker daemon where all layers in the layers dir withcache=true
that corresponding to buildpacks listed ingroup.toml
are added as layers Then the labelio.buildpacks.lifecycle.metadata
on the cache image should be populated with the cache layer shas and metadataGiven an image
<cache-image-tag>
already exists When A platform invokescacher -layers=<layers-dir> -group=<group.toml> -image=<cache-image-tag>
Then The cacher should reuse layers from the previous image when possiblerestorer
When A platform invokes
restorer -layers=<layers-dir> -group=<group.toml> -image=<cache-image-tag>
Then All layers corresponding to buildpacks listed ingroup.toml
will be written to the<layers-dir>
analyzer and exporter
group.toml
when cleaning stale layersPack
When
pack build
fails or is interrupted before completing the lifecycle Then the cache is not corruptedWhen
pack build
is called with the--clear-cache
flag, the cache image is removed before the lifecycle beginsrestorer
afterdetector
and invokecacher
afterexporter
Note: this is a breaking lifecycle change and will require a new lifecycle version line