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

Automatically execute podman-remote if vars set #4981

Closed
wants to merge 1 commit into from

Conversation

afbjorklund
Copy link
Contributor

If any of PODMAN_HOST or PODMAN_VARLINK_BRIDGE are set,
then execute "podman-remote" rather than this "podman".

Example:

$ ./bin/podman version
Version:            1.7.1-dev
RemoteAPI Version:  1
Go Version:         go1.13.6
Git Commit:         263432b1db60013d5f871f371112f75e2024c88e
Built:              Sun Jan 26 18:43:10 2020
OS/Arch:            linux/amd64
$ eval $(podman-machine env --varlink)
$ ./bin/podman version
Client:
Version:            1.7.0
RemoteAPI Version:  1
Go Version:         go1.13.6
Git Commit:         b7ce1157b00af09f4a09e39b377aa3abff46ee05
Built:              Sat Jan 18 15:26:34 2020
OS/Arch:            linux/amd64

Server:
Version:            1.7.1-dev
RemoteAPI Version:  1
Go Version:         go1.12.10
Git Commit:         ce4bf33ccc80819f199bdbb6526b9adee1ad41b0-dirty
Built:              Sat Jan 18 11:01:17 2020
OS/Arch:            linux/amd64

Closes #4390

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: afbjorklund
To complete the pull request process, please assign mrunalp
You can assign the PR to them by writing /assign @mrunalp in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M labels Jan 26, 2020
@openshift-ci-robot
Copy link
Collaborator

Hi @afbjorklund. Thanks for your PR.

I'm waiting for a containers member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@afbjorklund afbjorklund requested review from jwhonce and baude January 26, 2020 17:46
@afbjorklund
Copy link
Contributor Author

Hmm, think I messed up the error reporting when I made it into a function:

$ ./bin/podman run busybox true
$ ./bin/podman run busybox false
Error running /usr/local/bin/podman-remote: exit status 1

If any of PODMAN_HOST or PODMAN_VARLINK_BRIDGE are set,
then execute "podman-remote" rather than this "podman".

Also support PODMAN_VARLINK_ADDRESS for tunneling, even
though there is no encryption support in such addresses.

Signed-off-by: Anders F Björklund <[email protected]>
@afbjorklund
Copy link
Contributor Author

Forgot PODMAN_VARLINK_ADDRESS, which was used in the documentation...

@TomSweeneyRedHat
Copy link
Member

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 27, 2020
bridge := os.Getenv("PODMAN_VARLINK_BRIDGE")
address := os.Getenv("PODMAN_VARLINK_ADDRESS")
if host != "" || bridge != "" || address != "" {
program := "podman-remote"
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to have a debug statement in here to just say "Attempting to connect to remote Podman" or some such. I could see it as being potentially helpful in a debugging situation later on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So something like a logrus.Debugf with the command being executed perhaps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried adding logging, but it doesn't show up in the logs (at the debug level)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TomSweeneyRedHat : apparently this (init) happens before logging has been set up

That is, we are still running with the default log level of InfoLevel (hiding the debug logging)

@vrothberg
Copy link
Member

Friendly ping.

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Feb 12, 2020

Not sure if there’s anything more that can be done here, or if we should continue to rename the binary...

afaik it is called "podman" on Mac and Win, so maybe we need to put it in a weird PATH on Linux ?

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Feb 12, 2020

We are currently missing newer podman-remote binaries as well, so there's nothing to execute.

i.e. as we saw else where, the Linux download is missing and the others are stuck at 1.6.x still

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 16, 2020

@afbjorklund Still working on this?

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Mar 16, 2020

@rhatdan : No, I am not sure what kind of logging that @TomSweeneyRedHat wanted ?

If we output something, that will break users (the same way that the docker wrapper does)
And the logging isn't set up yet, since we call this in the init before we set up logging

I think we just went with everybody using podman-remote for the binary name instead...

https://minikube.sigs.k8s.io/docs/tasks/podman_service/

eval $(minikube podman-env)

podman-remote help

@vrothberg
Copy link
Member

I am going through open pull requests at the moment. Apologies for not getting this in earlier!

Much has changed since this PR was opened and while it doesn't apply as is anymore, we can still use the idea. The new remote client is talking to Podman's new rest API, so we can ignore varlink. But auto-detecting PODMAN_HOST and using the remote backend could easily be done by adding a host-env check to https://github.com/containers/libpod/blob/master/cmd/podman/registry/config.go#L40.

@baude @jwhonce WDYT?

@afbjorklund
Copy link
Contributor Author

Much has changed since this PR was opened and while it doesn't apply as is anymore, we can still use the idea. The new remote client is talking to Podman's new rest API, so we can ignore varlink.

We have already adopted to the existing policy of podman being native on Linux and remote on Mac and Windows ("not available" on Linux), and using varlink and sudo for the access model.

@afbjorklund
Copy link
Contributor Author

I will close this PR, and you can make a new one for the new cilent (for the same original issue).

We still have some issues with the documentation being "blank" and the > 1.6 binaries missing ?

So it seems to be a lot more than just the name of the program that will need some rework here...

Can continue the "podman-remote" discussion in the #4390 issue instead of here, if needed.

@afbjorklund afbjorklund closed this May 4, 2020
@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 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 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. ok-to-test stale-pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically fork/exec to "podman-remote" if PODMAN_VARLINK_ADDRESS is set / implement podman -H
5 participants