Skip to content

Use buildah commit for podman commit#592

Closed
baude wants to merge 1 commit intocontainers:masterfrom
baude:commitbuildah
Closed

Use buildah commit for podman commit#592
baude wants to merge 1 commit intocontainers:masterfrom
baude:commitbuildah

Conversation

@baude
Copy link
Member

@baude baude commented Apr 3, 2018

Resolves: #586 and #520

Signed-off-by: baude bbaude@redhat.com

@baude
Copy link
Member Author

baude commented Apr 3, 2018

@TomSweeneyRedHat @rhatdan @mheon Again, this will eventually fix the two issues Ed has filed against podman. I know we have issues with this approach; but the problem is we have no consensus on another approach. So review and we can decide if this is a good stop gap or you want me to implement a larger, agreed upon approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate from the Buildah stuff, but I really don't like this... can we just pass in a string for the name of the new image?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can give return a *image.Image from commit so we still get a good image to work with

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API would be a lot cleaner if we used functional options, but we can clean it up later

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree we should have a image.Config object

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you guys are talking about two different things ... I think @mheon is talking about "WithWriter" funcs? Either would be fine by me if preferred. The previous one used a struct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to figure out how much code ImportBuilder actually is - how much code from buildah do we really need to bring in for this? Is this a case where it's just a single file, like when we vendored in Kube stuff?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll certainly look. I was trying to avoid duplication at all costs, but if it is really small, agree that might make more sense.

@mheon
Copy link
Member

mheon commented Apr 4, 2018

I don't like the image API changes, it seems to me it would make a lot more sense to continue returning an Image and just accept the name/reference for the new image.

@mheon
Copy link
Member

mheon commented Apr 4, 2018

Otherwise... I don't like vendoring buildah here, but commit is clearly broken right now and this fixes it. When we consider basing buildah on libpod we can look into factoring the commit code into here.

@rhatdan
Copy link
Member

rhatdan commented Apr 4, 2018

I think a lot of this code should be added to the image object, At least have a image.Config that defines all of the the fields that can get added to an image.

@mheon
Copy link
Member

mheon commented Apr 4, 2018

I was thinking we'd make Commit accept options like NewContainer does, so we can only override what we want to - we'd have a WithEntrypoint, WithCmd, WithAuthor, etc, and pass whatever we wanted into commit itself to only modify those fields.

@baude
Copy link
Member Author

baude commented Apr 4, 2018

When I think of commit, I think of container not image logically. What do you guys think ?

@TomSweeneyRedHat
Copy link
Member

TomSweeneyRedHat commented Apr 4, 2018 via email

@rhatdan
Copy link
Member

rhatdan commented Apr 4, 2018

Those fields are image data fields. So I think the data belongs to the image even if it is temporarily stored in the container.

@mheon
Copy link
Member

mheon commented Apr 4, 2018

There's no reason we can't have a struct with the image configuration which is populated by With... functions. Can we work with that using the vendored buildah code, though? Buildah uses setter functions to modify individual bits of the config, which is part of why I like With... functions (easy to translate into the buildah api). Can we ignore the buildah functions and change the image's config after we make it with importbuilder.Commit()?

@rhatdan
Copy link
Member

rhatdan commented Apr 4, 2018

Sure I am not that concerned with how we hack this together to fix the current issue. But I think we need to concentrate on a long term issue of getting Buildah and Podman to blend together in a way that @mheon and @nalind can live with.

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably fdcf633) made this pull request unmergeable. Please resolve the merge conflicts.

@baude baude force-pushed the commitbuildah branch 3 times, most recently from 357e064 to a132774 Compare April 5, 2018 17:24
@mheon
Copy link
Member

mheon commented Apr 5, 2018

@baude Can you hit the manpages and usage text to say that image name is mandatory now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the container need to be mounted to do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know. How can I tell?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does commit on a stopped container work? If it does, we should be fine

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup it does

@baude baude changed the title [WIP] Use buildah commit for podman commit Use buildah commit for podman commit Apr 6, 2018
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this up with io and os

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this up with io and os

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we patch this? Should we have patched this? I'm wondering if this will affect the containers buildah sees

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i changed it if that is what you are asking

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

@baude baude force-pushed the commitbuildah branch 2 times, most recently from fc8191c to a3e139b Compare April 9, 2018 18:03
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this and ToStorageReference go away now that we aren't using it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Resolves: containers#586 and containers#520
Signed-off-by: baude <bbaude@redhat.com>
@mheon
Copy link
Member

mheon commented Apr 9, 2018

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Horrid Name, No idea what this function does

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. My questions/concerns is keeping this code up to date with anything that changes in Buildah and/or converting Buildah to use this code. Thoughts on that?

@nalind WDYT?

@baude
Copy link
Member Author

baude commented Apr 10, 2018

@TomSweeneyRedHat consider this a pilot and stop gap to fix current issues filed against podman. Once this PR is merged, I am ready to start the moving of buildah code over so we no longer have a maintenance issue.

@mheon
Copy link
Member

mheon commented Apr 10, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit e2b071a has been approved by mheon

@rh-atomic-bot
Copy link
Collaborator

⚡ Test exempted: merge already tested.

@baude baude deleted the commitbuildah branch December 22, 2019 18:46
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants