Bug 1980041 - Review Request: python-xds-protos - ProtoBuf generated Python files for xDS protos
Summary: Review Request: python-xds-protos - ProtoBuf generated Python files for xDS p...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Major Hayden 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1974484
TreeView+ depends on / blocked
 
Reported: 2021-07-07 16:32 UTC by Ben Beasley
Modified: 2021-07-25 22:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-25 22:04:57 UTC
Type: ---
Embargoed:
mhayden: fedora-review+


Attachments (Terms of Use)

Description Ben Beasley 2021-07-07 16:32:26 UTC
Spec URL: https://music.fedorapeople.org/python-xds-protos.spec
SRPM URL: https://music.fedorapeople.org/python-xds-protos-0.0.8-1.fc34.src.rpm
Description:

Package “xds-protos” is a collection of ProtoBuf generated Python files for xDS
protos (or the data-plane-api, https://github.com/envoyproxy/data-plane-api).
You can find the source code of this project in https://github.com/grpc/grpc.
For any question or suggestion, please post to
https://github.com/grpc/grpc/issues.

Each generated Python file can be imported according to their proto package.
For example, if we are trying to import a proto located at
“envoy/service/status/v3/csds.proto”, whose proto package is
“package envoy.service.status.v3”, then we can import it as:

  # Import the message definitions
  from envoy.service.status.v3 import csds_pb2
  # Import the gRPC service and stub
  from envoy.service.status.v3 import csds_pb2_grpc

Fedora Account System Username: music

Koji mock builds:

F35: https://koji.fedoraproject.org/koji/taskinfo?taskID=71466095

Updates for F34 and older are not currently planned.

This is an unusual package in that the ultimate sources are in grpc (https://src.fedoraproject.org/rpms/grpc), as of grpc 1.38. The release on PyPI (https://pypi.org/project/xds-protos/) contains only the generated sources.

We instead build from the ultimate sources (grpc plus some external projects that are included in grpc as git submodules, and from which we provably use only .proto files).

This is submitted as a separate package rather than built as a grpc subpackage because it has its own version numbering and release cadence, and the git submodules needed to build it are not otherwise needed in the grpc source RPM, so it really makes more sense for this to be a self-contained package.

To make it more awkward, some of these generated bindings are already installed as part of https://src.fedoraproject.org/rpms/python-opencensus-proto or https://src.fedoraproject.org/rpms/python-googleapis-common-protos, so those packages are added as dependencies and the conflicting bindings are carefully unbundled.

To make it even more awkward, this package depends circularly on grpc; some grpc subpackages are required to generate the bindings, while other grpc subpackages depend on the bindings. The necessary bootstrapping will be handled in grpc when it is updated to 1.38.x (in Rawhide/F35).

For full details and rationales, please see the spec file comments. I believe I have handled everything in the most reasonable way, but suggestions are still quite welcome.

Comment 1 Ben Beasley 2021-07-07 16:37:26 UTC
I am setting NEEDINFO for Major Hayden, the maintainer of both python-googleapis-common-protos and python-opencensus-proto, since this package interacts so closely with those packages. Please consider looking over this spec file and letting me know if you have any feedback.

Furthermore, due to their close relationship with this package and with grpc, which I also maintain, I offer to co-maintain either or both of those packages. I am also more than happy to add you as a co-maintainer to this package. Please let me know if you would like me to do so.

Comment 2 Major Hayden 🤠 2021-07-07 17:14:23 UTC
Ben -- thanks for the heads up. I am happy to add you as a maintainer on both. To be honest, I don't know either of the packages well (I was assigned them abruptly by another Fedora maintainer recently) and could defintely use some help to know if they're being packaged adequately.

I'll add you as a maintainer on both right now.

Comment 3 Ben Beasley 2021-07-07 18:28:51 UTC
Thanks! Do you have any input on this package (“no” is an acceptable answer!), and do you want to be a co-maintainer on it once it is approved?

Comment 4 Major Hayden 🤠 2021-07-07 18:34:13 UTC
I don't have any input on this package at all. I didn't do an in-depth review but I found nothing there that gave me any concern. You're welcome to add me if you like, but I honestly don't know much about this package (or the ones I have that are related). 😉

Comment 5 Ben Beasley 2021-07-07 18:38:58 UTC
OK, I’ll leave you off the co-maintainers for now, but feel free to send PR’s, or to ask for access in the future. Thanks for your input.

Comment 6 Major Hayden 🤠 2021-07-07 18:39:45 UTC
You're welcome!

Comment 7 Ben Beasley 2021-07-22 15:55:59 UTC
I’ve updated this to build from the latest grpc source (1.39.0). The python-xds-protos version number is unchanged, as are the commit hashes of the additional sources.

There’s a version 0.0.10 on PyPI, but there are no sources for it in the grpc repository. I’ve filed an issue about this (https://github.com/grpc/grpc/issues/26756). For now, 0.0.8 is still the latest version I can build from the ultimate sources in grpc.

Updated spec: https://music.fedorapeople.org/grpc-1.39/python-xds-protos.spec
Updated SRPM: https://music.fedorapeople.org/grpc-1.39/python-xds-protos-0.0.8-1.fc35.src.rpm

Comment 8 Major Hayden 🤠 2021-07-23 20:47:14 UTC
Does this package have directory conflicts with the existing python3-opencensus-proto? (That's one I maintain and I am happy to transfer it to you if you wish.) 😉

It failed when I tried to build it on rawhide in COPR:

  https://copr.fedorainfracloud.org/coprs/mhayden/review-python-xds-proto/build/2347099/

+ /usr/bin/python3 generated_file_import_test.py
Traceback (most recent call last):
  File "/builddir/build/BUILD/grpc-1.39.0/tools/distrib/python/xds_protos/generated_file_import_test.py", line 179, in <module>
    from envoy.extensions.rate_limit_descriptors.expr.v3 import expr_pb2
  File "/builddir/build/BUILD/grpc-1.39.0/tools/distrib/python/xds_protos/envoy/extensions/rate_limit_descriptors/expr/v3/expr_pb2.py", line 14, in <module>
    from google.api.expr.v1alpha1 import syntax_pb2 as google_dot_api_dot_expr_dot_v1alpha1_dot_syntax__pb2
ModuleNotFoundError: No module named 'google.api.expr'
error: Bad exit status from /var/tmp/rpm-tmp.2hhpnJ (%check)
    Bad exit status from /var/tmp/rpm-tmp.2hhpnJ (%check)


Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Dist tag is present.


===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "*No copyright* Apache License 2.0", "Unknown or generated",
     "BSD (3 clause)", "Apache License 2.0". 581 files have unknown
     license. Detailed output of licensecheck in /1980041-python-xds-
     protos/licensecheck.txt
[?]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by: /usr/lib/python3.10/site-
     packages/opencensus(python3-opencensus-proto, python3-opencensus),
     /usr/lib/python3.10/site-packages/opencensus/proto(python3-opencensus-
     proto), /usr/lib/python3.10/site-
     packages/opencensus/proto/agent(python3-opencensus-proto),
     /usr/lib/python3.10/site-
     packages/opencensus/proto/metrics(python3-opencensus-proto),
     /usr/lib/python3.10/site-
     packages/opencensus/proto/resource(python3-opencensus-proto),
     /usr/lib/python3.10/site-
     packages/opencensus/proto/stats(python3-opencensus-proto),
     /usr/lib/python3.10/site-
     packages/opencensus/proto/trace(python3-opencensus-proto)
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[-]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[?]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[x]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 0 bytes in 0 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[x]: Python eggs must not download any dependencies during the build
     process.
[x]: A package which is used by another package via an egg interface should
     provide egg info.
[x]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: Packages MUST NOT have dependencies (either build-time or runtime) on
     packages named with the unversioned python- prefix unless no properly
     versioned package exists. Dependencies on Python packages instead MUST
     use names beginning with python2- or python3- as appropriate.
[x]: Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
[x]: Binary eggs must be removed in %prep

===== SHOULD items =====

Generic:
[x]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[?]: Package should compile and build into binary rpms on all supported
     architectures.
[?]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Cannot parse rpmlint output:


Rpmlint (installed packages)
----------------------------
Cannot parse rpmlint output:


Source checksums
----------------
https://github.com/census-instrumentation/opencensus-proto/archive/4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89/opencensus-proto-4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89.tar.gz :
  CHECKSUM(SHA256) this package     : 27b7982d3ab3a0a66e09d997bbb373e1c83a48abad6da09bbc866428f443a727
  CHECKSUM(SHA256) upstream package : 27b7982d3ab3a0a66e09d997bbb373e1c83a48abad6da09bbc866428f443a727
https://github.com/envoyproxy/protoc-gen-validate/archive/872b28c457822ed9c2a5405da3c33f386ac0e86f/protoc-gen-validate-872b28c457822ed9c2a5405da3c33f386ac0e86f.tar.gz :
  CHECKSUM(SHA256) this package     : 388ea2261bc1d2c6ef6ec01bfaa3aec451aedb245e23514033ccc9b5cc10c4ab
  CHECKSUM(SHA256) upstream package : 388ea2261bc1d2c6ef6ec01bfaa3aec451aedb245e23514033ccc9b5cc10c4ab
https://github.com/googleapis/googleapis/archive/82944da21578a53b74e547774cf62ed31a05b841/googleapis-82944da21578a53b74e547774cf62ed31a05b841.tar.gz :
  CHECKSUM(SHA256) this package     : a45019af4d3290f02eaeb1ce10990166978c807cb33a9692141a076ba46d1405
  CHECKSUM(SHA256) upstream package : a45019af4d3290f02eaeb1ce10990166978c807cb33a9692141a076ba46d1405
https://github.com/cncf/udpa/archive/cc1b757b3eddccaaaf0743cbb107742bb7e3ee4f/udpa-cc1b757b3eddccaaaf0743cbb107742bb7e3ee4f.tar.gz :
  CHECKSUM(SHA256) this package     : 822a007cf155855d0c08a2e753a39e222e5816b904436196244066a818a8a230
  CHECKSUM(SHA256) upstream package : 822a007cf155855d0c08a2e753a39e222e5816b904436196244066a818a8a230
https://github.com/envoyproxy/data-plane-api/archive/18b54850c9b7ba29a4ab67cbd7ed7eab7b0bbdb2/data-plane-api-18b54850c9b7ba29a4ab67cbd7ed7eab7b0bbdb2.tar.gz :
  CHECKSUM(SHA256) this package     : 4423bef0ab15053dca0f723cbdaf4b48ab145e9d8158f02e33028c66fb1d20e0
  CHECKSUM(SHA256) upstream package : 4423bef0ab15053dca0f723cbdaf4b48ab145e9d8158f02e33028c66fb1d20e0
https://github.com/grpc/grpc/archive/v1.39.0/grpc-1.39.0.tar.gz :
  CHECKSUM(SHA256) this package     : b16992aa1c949c10d5d5ce2a62f9d99fa7de77da2943e643fb66dcaf075826d6
  CHECKSUM(SHA256) upstream package : b16992aa1c949c10d5d5ce2a62f9d99fa7de77da2943e643fb66dcaf075826d6


Requires
--------
python3-xds-protos (rpmlib, GLIBC filtered):
    python(abi)
    python3.10dist(grpcio)
    python3.10dist(protobuf)
    python3dist(googleapis-common-protos)
    python3dist(opencensus-proto)



Provides
--------
python3-xds-protos:
    python-xds-protos
    python3-xds-protos
    python3.10-xds-protos
    python3.10dist(xds-protos)
    python3dist(xds-protos)



Generated by fedora-review 0.7.6 (b083f91) last change: 2020-11-10
Command line :/usr/bin/fedora-review -b 1980041
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api, Python
Disabled plugins: Ocaml, C/C++, SugarActivity, Java, Perl, Haskell, PHP, fonts, R
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 9 Ben Beasley 2021-07-23 20:57:46 UTC
> Does this package have directory conflicts with the existing python3-opencensus-proto? (That's one I maintain and I am happy to transfer it to you if you wish.) 😉

It still co-owns some directories it shouldn’t, now that python-opencensus-proto co-owns the directory for the “opencensus” namespace package. I’ll update that.

> It failed when I tried to build it on rawhide in COPR:

I’ll look at that too.

> - Dist tag is present.

This is because fedora-review doesn’t yet understand rpmautospec (%autorelease/%autochangelog).

Comment 10 Ben Beasley 2021-07-24 13:40:11 UTC
Okay, I fixed the directory ownership with python-opencensus-proto. I wasn’t doing it quite right to begin with, and I hadn’t updated it for python-opencensus-proto co-owning %{python3_sitelib}/opencensus.

I was able to reproduce the build failure you reported in COPR. It’s extremely strange, because it builds just fine on Koji (https://koji.fedoraproject.org/koji/taskinfo?taskID=72559908). I’ll look at it some more and post an updated submission once I figure it out.

Comment 11 Ben Beasley 2021-07-25 13:29:21 UTC
I can’t explain why it was working in Koji but not COPR, but I fixed the %check section. Now I overlay the installed package with the bundled dependencies in a single temporary tree—at least, in cases where the dependencies are combined under a single namespace package with files installed in this package, i.e., under “google”—to emulate an actual RPM install, which is what I should have done to begin with.

Updated spec: https://music.fedorapackages.org/20210724/python-xds-protos.spec
Updated SRPM: https://music.fedorapackages.org/20210724/python-xds-protos-0.0.8-1.fc34.src.rpm

Comment 12 Major Hayden 🤠 2021-07-25 14:50:50 UTC
Nice! The directory issues look to be resolved!

However, I took a look at the %check section and it seems like the tests didn't run. I may be misunderstanding what's supposed to happen there, but I saw this in COPR[0]:

~/build/BUILD/grpc-1.39.0
+ popd
+ PYTHONPATH=/builddir/build/BUILD/grpc-1.39.0/testlib
+ /usr/bin/python3
+ RPM_EC=0
++ jobs -p
+ exit 0
Processing files: python3-xds-protos-0.0.8-1.fc35.noarch

Everything else looks fine but I just wanted to check with you on how those tests are supposed to work.

[0] https://copr.fedorainfracloud.org/coprs/mhayden/review-python-xds-proto/build/2348398/

Comment 13 Ben Beasley 2021-07-25 15:03:40 UTC
This is the tests:

> + /usr/bin/python3

The only test is a script that tries importing all the modules. The name of the script doesn’t appear on the command line because I passed its contents to Python on stdin using shell input redirection—a somewhat unusual way to run a script, but I didn’t want the directory containing the script to be added to the Python path, just to reduce the number of possible sources of import confusion.

Comment 14 Major Hayden 🤠 2021-07-25 15:09:06 UTC
Okay, I see now. I just wanted to be sure. This one looks good to go! Enjoy the rest of your Sunday. 🎉

Comment 15 Ben Beasley 2021-07-25 16:34:04 UTC
Thanks for reviewing this ugly duckling of a package! 🦆

Comment 16 Gwyn Ciesla 2021-07-25 18:05:24 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-xds-protos


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