-
Notifications
You must be signed in to change notification settings - Fork 71
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
RFC: lifecycle/all #46
Conversation
53202f2
to
56e9573
Compare
If |
text/0000-lifecycle-all.md
Outdated
|
||
Each of these phases will continue to be available individually as provided by the current lifecycle. | ||
|
||
### Platform API 0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this callout and I don't have a problem being "more" breaking than would be strictly necessary.
text/0000-lifecycle-all.md
Outdated
This new binary supports two main goals. | ||
|
||
### Goal 1: faster `pack` builds | ||
By creating a single container and invoking `/cnb/lifecycle/all` instead of creating a container per lifecycle phase, pack can shave approximate `6s` from the execution time of `pack build`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what the primary cause of the 6s
increase in multi container builds? Is it purely the docker startup overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appeared to be from the overhead of both starting up as well as tearing down the container. We didn't do a complete teardown of where in the container lifecycle we were losing time. Comparing the execution time of the binaries within the container vs the execution time of the entire container had a constant ∆ of roughly 1.5s
. So running 1 container instead of 5 showed about a 6-7s
improvement in the end to end pack build times.
text/0000-lifecycle-all.md
Outdated
|
||
### Usage | ||
|
||
`/cnb/lifecycle/all <image-name>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, pack prepends lifecycle output with the step of the container builds. Such as: ===> DETECTING
.
Are we expecting the /lifecycle/all
binary prepend the output or will pack still detect the current step in the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, pack would have to be more clever when invoking /lifecycle/all
to know which phase is running and this effort might be non trivial. I suspect the all
binary might have to be better about logging which phase is currently being run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a stop gap we could add the phase to the lifecycle logs. I think the better longterm solution is the structured logging RFC I have long been threatening to submit. This should be a good forcing function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to structured logging
text/0000-lifecycle-all.md
Outdated
| `-gid` | required | `CNB_GROUP_ID` | - | GID of user's group in the stack's build and run images | | ||
| `-version` | optional | - | false | show version | | ||
| `-skip-restore` | optional | - | false | do not restore metadata from previous image or data from cache | ||
| `-tag` (multiples allowed) | optional | - | | additional tags to apply to exported image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What image would the lifecycle analyze for previous layers? Could we add a previous-image
to separate the tags that we right to from the resulting location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument provided as the <image name>
would be the one that the lifecycle would analyze, no? -tag
will be used to specify additional write locations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a bit confusing to me that tags
are not the complete list of locations that the lifecycle will export to especially because doesn't have the tag
name inside of it.
Additionally, at times it can be useful to explicitly call out the image input to the analyze
step. For example: kpack could pass in the previous image's digest to the analyzer. You obviously wouldn't export to an image name with the digest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthewmcnew I am not opposed to adding an optional flag for the previous image image, so long as it default to the export tag when not supplied.
The rationale behind the single positional argument is that an image tag is the only required input. Whereas every other flag configures the build process, the <image-name>
is the primary thing the process acts on.
Given that we already enforce that all exported tags are tags on the same registry, what if we changed the value passed to -t
to be a "tag tag" (in the <registry.com/repo/name:tag
> sense). I am not sure exporting to multiple different repositories in the same registry is really a valid use case. Maybe that would make the usage clearer - only the positional argument gets to define the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the optional previous image flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear using "tag tag" as the value passed to -t would be confusing because it would be differ from the "tag" terminology in docker and kpack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just reuse the multiple positional arguments like what is in exporter today for multiple tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single positional argument and additional -tag
s seems more honest? The exporter
currently treats the first of the positional arguments differently than the rest. In this proposed phase the positional argument will be used as the default value for the analyzer image. If one of the tags in special, 1 positional arg + flags seems to indicate that more clearly.
|
text/0000-lifecycle-all.md
Outdated
[summary]: #summary | ||
|
||
### `/cnb/lifecycle/all` | ||
A new lifecycle binary with the name `lifecycle/all` will be included in each released lifecycle archive. Within a builder image, it will be found at the path `/cnb/lifecycle/all`. When invoked, it will run the following phases sequentially: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RE: name
Creating a thread to discuss the name of this new binary.
Previous comments:
If bin/develop gets built and get it's own binary at /cnb/lifecycle/develop should we consider /cnb/lifecycle/build or another name?
#46 (comment) - @jabrown85
build seems too close to builder and therefore likely to be confusing.
/cnb/lifecycle/combo?
#46 (comment) - @ekcasey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of combo
....
Also, FWIW, it already isn't all in that it doesn't include rebaser
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jromero gonna start a thread just to shoot down every idea without adding a suggestion? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/make
or lifecycle/constructor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooo, I think /lifecycle/make
is my favorite so far (@ashwin-venkatesh agrees 💯 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekcasey :D Wanted to start the thread but didn't have any good ideas myself.
Binary name suggestions:
/lifecycle/phases
Maybe we don't need a new binary at all and only provide a subcommand to the single lifecycle binary.
lifecycle/lifecycle build-app
lifecycle/lifecycle run-phases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with lifecycle/make
but it could be confused with make
text/0000-lifecycle-all.md
Outdated
# Unresolved Questions | ||
[unresolved-questions]: #unresolved-questions | ||
|
||
- Is there a better name than `lifecycle/all`? It doesn't include `launcher` or `rebaser` functionality so it isn't truly `all`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/accio
lifecycle/alohomora
lifecycle/morsmordre
(dark magic)lifecycle/sectumsempra
(very dark magic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/sectumsempra
lifecycle/silencio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/ash_nazg
to rule them all
I move that this RFC be sent to FCP with a disposition of merge, closing 1700 PT, February 5, 2019. |
text/0000-lifecycle-all.md
Outdated
# Summary | ||
[summary]: #summary | ||
|
||
### `/cnb/lifecycle/all` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following suggestion in WG I am going to use this comment thread to conduct an informal poll to select the name for this binary. After this comment I will add comments each containing a single suggestion:
- Please vote with a 👍
- No more than 2 votes per person
- Feel free to express dislike with a 👎 (full disclosure these may not factor into the counting)
- To add a suggestion, add a comment containing only the suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/make
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/combo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/phases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle/creator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lifecycle/build
@ekcasey Will make changes to codify |
* name selected via poll #46 (comment) Signed-off-by: Emily Casey <[email protected]>
* summary * motivation * 1/2 of what-is-it Signed-off-by: Emily Casey <[email protected]> Signed-off-by: Ben Hale <[email protected]>
* adds context around security concerns * indicates the uid and gid are required Signed-off-by: Emily Casey <[email protected]> Signed-off-by: Ben Hale <[email protected]>
* typo fixes * docker build -t as prior art Signed-off-by: Emily Casey <[email protected]> Signed-off-by: Ben Hale <[email protected]>
Signed-off-by: Emily Casey <[email protected]> Signed-off-by: Ben Hale <[email protected]>
Signed-off-by: Emily Casey <[email protected]> Signed-off-by: Ben Hale <[email protected]>
* name selected via poll #46 (comment) Signed-off-by: Emily Casey <[email protected]> Signed-off-by: Ben Hale <[email protected]>
[resolves #46] Signed-off-by: Ben Hale <[email protected]>
5a31cbf
to
528b1a1
Compare
Readable