Bug 1854815 - Missing example scripts of python3-ovirt-engine-sdk4 on RHVH hosts
Summary: Missing example scripts of python3-ovirt-engine-sdk4 on RHVH hosts
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine-sdk-python
Classification: oVirt
Component: General
Version: 4.3.0
Hardware: x86_64
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Ori Liel
QA Contact: Ilan Zuckerman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-08 09:44 UTC by Ilan Zuckerman
Modified: 2020-08-05 09:14 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-09 07:14:10 UTC
oVirt Team: Storage
Embargoed:


Attachments (Terms of Use)

Description Ilan Zuckerman 2020-07-08 09:44:29 UTC
Description of problem:

On RHVH hosts although the package python3-ovirt-engine-sdk4 [1] is installed, BUT the contents (such as example scripts) are missing [2].
For example, on regular rhel 8.2 hosts, we have the following folder with all its content [3], while on RHVH host it is absent. Making this impossible to run example scripts on it.

Our automated test suites are depended on those scripts, therefore this is an automation blocker.

RHVH host:

[root@lynx12 ~]# nodectl info
bootloader: 
  default: rhvh-4.4.1.1-0.20200705.0 (4.18.0-193.12.1.el8_2.x86_64)
  entries: 
    rhvh-4.4.1.1-0.20200705.0 (4.18.0-193.12.1.el8_2.x86_64): 
      index: 0
      kernel: /boot//rhvh-4.4.1.1-0.20200705.0+1/vmlinuz-4.18.0-193.12.1.el8_2.x86_64
      args: nofb quiet intel_iommu=on default_hugepagesz=1G hugepagesz=1G hugepages=4 hugepagesz=2M hugepages=1024 console=tty0 crashkernel=auto resume=/dev/mapper/rhvh_lynx12-swap rd.lvm.lv=rhvh_lynx12/rhvh-4.4.1.1-0.20200705.0+1 rd.lvm.lv=rhvh_lynx12/swap console=ttyS1,115200 boot=UUID=0bf5fc0f-b740-4c2c-8687-5cf77bc49bef rootflags=discard img.bootid=rhvh-4.4.1.1-0.20200705.0+1
      root: /dev/rhvh_lynx12/rhvh-4.4.1.1-0.20200705.0+1
      initrd: /boot//rhvh-4.4.1.1-0.20200705.0+1/initramfs-4.18.0-193.12.1.el8_2.x86_64.img
      title: rhvh-4.4.1.1-0.20200705.0 (4.18.0-193.12.1.el8_2.x86_64)
      blsid: rhvh-4.4.1.1-0.20200705.0+1-4.18.0-193.12.1.el8_2.x86_64
layers: 
  rhvh-4.4.1.1-0.20200705.0: 
    rhvh-4.4.1.1-0.20200705.0+1
current_layer: rhvh-4.4.1.1-0.20200705.0+1


[1]:
[root@lynx12 ~]# rpm -qa | grep sdk4
python3-ovirt-engine-sdk4-4.4.4-1.el8ev.x86_64


[2]:
[root@lynx12 ~]# find / -type d  -name python3-ovirt-engine-sdk4
/usr/share/licenses/python3-ovirt-engine-sdk4

THIS IS SIMPLY A LICENSE FOLDER. THERE IS NOTHING IN IT EXCEPT FOR LICENSE FILE

[root@lynx12 ~]# find / -type f  -name backup_vm.py
[root@lynx12 ~]# 

----------------------------------------------------

Regular rhel8.2 host:

[root@lynx01 ~]# rpm -qa | grep release
redhat-release-8.2-1.0.el8.x86_64
redhat-release-eula-8.2-1.0.el8.x86_64
rhv-release-4.4.1-10-001.noarch

[3]:
[root@lynx01 ~]# find / -type d  -name python3-ovirt-engine-sdk4
/usr/share/licenses/python3-ovirt-engine-sdk4
/usr/share/doc/python3-ovirt-engine-sdk4

[root@lynx01 ~]# find / -type f  -name backup_vm.py
/usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py

Version-Release number of selected component (if applicable):

Comment 1 Sandro Bonazzola 2020-07-08 10:25:43 UTC
Please note that on RHV-H we purposely omit all the files marked as documentation.
If the missing files are needed, they should belong to some other place rather than docs (example: /usr/libexec)

I still don't get why our automation relies on existence of example files being on a system.
Looks like a fragile automation to me.

Comment 2 Nir Soffer 2020-07-08 12:37:01 UTC
Sandro, QE uses the examples scripts because this is the best way to test
complex flows like image transfer and backup. We don't want QE to duplicate
the effort, copy the example code into the tests, and maintain duplicate code.

A nice side effect is validating that the examples are correct. We know that
the upload, donwload, and backup examples are correct because we have QE
automated tests running them. If you try other examples there is good chance
that they are broken since they are not tested and testing them is hard.

We need a simple way to install the examples on RHH-H if needed. Maybe we
should have python3-ovirt-engine-sdk4-examples rpm?

Once we have ovirt-img tool (bug 1626262) QE can update the tests to use it
instead of the examples, but until we have it need the examples.

Comment 3 Martin Perina 2020-07-09 07:14:10 UTC
This known feature for RHVH, it never contains documentation. So it's just yet another point to prioritize BZ1626262 and stop using examples as production code.

Comment 4 Avihai 2020-07-09 09:06:48 UTC
(In reply to Martin Perina from comment #3)
> This known feature for RHVH, it never contains documentation. 
Hi Martin,
Just to understand better:

- Why is this a feature? not providing SDK examples to customers is not a good practice in an open-source product.

- May I ask what is the difficulty to add it to RHVH?

- As Nir stated in comment#2 this is the only efficient way for customers and QE to get the latest recommended examples that are otherwise very complex to find out by themselves.
 
- As RHVH is very commonly used by customers we should have docs in there as well especially complex examples as image-io which is very prone to errors if you try it by yourself. 

> So it's just
> yet another point to prioritize BZ1626262 and stop using examples as
> production code.
SDK examples(as all examples/docs) should be tested by QE as this is the recommended way and the 1st place customers will look for help, otherwise, why provide them at all?

Sure if BZ1626262 was ready and running we could switch to it instead(not sure this tool will cover all SDK image related examples)
But for now it's not there neither for QE or more important for customers to use it so in RHVH we are left with no best practice/example which is very important.

Until this tool is ready and operational SDK examples are all we have to test it properly and quickly.


Nir,

Will this tool provides all the needed functionality as in SDK examples.
Also, we/customer will need examples for the tool as well :) 
(upload/download/CBT backup restore) , will this cover everything?

Comment 5 Martin Perina 2020-07-09 10:14:29 UTC
(In reply to Avihai from comment #4)
> (In reply to Martin Perina from comment #3)
> > This known feature for RHVH, it never contains documentation. 
> Hi Martin,
> Just to understand better:
> 
> - Why is this a feature? not providing SDK examples to customers is not a
> good practice in an open-source product.
> 
> - May I ask what is the difficulty to add it to RHVH?
> 
> - As Nir stated in comment#2 this is the only efficient way for customers
> and QE to get the latest recommended examples that are otherwise very
> complex to find out by themselves.
>  
> - As RHVH is very commonly used by customers we should have docs in there as
> well especially complex examples as image-io which is very prone to errors
> if you try it by yourself. 
> 
> > So it's just
> > yet another point to prioritize BZ1626262 and stop using examples as
> > production code.
> SDK examples(as all examples/docs) should be tested by QE as this is the
> recommended way and the 1st place customers will look for help, otherwise,
> why provide them at all?
> 
> Sure if BZ1626262 was ready and running we could switch to it instead(not
> sure this tool will cover all SDK image related examples)
> But for now it's not there neither for QE or more important for customers to
> use it so in RHVH we are left with no best practice/example which is very
> important.
> 
> Until this tool is ready and operational SDK examples are all we have to
> test it properly and quickly.

Examples should be simple short pieces of code which should show how to use a library, in this case SDK. They are not meant to be complete and they definitely should not be used as is for production, they should just be used as code pieces for developers to build their own applications.

RHVH always contained the code to strip all documentation like files (man pages, examples, ...) to minimize its size, so I don't see any single reason why SDK should be an exception. As mentioned above full SDK should be installed on developer machines, whey they can study the examples to develop their own application, but examples are completely irrelevant for production usage.

Comment 6 Nir Soffer 2020-08-05 09:14:24 UTC
(In reply to Avihai from comment #4)
> Will this tool provides all the needed functionality as in SDK examples.
> Also, we/customer will need examples for the tool as well :) 
> (upload/download/CBT backup restore) , will this cover everything?

This is the plan, everything that use imageio API will work using the tool.


Note You need to log in before you can comment on or make changes to this bug.