Skip to content
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

Don't fail when a builder or stack image cannot be pulled #90

Closed
ekcasey opened this issue Jan 24, 2019 · 7 comments
Closed

Don't fail when a builder or stack image cannot be pulled #90

ekcasey opened this issue Jan 24, 2019 · 7 comments
Assignees
Labels
type/bug Issue that reports an unexpected behaviour.
Milestone

Comments

@ekcasey
Copy link
Member

ekcasey commented Jan 24, 2019

No Remote Builder Image

Given I have run pack build --builder <builder-image> without the --no-pull flag
Given there is a local version of the builder image
When pack attempts to pull the image and the registry returns any error
Then pack should continue executing without error

No Remote Builder Image and No Local Builder Image

Given I have run pack build --builder <builder-image> without the --no-pull flag
Given there is not a local version of the builder image
When pack attempts to pull the image and the registry returns any error
Then pack should error out

*The fix for this will involve changes to the image package in buildpacks/lifecycle

PM Acceptance Criteria
Case #1
When I build an image with pack build my-image
And A remote copy of:

  • The builder or
  • The associated run image
    is not available
    And A local copy of the image is available
    Then The local copy is silently used for the build

Case #2
When I build an image with pack build my-image
And A remote copy of:

  • The builder or
  • The associated run image
    is available
    And A local copy of the image is available
    Then The remote copy of the image is pulled and used for the build

Notes

  • Let PM know if there's a class of errors for retrieving the remote image that you think we should fail on
@josegonzalez
Copy link

In the first scenario, did you mean with?

@ekcasey
Copy link
Member Author

ekcasey commented Jan 24, 2019

@josegonzalez

When --no-pull is passed we don't attempt to pull at all. This behavior should not change.

Without the flag, I believe we should attempt to pull but permit a missing remote image. Rather than assuming that this is a failure case, I want to interpret it as a success, as in "we successfully ensured the image was as up to date as possible".

We should probably print some info about whether a new version was fetched.

thoughts?

@josegonzalez
Copy link

josegonzalez commented Jan 24, 2019

I guess I'm parsing this with the same Given, hence my confusion.

I would say that if there is no tag specified on the image, latest should be used. That seems reasonable enough.

Does the absence of the --no-pull flag imply --pull? If so, then it would seem that a failing pull should fail the build. Not failing would be closer to in semantics to --try-pull, right?

@ekcasey
Copy link
Member Author

ekcasey commented Jan 24, 2019

I tried to make the intent more clear in the description, let me know if I succeeded

The intention of pulling by default is to ensure that users have the most up-to-date base images and buildpacks. However, if there is no remote image it implies that the user is using a locally created builder or stack and there is no way to update. Several users who are developing buildpacks have said that this behavior is annoying. Most users who are attempting to create a builder immediately run into this error.

The case we are guarding against now doesn't seem to describe many real world scenarios. I have trouble imagining a case where the user wants to update the builder or run image and needs to be informed that it doesn't exist

@nebhale
Copy link
Contributor

nebhale commented Jan 28, 2019

I think a warning that pull was unsuccessful but allowing progress is appropriate.

@jchesterpivotal
Copy link
Contributor

For reference, registry v2 error codes.

@ameyer-pivotal ameyer-pivotal self-assigned this Feb 28, 2019
@ameyer-pivotal ameyer-pivotal removed their assignment Feb 28, 2019
joaopapereira pushed a commit to buildpacks/lifecycle that referenced this issue Mar 5, 2019
- We want to ensure that lifecycle does not return an error in the
  situation where we can pull from remote but the image only exists
locally

[buildpacks/pack#90]

Signed-off-by: Joao Pereira <[email protected]>
Signed-off-by: Ashwin Venkatesh <[email protected]>
ameyer-pivotal pushed a commit to buildpacks/lifecycle that referenced this issue Mar 11, 2019
- We want to ensure that lifecycle does not return an error in the
  situation where we can pull from remote but the image only exists
locally

[buildpacks/pack#90]

Signed-off-by: Joao Pereira <[email protected]>
Signed-off-by: Ashwin Venkatesh <[email protected]>
Signed-off-by: Andrew Meyer <[email protected]>
ameyer-pivotal added a commit that referenced this issue Mar 11, 2019
[#90]

Signed-off-by: Andrew Meyer <[email protected]>
Signed-off-by: Danny Joyce <[email protected]>
ameyer-pivotal pushed a commit that referenced this issue Mar 12, 2019
[#90]

Signed-off-by: Danny Joyce <[email protected]>
Signed-off-by: Andrew Meyer <[email protected]>
ameyer-pivotal pushed a commit that referenced this issue Mar 12, 2019
[#90]

Signed-off-by: Danny Joyce <[email protected]>
Signed-off-by: Andrew Meyer <[email protected]>
@mgibson1121
Copy link
Member

This story passes acceptance.

@sclevine sclevine closed this as completed Apr 3, 2019
@jromero jromero added this to the 0.1.0 milestone Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issue that reports an unexpected behaviour.
Projects
None yet
Development

No branches or pull requests