Skip to content

Conversation

@yevgeny-shnaidman
Copy link

Currently openshift-installer.baremetal compiles with TAG="baremetal libvirt".Therefore it tries to validate baremetal network interfaces using libvirt. In addition it requires the presence of BMH definitions in the install-config.yaml.
In Assisted-Installer product we use openshift-installer to produce ignitions while running a job on a openshift cluster, so we need to disable libvirt validation. Also, we don't use BMH during 1st day installation, and would like to not configure it with dummy values in install-config.yaml

Proposed change:
Add a field called "skipValidations" to the baremetal platform configuration in the install-config.yaml. If this field is NOT present, openshift-installer will execute as usual. In case this field is present, it will skip the validations defined by it.
Currently 2 validations are defined:

  1. interfaces - skips network interfaces validations
  2. hosts - skips BMH validation

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign hardys
You can assign the PR to them by writing /assign @hardys 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

@yevgeny-shnaidman
Copy link
Author

/romfreiman

@hardys
Copy link

hardys commented Jun 24, 2020

/retitle baremetal: Disable network interfaces and BMH validations when needed

@hardys
Copy link

hardys commented Jun 24, 2020

/label platform/baremetal

@openshift-ci-robot openshift-ci-robot added the platform/baremetal IPI bare metal hosts platform label Jun 24, 2020
@openshift-ci-robot openshift-ci-robot changed the title MGMT-1278 - disable network interfaces and BMH validations when needed baremetal: Disable network interfaces and BMH validations when needed Jun 24, 2020
// currently to validations skipping is supported
// "interfaces" - skip validation of hosts networking interfaces via libvirt
// "hosts" - skips validation of hosts existannce it they values
SkipValidations string `json:"skipValidations,omitemtpy"`
Copy link

Choose a reason for hiding this comment

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

Did you look into alternatives that avoid this new boolean?

I think the main issue here is that the validations happen on create ignition-configs - I wonder if we can either ensure they only happen on create cluster or alternatively use some special value to LibvirtURI that indicates libvirt related validations should be disabled?

/cc @stbenjam any thoughts on the best interface here?

Copy link
Member

Choose a reason for hiding this comment

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

I agree -- adding anything to the platform is a last resort. Changing when the validations run may be the best solution.

If we need to run some validations before create ignition to make sure we don't make bad ignition configs, I'd prefer to opt for some indication we're doing an assisted install. Disabling validations is probably not the only conditional thing we'll need to do for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is another example of why I think "assisted-baremetal" is a different platform in the installer, even if the platform in the cluster is still just "baremetal".

Choose a reason for hiding this comment

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

@dhellmann if IPI was optional, those checks would not be required. Also, I would expect the runtime validations (libvirt socket) to be done during create cluster and not generate igntions.

Copy link
Author

Choose a reason for hiding this comment

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

@hardys i wanted to disrupt the usual flow as little as possible, so for user that do not add the flag to the install-config, nothing would change. I had 2 addtional options that i thought about

  1. change the build tag of pkg/types/baremetal/validation/libvirt.go from baremetal to libvirt, and compile openshift-installer with TAG="baremetal" instead of TAG="baremetal libvirt". This would remove libvirt validation of network interfaces from baremetal installer.
  2. make Hosts field in pkg/types/baremetal/platform.go optional, and then execute all the validations for Hosts only in case this field is not empty

Copy link
Author

Choose a reason for hiding this comment

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

suppose that for now we will leave BMH validation as is ( it does not really hurt us, we will just fill in dummy values, and we will use LibvirtURI field in baremetal platform to signal if it is assisted-installer setup. the code will look like:
if p.LibvirtURI == "assisted-installer" {
skip libvirt interface validation
}

@stbenjam @hardys

Copy link
Member

Choose a reason for hiding this comment

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

Magic string values aren't ok here -- I think the consensus from Steve and I are that the IPI-specific validations should be moved to be later, so you can do the UPI workflow with the baremetal platform.

Copy link
Member

@stbenjam stbenjam Jun 24, 2020

Choose a reason for hiding this comment

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

If you are just looking to iterate quickly, then I'd suggest doing it in a branch/fork. That worked well for us early on in baremetal IPI days, because we could iterate really quickly without the scrutiny that comes with merging to the installer master branch.

(That approach has its downsides too, since eventually you'll need it to make it to master and needs to get reviewed. We spent quite a long time addressing the installer team's feedback on our large PR to merge our fork.)

Choose a reason for hiding this comment

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

I like the suggestion of reworking the validations such that runtime validations happen at create cluster time.

@stbenjam do you think thats something someone external to the team can develop? I'm concerned this is not a trivial effort and implies only long term solution?

We are going to push back against any new field added to the platform. It's not that we're trying to be difficult, but because we're concerned about the user experience of an already complicated setup. Every field we add is another setting that needs documenting and users will see it and need to consider it (even if they don't need to do anything with it explicitly).

do we see a path for an internal only flag? e.g. not supported / documented outside this usage path?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we can help - @dhellmann is going to put together a proposal to make sure we understand exactly what you need.

#3794 (comment)

@stbenjam
Copy link
Member

Commit message needs updating to meet https://github.com/openshift/installer/blob/master/CONTRIBUTING.md.

Your text in the PR description should go in the commit message.

@romfreiman
Copy link

We are using this ENV: OPENSHIFT_INSTALL_INVOKER="assisted-installer"
Do u think we can rely on it?

@stbenjam
Copy link
Member

We are using this ENV: OPENSHIFT_INSTALL_INVOKER="assisted-installer"
Do u think we can rely on it?

The installer team generally doesn't allow new uses of environment variables, I don't think that will work. We left a few suggestions in the thread above about how to solve this without a specific validations knob.

@romfreiman
Copy link

@yevgeny-shnaidman I guess we can set LibvirtURI='PIVOT' and and skipt :)

@romfreiman
Copy link

romfreiman commented Jun 24, 2020 via email

@romfreiman
Copy link

romfreiman commented Jun 24, 2020 via email

@dhellmann
Copy link
Contributor

can u send alternative pr? if u have already an agreement? thanks

I'll spend some time putting together an enhancement proposal describing a way we could make this change.

@dhellmann
Copy link
Contributor

openshift/enhancements#388 describes in more detail what I think @hardys and @stbenjam were proposing.

@openshift-ci-robot
Copy link
Contributor

@yevgeny-shnaidman: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-ovirt 6f5c2d4 link /test e2e-ovirt
ci/prow/e2e-aws-upgrade 6f5c2d4 link /test e2e-aws-upgrade
ci/prow/e2e-aws-scaleup-rhel7 6f5c2d4 link /test e2e-aws-scaleup-rhel7
ci/prow/e2e-libvirt 6f5c2d4 link /test e2e-libvirt
ci/prow/verify-codegen 6f5c2d4 link /test verify-codegen

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@hardys
Copy link

hardys commented Jul 9, 2020

Should we close this in favor of #3851 ?

Similarly I think openshift/enhancements#388 supersedes #3788 ?

@dhellmann
Copy link
Contributor

/close

@openshift-ci-robot
Copy link
Contributor

@dhellmann: Closed this PR.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/baremetal IPI bare metal hosts platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants