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

APIv2: No events on image build #7022

Closed
marusak opened this issue Jul 20, 2020 · 10 comments · Fixed by #7202
Closed

APIv2: No events on image build #7022

marusak opened this issue Jul 20, 2020 · 10 comments · Fixed by #7202
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@marusak
Copy link
Contributor

marusak commented Jul 20, 2020

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
podman build does not produce any event in the REST API.

Steps to reproduce the issue:

  1. sudo curl --unix-socket /run/podman/podman.sock http://d/v1.24/events - start listening on events

  2. sudo podman build . (some simple Dockerfile)

  3. sudo podman images -a shows a new image, but there is no events in the step 1. (sudo podman pull produces event)

Describe the results you received:

Describe the results you expected:
Some events that the image list has changed.

Output of podman version:

Version:      2.0.1
API Version:  1
Go Version:   go1.14.3
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 20, 2020
@vrothberg
Copy link
Member

Thanks for opening an issue, @marusak. I can reproduce: both podman build and podman-remote build do not yield an event.

@vrothberg
Copy link
Member

I found some time to have a closer look. It seems there is no build event at all. @mheon did we have some in previous versions?

@mheon
Copy link
Member

mheon commented Jul 20, 2020 via email

@vrothberg
Copy link
Member

I don't see how we would, given that the events code lives in Libpod and image build is entirely in Buildah land

I think it's pretty similar to pulling, which happens in c/image. We could track down all buildah API calls in the code and record events there. Wouldn't that work?

@mheon
Copy link
Member

mheon commented Jul 20, 2020

The problem specifically with build is that we immediately hand off from our CLI to the Buildah CLI - the other calls are usually a lot more integrated with the rest of our code (commit on images, for example - uses Buildah code, but just library calls, not handing off the entire responsibility, so we can embed the events calls).

We could potentially generate an event before we ever call Buildah, but I don't think we know some important things at that point (ID of the final image being the big one)

@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2020

Let's integrate something intoBuildah, that it can call functions on events. Would seem to be the best way.

@mheon
Copy link
Member

mheon commented Jul 20, 2020

We should move the events code into c/common to allow Buildah to also call into it.

@mheon
Copy link
Member

mheon commented Jul 20, 2020

We will have issues if they want to do container events, though, because we can't see those in podman ps or the list API, so Cockpit will get very confused.

@vrothberg
Copy link
Member

We will have issues if they want to do container events, though, because we can't see those in podman ps or the list API, so Cockpit will get very confused.

Very good point. I think Buildah as a tool shouldn't do events, but buildah as a library should provide a way to opt-in to events. This way, Podman could call the buildah API with events enabled where we'd get events on image pulls, commits, builds etc.

@vrothberg vrothberg added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jul 21, 2020
@vrothberg
Copy link
Member

I suggest that we can tackle that after we split libpod from Podman.

baude added a commit to baude/podman that referenced this issue Aug 12, 2020
upon image build completion, a new image type event is written for "build". more intricate details, like pulling an image, that might be done by build must be implemented in different vendored packages only after libpod is split from podman.

Fixes: containers#7022

Signed-off-by: Brent Baude <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 17, 2020
upon image build completion, a new image type event is written for "build". more intricate details, like pulling an image, that might be done by build must be implemented in different vendored packages only after libpod is split from podman.

Fixes: containers#7022

Signed-off-by: Brent Baude <[email protected]>

<MH: Fixed imports during cherry-pick>

Signed-off-by: Matt Heon <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 20, 2020
upon image build completion, a new image type event is written for "build". more intricate details, like pulling an image, that might be done by build must be implemented in different vendored packages only after libpod is split from podman.

Fixes: containers#7022

Signed-off-by: Brent Baude <[email protected]>

<MH: Fixed imports during cherry-pick>

Signed-off-by: Matt Heon <[email protected]>
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. 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 a pull request may close this issue.

5 participants