Skip to content

Conversation

@giuseppe
Copy link
Member

@giuseppe giuseppe commented Apr 15, 2019

it is useful to migrate existing containers to a new version of
podman. Currently, it is needed to migrate rootless containers that
were created with podman <= 1.2 to a newer version which requires all
containers to be running in the same user namespace.

Closes: #2935

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L labels Apr 15, 2019
@giuseppe giuseppe changed the title system: add new subcommand "migrate" [WIP] system: add new subcommand "migrate" Apr 15, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 15, 2019
Copy link
Member

Choose a reason for hiding this comment

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

We want to be holding the alive lock here, to ensure that other Podman instances don't start while we're still migrating containers

Copy link
Member

Choose a reason for hiding this comment

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

If the BecomeRoot call prevents us from grabbing it here, migrate() itself should take the lock and hold 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.

once we re-exec, the rootless instance will run with euid==0 and it will hold the lock. This is to prevent a deadlock with the re-execed process

Copy link
Member

Choose a reason for hiding this comment

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

We should at least log errors here

Copy link
Member Author

Choose a reason for hiding this comment

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

probably here it is safer to return on error. I'll change it

Copy link
Member

Choose a reason for hiding this comment

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

Can we try and match the full path, in case people were actually specifying a non-default path?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, changing it

Copy link
Member

Choose a reason for hiding this comment

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

Again, probably worth logging failures, at least

Copy link
Member

Choose a reason for hiding this comment

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

Also, maybe we should plumb a context in here through NewRuntime.

@giuseppe giuseppe force-pushed the podman-system-migrate branch 3 times, most recently from a4a45fc to 431994c Compare April 16, 2019 07:39
@giuseppe giuseppe changed the title [WIP] system: add new subcommand "migrate" system: add new subcommand "migrate" Apr 16, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 16, 2019
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it can't be rolled back. Do we want to add a "Are your sure you want to do this?" kind of prompt in here somewhere?

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 expect this to be used in a non interactive way, e.g. as part of the upgrade

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.

Need to update command.md with an entry for this command.
Any chance to add a test? Seems hard to pull off, but thought I'd ask.

@giuseppe giuseppe force-pushed the podman-system-migrate branch from 1344dc3 to 301b7f8 Compare April 16, 2019 17:14
@giuseppe
Copy link
Member Author

Need to update command.md with an entry for this command.

do I need to add it? It is a subcommand of system

Any chance to add a test? Seems hard to pull off, but thought I'd ask.

we would need to have an old version of podman preinstalled

@TomSweeneyRedHat
Copy link
Member

I'll let @mheon make the call on the "should it be on commands.md" or not. I think yes. Currently we have separate listings for "podman container *" and "podman volume *", but we don't do the same for "podman system *".

The test sounds like a headache, I'd not worry about it then. Sounds like you were considering the same roadblock that I was.

@rh-atomic-bot
Copy link
Collaborator

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

@mheon
Copy link
Member

mheon commented Apr 17, 2019

@giuseppe @TomSweeneyRedHat If system renumber is in the commands page, we add this; if it's not, we don't. I think we ought to match what the existing similar commands do.

@rhatdan
Copy link
Member

rhatdan commented Apr 17, 2019

Is this something we should run in the postinstall? How are we going to tell individual users that we need to run this. Can we do a check in the podman command?

Copy link
Member

Choose a reason for hiding this comment

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

Isn't this not lock-related so much as pidfile-related? I'd call Migrate a generic way to update container configuration between versions

Copy link
Member

Choose a reason for hiding this comment

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

I feel like we ought to pass this through NewRuntime() as an argument instead of with an option

@rhatdan
Copy link
Member

rhatdan commented Apr 24, 2019

Needs a rebase to get the SELinux fixes.

@giuseppe giuseppe force-pushed the podman-system-migrate branch from e781039 to 1156494 Compare April 24, 2019 18:46
@giuseppe
Copy link
Member Author

tests are happy!

@mheon
Copy link
Member

mheon commented Apr 24, 2019

I'll hit my comments once this merges in a separate PR, let's get this landed.
LGTM

@rh-atomic-bot
Copy link
Collaborator

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

@mheon
Copy link
Member

mheon commented Apr 24, 2019

@giuseppe You picked up merge conflicts.

@giuseppe giuseppe force-pushed the podman-system-migrate branch from 1156494 to fd60dd7 Compare April 24, 2019 21:09
@giuseppe
Copy link
Member Author

@giuseppe You picked up merge conflicts.

rebased again

@TomSweeneyRedHat
Copy link
Member

LGTM and happy green test buttons.

@rh-atomic-bot
Copy link
Collaborator

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

@giuseppe giuseppe force-pushed the podman-system-migrate branch from fd60dd7 to e2c2e6e Compare April 25, 2019 20:17
@rh-atomic-bot
Copy link
Collaborator

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

@giuseppe giuseppe force-pushed the podman-system-migrate branch from e2c2e6e to 182e761 Compare April 26, 2019 06:58
it is useful to migrate existing containers to a new version of
podman.  Currently, it is needed to migrate rootless containers that
were created with podman <= 1.2 to a newer version which requires all
containers to be running in the same user namespace.

Closes: containers#2935

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe giuseppe force-pushed the podman-system-migrate branch from 182e761 to f49e0c1 Compare April 26, 2019 20:24
@giuseppe
Copy link
Member Author

tests are green again

@mheon
Copy link
Member

mheon commented Apr 26, 2019

/lgtm
I'll submit a followup over the weekend or on monday to hit my nits

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 26, 2019
@openshift-merge-robot openshift-merge-robot merged commit fe3acdd into containers:master Apr 26, 2019
mheon added a commit to mheon/libpod that referenced this pull request May 1, 2019
We merged containers#2950 with some nits still remaining, as Giuseppe was
going on PTO. This addresses those small requested changes.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@mheon mheon mentioned this pull request May 1, 2019
openshift-merge-robot added a commit that referenced this pull request May 2, 2019
@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

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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.

podman list fails in rawhide

9 participants