assisted-service icon indicating copy to clipboard operation
assisted-service copied to clipboard

ECOPROJECT-2080: Add MTV operator as an option to cluster post installation

Open tupyy opened this issue 1 year ago • 17 comments
trafficstars

This PR adds an option to install Migration Toolkit for Virtualization.

Resolves: https://issues.redhat.com/browse/ECOPROJECT-2080

Signed-off-by: Cosmin Tupangiu [email protected]

tupyy avatar Aug 30 '24 08:08 tupyy

Hi @tupyy. Thanks for your PR.

I'm waiting for a openshift 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-sigs/prow repository.

openshift-ci[bot] avatar Aug 30 '24 08:08 openshift-ci[bot]

/retitle ECOPROJECT-2080: Add MTV operator as an option to cluster post installation

eifrach avatar Sep 02 '24 12:09 eifrach

@tupyy: This pull request references ECOPROJECT-2080 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

This PR adds an option to install Migration Toolkit for Virtualization.

Resolves: https://issues.redhat.com/browse/ECOPROJECT-2080

Signed-off-by: Cosmin Tupangiu [email protected]

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 openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar Sep 02 '24 12:09 openshift-ci-robot

/test edge-unit-test /test edge-lint /test edge-images

eifrach avatar Sep 02 '24 12:09 eifrach

Codecov Report

Attention: Patch coverage is 74.71264% with 44 lines in your changes missing coverage. Please review.

Project coverage is 68.74%. Comparing base (26185f1) to head (67bbb13). Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
internal/operators/mtv/operator.go 69.89% 22 Missing and 6 partials :warning:
internal/operators/mtv/manifest.go 73.91% 6 Missing and 6 partials :warning:
internal/featuresupport/features_olm_operators.go 85.71% 3 Missing and 1 partial :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6711      +/-   ##
==========================================
+ Coverage   68.71%   68.74%   +0.03%     
==========================================
  Files         249      251       +2     
  Lines       37440    37611     +171     
==========================================
+ Hits        25727    25857     +130     
- Misses       9414     9443      +29     
- Partials     2299     2311      +12     
Files with missing lines Coverage Δ
internal/cluster/statemachine.go 99.64% <100.00%> (+<0.01%) :arrow_up:
internal/cluster/validation_id.go 92.30% <100.00%> (ø)
internal/featuresupport/feature_support_level.go 96.49% <ø> (ø)
internal/featuresupport/features_platforms.go 92.73% <100.00%> (+0.64%) :arrow_up:
internal/host/statemachine.go 100.00% <100.00%> (ø)
internal/host/validation_id.go 90.90% <100.00%> (ø)
internal/operators/builder.go 100.00% <100.00%> (ø)
internal/featuresupport/features_olm_operators.go 88.43% <85.71%> (-0.53%) :arrow_down:
internal/operators/mtv/manifest.go 73.91% <73.91%> (ø)
internal/operators/mtv/operator.go 69.89% <69.89%> (ø)

... and 3 files with indirect coverage changes

codecov[bot] avatar Sep 02 '24 13:09 codecov[bot]

/test

tupyy avatar Sep 02 '24 13:09 tupyy

@tupyy: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test

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-sigs/prow repository.

openshift-ci[bot] avatar Sep 02 '24 13:09 openshift-ci[bot]

@eifrach Thank you for the review. I've done the fixes. PTAL

tupyy avatar Sep 02 '24 13:09 tupyy

@eifrach PTAL

tupyy avatar Sep 03 '24 09:09 tupyy

/test edge-unit-test /test edge-lint /test edge-images

eifrach avatar Sep 03 '24 10:09 eifrach

some validation tests:

# listing all operators 
$ curl -s 'http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/supported-operators' | jq .
[
  "odf",
  "cnv",
  "lvm",
  "mce",
  "mtv",
  "lso"
]

Check support level on version and arch

> curl -s 'http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/support-levels/features?openshift_version=4.13&cpu_architecture=arm64' | jq '.features | { MTV: .MTV, CNV: .CNV}'
{
  "MTV": "unavailable",
  "CNV": "unavailable"
}
>  curl -s 'http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/support-levels/features?openshift_version=4.13&cpu_architecture=x86_64' | jq '.features | { MTV: .MTV, CNV: .CNV}'
{
  "MTV": "unavailable",
  "CNV": "supported"
}


> curl -s 'http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/support-levels/features?openshift_version=4.16&cpu_architecture=x86_64' | jq '.features | { MTV: .MTV, CNV: .CNV}'
{
  "MTV": "supported",
  "CNV": "supported"
}
> curl -s 'http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/support-levels/features?openshift_version=4.16&cpu_architecture=arm64' | jq '.features | { MTV: .MTV, CNV: .CNV}'
{
  "MTV": "supported",
  "CNV": "dev-preview"
}

adding MTV to a cluster with CNV

curl -X 'PATCH' \
  'http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/clusters/b58b02f5-1311-4b5b-baa7-a7846cd90d27' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"olm_operators": [ {"name": "mtv"}]}' | jq .

# validate the operator was added 
> curl -s "http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/clusters/b58b02f5-1311-4b5b-baa7-a7846cd90d27/monitored-operators?operator_name=mtv" | jq .
[
  {
    "cluster_id": "b58b02f5-1311-4b5b-baa7-a7846cd90d27",
    "name": "mtv",
    "namespace": "openshift-mtv",
    "operator_type": "olm",
    "status_updated_at": "0001-01-01T00:00:00.000Z",
    "subscription_name": "mtv-operator",
    "timeout_seconds": 3600
  }
]

preflight requirements

> curl -s "http://rdu-infra-edge-02.infra-edge.lab.eng.rdu2.redhat.com:8090/api/assisted-install/v2/clusters/5ba559dc-202f-4ebe-96de-c278f3e4da92/preflight-requirements" 
  {
  "dependencies": [
    "cnv"
  ],
  "operator_name": "mtv",
  "requirements": {
    "master": {
      "qualitative": [
        "400 MiB of additional RAM",
        "1 additional CPUs"
      ],
      "quantitative": {
        "cpu_cores": 1,
        "ram_mib": 400
      }
    },
    "worker": {
      "qualitative": null,
      "quantitative": {}
    }
  }
},

eifrach avatar Sep 03 '24 11:09 eifrach

tested manual on compact Cluster

> oc --kubeconfig kubeconfig get clusterversions.config.openshift.io 
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.16.9    True        False         4m56s   Cluster version is 4.16.9

> oc --kubeconfig kubeconfig get subscriptions.operators.coreos.com  -A
NAMESPACE           NAME              PACKAGE                   SOURCE             CHANNEL
openshift-cnv       hco-operatorhub   kubevirt-hyperconverged   redhat-operators   stable
openshift-mtv       mtv-operator      mtv-operator              redhat-operators   
openshift-storage   lvms-operator     lvms-operator             redhat-operators   

> oc --kubeconfig kubeconfig get operators
NAME                                    AGE
kubevirt-hyperconverged.openshift-cnv   31m
lvms-operator.openshift-storage         31m
mtv-operator.openshift-mtv              31m

eifrach avatar Sep 03 '24 12:09 eifrach

/ok-to-test

eifrach avatar Sep 03 '24 12:09 eifrach

looks good to me, give me a few I'll merge it

eifrach avatar Sep 04 '24 12:09 eifrach

@tupyy Hey, I think we need to need to split these changes to more than one PR. We should have an epic which specifies the different tasks we should do to get the extra operator in assisted service, for example:

  • Add the necessary changes in assisted-test-infra (test env for this repo)
  • Adding a CI job that tests it (using test-infra)
  • Add feature flags
  • more.

It would be great to have a doc explaining what are changes are we performing and why (the Jira issue doesn't explain much) for clarity and documentation sake.

WDYT @eifrach

danmanor avatar Sep 04 '24 12:09 danmanor

@tupyy any progress with this change?

pkliczewski avatar Oct 07 '24 09:10 pkliczewski

@pkliczewski I need to complete the doc with the minimal requirements. I was waiting for reply from MTV team. just got it.

tupyy avatar Oct 07 '24 09:10 tupyy

/retest

tupyy avatar Oct 09 '24 07:10 tupyy

/retest

tupyy avatar Oct 09 '24 10:10 tupyy

@eifrach PTAL. I'm down to one job jailed

tupyy avatar Oct 09 '24 12:10 tupyy

/lgtm

eifrach avatar Oct 15 '24 10:10 eifrach

/hold

eifrach avatar Oct 15 '24 10:10 eifrach

/test edge-e2e-ai-operator-disconnected-capi

eifrach avatar Oct 28 '24 12:10 eifrach

/test edge-e2e-metal-assisted-mtv-4-17

eifrach avatar Oct 29 '24 08:10 eifrach

/test edge-e2e-metal-assisted-mtv-4-17

eifrach avatar Oct 29 '24 11:10 eifrach

/unhold /lgtm

eifrach avatar Oct 29 '24 13:10 eifrach

/approve

eifrach avatar Oct 29 '24 14:10 eifrach

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eifrach, tupyy

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

openshift-ci[bot] avatar Oct 29 '24 14:10 openshift-ci[bot]

/override ci/prow/edge-e2e-ai-operator-disconnected-capi

eifrach avatar Oct 29 '24 14:10 eifrach

@eifrach: Overrode contexts on behalf of eifrach: ci/prow/edge-e2e-ai-operator-disconnected-capi

In response to this:

/override ci/prow/edge-e2e-ai-operator-disconnected-capi

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-sigs/prow repository.

openshift-ci[bot] avatar Oct 29 '24 14:10 openshift-ci[bot]