Skip to content

chroot to rootPrefix - #26

Merged
openshift-merge-robot merged 2 commits into
openshift:masterfrom
ashcrow:mcd-chroot
Sep 4, 2018
Merged

openshift-merge-robot merged 2 commits into
openshift:masterfrom
ashcrow:mcd-chroot

Conversation

@ashcrow

@ashcrow ashcrow commented Aug 23, 2018

Copy link
Copy Markdown
Member

Prereq for #17

@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 Aug 23, 2018
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 23, 2018
@ashcrow

ashcrow commented Aug 23, 2018

Copy link
Copy Markdown
Member Author

/cc @sdemos if this looks like a good location for chrooting to you as well I'll go back through and clean up prefix items since they can execute against /.

@sdemos sdemos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

overall looks good to me, just a couple of questions.

Comment thread cmd/machine-config-daemon/start.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's fine if this never actually gets cleaned up right? The daemon calls reboot and then sleeps for 7 days, so it pretty much never exits cleanly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I believe it would be fine.

Comment thread cmd/machine-config-daemon/start.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this syscall fail if the prefix doesn't exist? If it does, will the error message be helpful? If not, it might be worth checking existence first and then printing a pretty error message.

Alternatively, we control the daemonset definition so maybe this isn't worth doing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You make a good point. We do control the daemonset def but it would still be helpful to provide a better error message.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated with a check and two different error messages depending upon the failure.

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 24, 2018
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 24, 2018
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 24, 2018
@ashcrow

ashcrow commented Aug 24, 2018

Copy link
Copy Markdown
Member Author

Rebased.

@sdemos removed the rootPrefix concat that was previouslty required.

@ashcrow ashcrow changed the title WIP: chroot to rootPrefix chroot to rootPrefix Aug 24, 2018
@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 Aug 24, 2018
@ashcrow

ashcrow commented Aug 24, 2018

Copy link
Copy Markdown
Member Author

/hold cancel

@sdemos

sdemos commented Aug 28, 2018 •

Copy link
Copy Markdown
Contributor

this all looks good to me.

another thing we should consider doing after this is removing most of the volume mounts in the manifest. it seems like we don't have to mount in anything but the rootfs if we are just chrooting into it immediately since all the stuff we were mounting is presumably in the rootfs anyway. we don't have to do that here though, we can clean it up in a future pr.

on a process note, do I just do /lgtm or something to thumbs up this? or the github approve mechanic? will that merge it immediately or does something else have to happen first? I haven't really used this system before.

@ashcrow

ashcrow commented Aug 29, 2018

Copy link
Copy Markdown
Member Author

this all looks good to me.

🎉

another thing we should consider doing after this is removing most of the volume mounts in the manifest. it seems like we don't have to mount in anything but the rootfs if we are just chrooting into it immediately since all the stuff we were mounting is presumably in the rootfs anyway. we don't have to do that here though, we can clean it up in a future pr.

Agreed. Though some may still be needed for the MCD to start before it chroots. We can figure that out later 😄.

on a process note, do I just do /lgtm or something to thumbs up this? or the github approve mechanic? will that merge it immediately or does something else have to happen first? I haven't really used this system before.

Using the /lgtm will verify that the prow job succeeded (which it did) and merge it to master very quickly.

@ashcrow ashcrow mentioned this pull request Aug 29, 2018
@sdemos

sdemos commented Aug 29, 2018

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@sdemos: changing LGTM is restricted to assignees, and only openshift/machine-config-operator repo collaborators may be assigned issues.

Details

In response to this:

/lgtm

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.

@sdemos

sdemos commented Aug 29, 2018

Copy link
Copy Markdown
Contributor

/assign @sdemos

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@sdemos: GitHub didn't allow me to assign the following users: sdemos.

Note that only openshift members and repo collaborators can be assigned.
For more information please see the contributor guide

Details

In response to this:

/assign @sdemos

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.

@sdemos

sdemos commented Aug 29, 2018

Copy link
Copy Markdown
Contributor

/cc @sdemos

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@sdemos: GitHub didn't allow me to request PR reviews from the following users: sdemos.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @sdemos

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.

@ashcrow

ashcrow commented Aug 30, 2018

Copy link
Copy Markdown
Member Author

/cc @sdemos

Comment thread cmd/machine-config-daemon/start.go Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You also need to chdir after chroot, otherwise your working directory could be outside of your chroot.

Comment thread cmd/machine-config-daemon/start.go Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is this supposed to do? I fear that . could be pretty much anything when this defer fires, depending on what intermediate code does in-between.

@lucab lucab Aug 30, 2018 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thinking a bit more about this, I fear that these defers here will actually never fire, as this function fatal-exits on errors.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think I'm going to remove the defers as they will never be called anyway. As @sdemos pointed out earlier, the MCD doesn't really exit cleanly. It runs forever unless it's more or less killed.

@ashcrow

ashcrow commented Aug 30, 2018

Copy link
Copy Markdown
Member Author

Thanks @lucab, will update.

rootPrefix has been renamed to rootMount and now is used as the
location to chroot. File operations no longer require joining
a global prefix due to the MCD running within the chroot.

Signed-off-by: Steve Milner <[email protected]>
@ashcrow

ashcrow commented Sep 4, 2018

Copy link
Copy Markdown
Member Author

@sdemos PTAL

@sdemos

sdemos commented Sep 4, 2018

Copy link
Copy Markdown
Contributor

/lgtm

sorry for the delay.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2018
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashcrow, sdemos

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-merge-robot
openshift-merge-robot merged commit ece280a into openshift:master Sep 4, 2018
osherdp pushed a commit to osherdp/machine-config-operator that referenced this pull request Apr 13, 2021
bump recent openshift/library xpaas content
ptalgulk01 pushed a commit to ptalgulk01/machine-config-operator that referenced this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants