-
Notifications
You must be signed in to change notification settings - Fork 105
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
Runtime Image Support #263
Conversation
Skipping CI for Draft Pull Request. |
Thanks @otaviof , did you happen to try any Java use cases? |
@sbose78 yes, I have, it does work as expected. Let me share the examples here as well. On testing this situation I notice the |
Prior-art example: https://github.com/openshift/api/blob/master/build/v1/types.go#L883 |
Community meeting note:
|
faed4c4
to
230ab84
Compare
@qu1queee, @SaschaSchwarze0, @zhangtbj Would you please consider this PR when you have some time? I've also added a EP document to describe it: https://github.com/redhat-developer/build/blob/3590fff206333b62b8b5e5b2a527908190210791/docs/proposals/runtime-image.md |
@otaviof yes, let me provide my comments between today and tomorrow. |
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.
Nothing jumped out at me from a code review perspective, and I think the builder/runtime abstractions easily resonate for any user familiar with multi-stage builds, which I think we can assume is pretty ubiquitous at this point.
But as you'll see below, the concern I've relayed in recent cabal meetings is "revitalized" if you will when I look at the BuildStep
machinations needed.
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.
Adding comments to the written proposal. Will go through the code changes later.
Hi @otaviof , thanks a lot for this PR. Let me add my comments on this, I did not reviewed the whole code in detail yet, because I would like to discuss the proposal first.
Sorry for this long message, I finally got the whole feature picture with this PR, so thanks a lot for this. |
Note, the admin doesn't have to do anything. In the proposal, the strategy is tweaked on the fly in-memory and then consumed - which @SaschaSchwarze0 mentioned could be done at the 'generate taskrun' level directly. |
@sbose78 thanks. Yes you are correct. There still some particular knowledge the user needs to know prior to the runtime definition of the Build(similar to what @SaschaSchwarze0 mentioned around which directory to use from the base img). I would try to summarize the whole discussion via this msg, to avoid extending this for longer:
|
I agree, we should use the absolute minimal image. Builder images can be 'heavy'. To be a good community citizen, we should probably use the busybox-ish image to achieve this since Recommendations on making this configurable: |
@sbose78 yep, I think that's a good path ahead, after all |
@SaschaSchwarze0 thanks for pointing that out, indeed when |
/lgtm |
I'm good @gabemontero . Thank you @SaschaSchwarze0 and @otaviof ! |
/lgtm |
@gabemontero I've squashed the commits this morning, now it's only 5 commits organized per section of the project updated. Would you mean, squashing as a single commit? |
yeah OCP generally like to minimize commits but I don't think we need to strictly enforce that with this repo if you have already squashed some and are happy with the commit structure ... /approve |
oh well ... I don't have the authority :-) try adding /approve yourself @otaviof
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gabemontero, otaviof The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I typically try and ensure we have a meaningful single commit message, but upon auto-squash that doesn't quite happen :) |
This pull-request is addressing the discussion in #183, as a initial approach to provide a runtime image. This image is basically a multi-stage build, based on the container-image created by the
BuildStrategy
steps.Enhancement Proposal
Please consider the design document added in this PR, describing the feature in details.
Runtime Resource
The following example contains the modifications introduced by this PR. Please consider the
.spec.runtime
section.On
.spec.runtime
section the user can modify the runtime base-image attributes, new attributes have been added onBuild
resource. Please considerbuild_types.go
file.Generated Dockerfile
The generation of a runtime
Dockerfile
is based on Go Templates, defined onruntime_image.go
file. Using the example build above, it will produce the followingDockerfile
: