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

OCPBUGS-20418: Introduce kubelet-dependencies.target and firstboot-osupdate.target #3967

Conversation

cgwalters
Copy link
Member

The primary motivation here is to stop pulling
container images Before=network-online.target because it creates complicated dependency loops.

This is aiming to fix
https://issues.redhat.com/browse/OCPBUGS-15087

A lot of our services are "explicitly coupled" with ordering relationships; e.g. some had Before=kubelet.service but not Before=crio.service.

systemd .target units are explicitly designed for this situation.

We introduce a new kubelet-dependencies.target - both crio.service and kubelet.service are After+Requires=kubelet-dependencies.target. And units which are needed for kubelet should now be both Before + RequiredBy=kubelet-dependencies.target.

Similarly, we had a lot of entangling of the "node services" and the firstboot OS updates, with things explicitly ordering against machine-config-daemon-pull.service or poking into the implementation details of the firstboot process with ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json.

Create a new firstboot-osupdate.target that succeds after the machine-config-daemon-firstboot.service today. Then most of the "infrastructure workload" that must run only on the second boot (such as gcp-hostname.service, openshift-azure-routes.path etc) can cleanly order after that.

This also aids with the coming work for bare metal installs to do OS udpates at install time, because then we will "finalize" the OS update and continue booting.

(cherry picked from commit 2141f4b)

The primary motivation here is to stop pulling
container images `Before=network-online.target` because it
creates complicated dependency loops.

This is aiming to fix
https://issues.redhat.com/browse/OCPBUGS-15087

A lot of our services are "explicitly coupled" with ordering
relationships; e.g. some had `Before=kubelet.service` but not
`Before=crio.service`.

systemd .target units are explicitly designed for this situation.

We introduce a new `kubelet-dependencies.target` - both `crio.service`
and `kubelet.service` are `After+Requires=kubelet-dependencies.target`.
And units which are needed for kubelet should now be both
`Before + RequiredBy=kubelet-dependencies.target`.

Similarly, we had a lot of entangling of the "node services"
and the firstboot OS updates, with things explicitly ordering
against `machine-config-daemon-pull.service` or poking into
the implementation details of the firstboot process with
`ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json`.

Create a new `firstboot-osupdate.target` that succeds after the
`machine-config-daemon-firstboot.service` today.  Then most of the
"infrastructure workload" that must run only on the second boot
(such as `gcp-hostname.service`, `openshift-azure-routes.path` etc)
can cleanly order after that.

This also aids with the coming work for bare metal installs to do
OS udpates at install time, because then we will "finalize" the OS
update and continue booting.

(cherry picked from commit 2141f4b)
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Oct 11, 2023
@openshift-ci-robot
Copy link
Contributor

@cgwalters: This pull request references Jira Issue OCPBUGS-20418, which is valid. The bug has been moved to the POST state.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-15087 is in the state ON_QA, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-15087 targets the "4.15.0" version, which is one of the valid target versions: 4.15.0
  • bug has dependents

Requesting review from QA contact:
/cc @mike-nguyen

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

The primary motivation here is to stop pulling
container images Before=network-online.target because it creates complicated dependency loops.

This is aiming to fix
https://issues.redhat.com/browse/OCPBUGS-15087

A lot of our services are "explicitly coupled" with ordering relationships; e.g. some had Before=kubelet.service but not Before=crio.service.

systemd .target units are explicitly designed for this situation.

We introduce a new kubelet-dependencies.target - both crio.service and kubelet.service are After+Requires=kubelet-dependencies.target. And units which are needed for kubelet should now be both Before + RequiredBy=kubelet-dependencies.target.

Similarly, we had a lot of entangling of the "node services" and the firstboot OS updates, with things explicitly ordering against machine-config-daemon-pull.service or poking into the implementation details of the firstboot process with ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json.

Create a new firstboot-osupdate.target that succeds after the machine-config-daemon-firstboot.service today. Then most of the "infrastructure workload" that must run only on the second boot (such as gcp-hostname.service, openshift-azure-routes.path etc) can cleanly order after that.

This also aids with the coming work for bare metal installs to do OS udpates at install time, because then we will "finalize" the OS update and continue booting.

(cherry picked from commit 2141f4b)

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.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 11, 2023
@sdodson
Copy link
Member

sdodson commented Oct 11, 2023

/payload 4.14 nightly blocking

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 11, 2023

@sdodson: trigger 8 job(s) of type blocking for the nightly release of OCP 4.14

  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-sdn-upgrade
  • periodic-ci-openshift-release-master-ci-4.14-e2e-azure-ovn-upgrade
  • periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-gcp-ovn-rt-upgrade
  • periodic-ci-openshift-hypershift-release-4.14-periodics-e2e-aws-ovn-conformance
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-ovn-serial
  • periodic-ci-openshift-release-master-ci-4.14-e2e-aws-ovn-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-ovn-ipv6
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-sdn-bm

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/c16d1f40-685f-11ee-9a34-c857487b6e1b-0

@cybertron
Copy link
Member

/test e2e-metal-ipi
/test e2e-vsphere-upi

@cgwalters
Copy link
Member Author

Not totally sure what to make of the payload run - the failures offhand look like flakes/failures on the Prow hosting cluster or something?

@cgwalters
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 12, 2023

@cgwalters: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-vsphere-upi-zones f7b0772 link false /test e2e-vsphere-upi-zones
ci/prow/okd-scos-e2e-aws-ovn f7b0772 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-openstack f7b0772 link false /test e2e-openstack
ci/prow/okd-scos-e2e-gcp-op f7b0772 link false /test okd-scos-e2e-gcp-op
ci/prow/e2e-gcp-rt-op f7b0772 link false /test e2e-gcp-rt-op

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@cybertron
Copy link
Member

/test e2e-hypershift

The failures don't seem to have anything to do with deployment for the nodes, so they're past the point where this change would affect anything. The on-prem jobs passed so from my perspective:
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 13, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, cybertron

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

The pull request process is described 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

@rioliu-rh
Copy link

/hold for QE pre-merge testing
/cc @sergiordlr

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2023
@sergiordlr
Copy link

sergiordlr commented Oct 16, 2023

In order to verify this PR we executed the following steps:

  1. Install using IPI and UPI on azure

  2. Install using IPI on OSP

  • Create a machineset using a 4.6 cloud image
  • Create 20 workers using this 4.6 cloud image
  1. Install using IPI on vsphere
  • Create a machineset using a 4.6 cloud image
  • Create 20 workers using this 4.6 cloud image
  1. Install using UPI on vsphere
  • Create 20 new workers using a 4.6 cloud image

No issues were found.

We can safely assume that the rest of the platforms are tested by the prow jobs required to merge the PR.

Because of the way the CI images are stored, we cannot pre-merge execute the "scale" e2e test cases. Hence, even if this PR has the qe-approved label we will have to execute those "scale" e2e test cases post-merge before fully verifying the jira ticket.

We can add the qe-approved label

/label qe-approved

Thank you very much for this fix!!

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Oct 16, 2023
@openshift-ci-robot
Copy link
Contributor

@cgwalters: This pull request references Jira Issue OCPBUGS-20418, which is valid.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-15087 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-15087 targets the "4.15.0" version, which is one of the valid target versions: 4.15.0
  • bug has dependents

Requesting review from QA contact:
/cc @sergiordlr

In response to this:

The primary motivation here is to stop pulling
container images Before=network-online.target because it creates complicated dependency loops.

This is aiming to fix
https://issues.redhat.com/browse/OCPBUGS-15087

A lot of our services are "explicitly coupled" with ordering relationships; e.g. some had Before=kubelet.service but not Before=crio.service.

systemd .target units are explicitly designed for this situation.

We introduce a new kubelet-dependencies.target - both crio.service and kubelet.service are After+Requires=kubelet-dependencies.target. And units which are needed for kubelet should now be both Before + RequiredBy=kubelet-dependencies.target.

Similarly, we had a lot of entangling of the "node services" and the firstboot OS updates, with things explicitly ordering against machine-config-daemon-pull.service or poking into the implementation details of the firstboot process with ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json.

Create a new firstboot-osupdate.target that succeds after the machine-config-daemon-firstboot.service today. Then most of the "infrastructure workload" that must run only on the second boot (such as gcp-hostname.service, openshift-azure-routes.path etc) can cleanly order after that.

This also aids with the coming work for bare metal installs to do OS udpates at install time, because then we will "finalize" the OS update and continue booting.

(cherry picked from commit 2141f4b)

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.

@sergiordlr
Copy link

/label cherry-pick-approved
/unhold

@openshift-ci openshift-ci bot added cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 16, 2023
@cgwalters
Copy link
Member Author

Just to repeat I think we should give this a bit more time before we add the backport-risk-assessed label...so far I am not aware of any fallout in 4.15 but it's still early.

@sinnykumari
Copy link
Contributor

This should be good to get merged.
/hold cancel
I think it is ok to merge #4001 separately after this PR and we will take care of reverting both when needed.
As per offline conversation with Colin, #3979 fixes OKD issue.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2023
@sinnykumari
Copy link
Contributor

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Nov 2, 2023
@openshift-ci openshift-ci bot merged commit 5cadd58 into openshift:release-4.14 Nov 2, 2023
18 of 24 checks passed
@openshift-ci-robot
Copy link
Contributor

@cgwalters: Jira Issue OCPBUGS-20418: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-20418 has been moved to the MODIFIED state.

In response to this:

The primary motivation here is to stop pulling
container images Before=network-online.target because it creates complicated dependency loops.

This is aiming to fix
https://issues.redhat.com/browse/OCPBUGS-15087

A lot of our services are "explicitly coupled" with ordering relationships; e.g. some had Before=kubelet.service but not Before=crio.service.

systemd .target units are explicitly designed for this situation.

We introduce a new kubelet-dependencies.target - both crio.service and kubelet.service are After+Requires=kubelet-dependencies.target. And units which are needed for kubelet should now be both Before + RequiredBy=kubelet-dependencies.target.

Similarly, we had a lot of entangling of the "node services" and the firstboot OS updates, with things explicitly ordering against machine-config-daemon-pull.service or poking into the implementation details of the firstboot process with ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json.

Create a new firstboot-osupdate.target that succeds after the machine-config-daemon-firstboot.service today. Then most of the "infrastructure workload" that must run only on the second boot (such as gcp-hostname.service, openshift-azure-routes.path etc) can cleanly order after that.

This also aids with the coming work for bare metal installs to do OS udpates at install time, because then we will "finalize" the OS update and continue booting.

(cherry picked from commit 2141f4b)

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.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.14.0-0.nightly-2023-11-03-193211

@sinnykumari
Copy link
Contributor

This is needed in 4.13 as well.
/cherry-pick release-4.13

@openshift-cherrypick-robot

@sinnykumari: new pull request created: #4043

In response to this:

This is needed in 4.13 as well.
/cherry-pick release-4.13

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.

jlebon added a commit to jlebon/machine-config-operator that referenced this pull request Jun 21, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.
jlebon added a commit to jlebon/machine-config-operator that referenced this pull request Jun 21, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
jlebon added a commit to jlebon/machine-config-operator that referenced this pull request Jun 21, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
jlebon added a commit to jlebon/machine-config-operator that referenced this pull request Jun 25, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/machine-config-operator that referenced this pull request Jun 26, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/machine-config-operator that referenced this pull request Jun 27, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/machine-config-operator that referenced this pull request Jun 30, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
jlebon added a commit to openshift-cherrypick-robot/machine-config-operator that referenced this pull request Jul 2, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/machine-config-operator that referenced this pull request Aug 9, 2024
When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
yuqi-zhang added a commit to yuqi-zhang/machine-config-operator that referenced this pull request Aug 12, 2024
Original description:

daemon/update: disable systemd unit before overwriting

When overwriting a systemd unit with new content, we need to account for
the case where the new unit content has a different `[Install]` section.
If it does, then simply overwriting will leak the previous enablement
symlinks and become node state. That's OK most of the time, but this can
cause real issues as we've seen with the combination of openshift#3967 which does
exactly that (changing `[Install]` sections) and openshift#4213 which assumed
that those symlinks were cleaned up. More details on that cocktail in:

https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003

Fix this by always checking if the unit is currently enabled, and if so,
running `systemctl disable` *before* overwriting its contents. The unit
will then be re-enabled (or not) based on the MachineConfig.

Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.