-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Podman CLI support kube play remote build #23894
Conversation
We were not able to find or create Copr project
Unless the HTTP status code above is >= 500, please check your configuration for:
|
Ephemeral COPR build failed. @containers/packit-build please check. |
0d722f8
to
a88581f
Compare
Go the error |
Cockpit tests failed for commit a88581f. @martinpitt, @jelly, @mvollmer please check. |
@l0rd PTAL |
@@ -18,3 +35,139 @@ const ( | |||
// Kube annotation for podman volume image. | |||
VolumeImageAnnotation = "volume.podman.io/image" | |||
) | |||
|
|||
// move it here ? |
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.
Yes, this is my concern as well. It's a good idea to move them away from domain/infra/abi/play.go
because the file had grown too much but you should probably keep it under domain/infra/abi/kube.go
.
The other concern is that you have added the logic to build the image, in the case of a remote, in cmd/podman/kube/
. If possible we should keep the remote/local build closer considered that the logic is very similar.
Also it would be great if you could add a podman machine e2e test (see /home/mariolet/github/podman/pkg/machine/e2e/README.md).
Anyway thank you for this PR @fixomatic-ctrl, this is a great feature to add.
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.
but you should probably keep it under
domain/infra/abi/kube.go
.
I am not sure to follow, as the content mention here cannot built for the remote target given my understanding (might be wrong, as I am not familiar with go).
podman/pkg/domain/infra/abi/play.go
Line 1 in a88581f
//go:build !remote |
Moreover, would it make sense to import functions in domain/infra/abi/kube.go
from cmd/podman/kube/
?
If possible we should keep the remote/local build closer considered that the logic is very similar.
Sorry, I am not sure to understand what you are expecting here.
Before putting the parsing logic under pkg/util/kube.go
I tried to add it inside cmd/podman/kube/
. However I faced a circular issue when I was trying to import functions in cmd/podman/kube/
from domain/infra/abi/kube.go
.
I used the pkg/util/kube.go
to share the code between the remote doing the build and the native doing the build, to keep a single source of truth for the parsing logic.
Also it would be great if you could add a podman machine e2e test (see /home/mariolet/github/podman/pkg/machine/e2e/README.md).
I tried to write one, I will try to add more when I will have some time available.
Anyway thank you for this PR @fixomatic-ctrl, this is a great feature to add.
Thanks you for your time and comments!
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.
Image builds happen server side. A remote client cannot build an image without a running podman server.
That said there are 2 possible approaches:
- as for
podman build
,podman kube play
sends the build context to the server. So that the podman server has access to the Dockerfile and to the files required by the build. podman kube play
runspodman build
as a preparation step (something like what you have done in this PR)
I tend to prefer the first approach as it seams more consistent with how Podman works today.
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 must admit I have some doubt about it being fully on the server side. I read the discussion on the ticket ( #14527) related to sending the all context directory to the server as a tar, just like this is done for the podman build command, but some people commented the following
Sending a (possible) large directory by default is very bad.1
I do not have a problem sending the full context, and I would be willing to try making the change.
It seems that according to the documentation, the libpod endpoint already have some kind of support for a tar
I would probably have to experiment with it, as I am not familiar with it.
Footnotes
aabe760
to
d0346e3
Compare
d0346e3
to
b1efc50
Compare
I don't understand what just happen, I rebased my branch and got my PR closed :( |
Signed-off-by: fixomatic-ctrl <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fixomatic-ctrl The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fixomatic-ctrl The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Closing (ref #14527 (comment)) |
Closes #14527
Does this PR introduce a user-facing change?
Logic
When the remote client receives a kube play command with the
--build=true
flag, it parses the YAML file, attempts to build the image(s) referenced, and replaces the image field with the corresponding image ID before sending the request.🔎 Example
The client will build the
foobar
image and replaceimage: foobar
with the image ID, then proceed with sending the request.Internal change
pkg/util/kube.go
Testing
First build the binaries 🏗️
Let's create the same example as the one from the documentation
On windows