-
Notifications
You must be signed in to change notification settings - Fork 297
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
run analyze
, restore
, and export
in an ephemeral image
#631
Conversation
Codecov Report
@@ Coverage Diff @@
## master #631 +/- ##
==========================================
+ Coverage 70.52% 70.61% +0.10%
==========================================
Files 67 67
Lines 4687 4763 +76
==========================================
+ Hits 3305 3363 +58
- Misses 1063 1075 +12
- Partials 319 325 +6
|
94b2abd
to
c44cbe0
Compare
return "", errors.Wrapf(err, "writing stack.toml tempfile: %s", stackFile.Name()) | ||
} | ||
|
||
// Override umask |
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.
umask (needed for Linux) and symlinks (needed for Mac) requirements were uncovered in our acceptance tests for volume mounts.
This is blocked on buildpacks/lifecycle#294 |
550bd86
to
5083975
Compare
acceptance/acceptance_test.go
Outdated
err := cmd.Wait() | ||
h.AssertNotNil(t, err) | ||
|
||
h.AssertContains(t, buf.String(), "[detector]") |
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 removed a check that the log output contains a warning if no lifecycle image is available, because this is now unit tested.
@@ -194,7 +126,7 @@ func testBuild(t *testing.T, when spec.G, it spec.S) { | |||
it("is required", func() { | |||
h.AssertError(t, subject.Build(context.TODO(), BuildOptions{ | |||
Image: "", | |||
Builder: builderName, |
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.
This var name seemed too ambiguous and confused me a couple of times...
acceptance/acceptance_test.go
Outdated
}) | ||
}) | ||
|
||
when("builder is trusted", func() { |
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.
On thinking about this further, maybe we don't need this test now that this is unit tested in build_test.go... I do think we'll want at least one "happy path" that runs and verifies the 5 phases (as all the other tests, since they are run without --publish
, will use the 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.
I am going to remove this test for now. I updated the test assertions in the --publish
case to verify that the 5 phases were used.
Only run creator if builder is trusted. For running the acceptance tests, use TEST_TRUST_BUILDER env variable to determine if the builder should be trusted. Signed-off-by: Natalie Arellano <[email protected]>
See if this fixes the error on the Linux runner. Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
- Update variable declarations to be the way they were previously Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
It makes the logic around creator support + trusted builders + publish easier to test and reason about. Signed-off-by: Natalie Arellano <[email protected]>
It's not used in other scopes, so don't make it global Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
7ed560e
to
a5583b8
Compare
Updated per feedback. The compat tests are failing due to something on master unrelated to this... Still waiting on |
Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
build.go
Outdated
return c.lifecycle.Execute(ctx, lifecycleOpts) | ||
} | ||
|
||
lifecycleImageSupported := !ephemeralBuilder.LifecycleDescriptor().Info.Version.LessThan(semver.MustParse("0.7.5")) |
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 think it should be 0.7.4.
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.
At this time we will start creating lifecycle images starting at 0.7.5. I wasn't part of the discussion but I'm not sure it makes sense to provide older lifecycle images. A quick look at the current suggested builders the all use 0.7.5 with the exception of the heroku builder (version 0.6.2).
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 don't think we intend to publish a 0.7.4
lifecycle image - that version of the lifecycle is broken when you use the 5 phases with --publish
(under certain conditions) and that is the exact scenario when we want to use the lifecycle image.
If someone provides lifecycle 0.7.4 and they trust their builder or they are not publishing, then great - we'll use the creator. But if not then we'll warn them (since lifecycle image is not available) and we'll use that lifecycle with the 5 phases. Their build might fail due to the bug, but sadly there isn't anything we can do about that.
✔️ Accepted
|
build.go
Outdated
return c.lifecycle.Execute(ctx, lifecycleOpts) | ||
} | ||
|
||
lifecycleImageSupported := !ephemeralBuilder.LifecycleDescriptor().Info.Version.LessThan(semver.MustParse("0.7.5")) |
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.
At this time we will start creating lifecycle images starting at 0.7.5. I wasn't part of the discussion but I'm not sure it makes sense to provide older lifecycle images. A quick look at the current suggested builders the all use 0.7.5 with the exception of the heroku builder (version 0.6.2).
Signed-off-by: Javier Romero <[email protected]>
63146d2
to
18441e4
Compare
"ANALYZING" etc. is also printed to the logs when creator runs, so we need to check the binary name. Signed-off-by: Natalie Arellano <[email protected]>
Fixes #528
Not ready to be merged until the "lifecycle image" is actually published. The const
lifecycleImageRepo
must be changed to point tobuildpacksio
.