Bug 1816858

Summary: Review Request: kata-agent - kata containers guest agent
Product: [Fedora] Fedora Reporter: Cole Robinson <crobinso>
Component: Package ReviewAssignee: Fabiano Fidêncio <fidencio>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dinechin, fidencio, package-review
Target Milestone: ---Flags: fidencio: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-02 00:31:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cole Robinson 2020-03-24 21:58:07 UTC
Spec URL: https://fedorapeople.org/~crobinso/reviews/kata-agent/kata-agent.spec
SRPM URL: https://fedorapeople.org/~crobinso/reviews/kata-agent/kata-agent-1.11.0-0.1.alpha1.fc33.src.rpm
Fedora Account System Username: crobinso

Description: Kata containers guest image agent. This is used inside the
appliance OS image for kata-containers.

https://github.com/kata-containers/agent

Currently this code is in Fedora, but it is built as part of the
kata-osbuilder package. This separates the two. The file locations
are changed so there is presently no conflict. kata-osbuilder will
need some packaging changes to use the new location.

Comment 1 Cole Robinson 2020-03-24 21:59:32 UTC
Assigning to Fabiano but maybe c3d wants to take it, both cc'd

Comment 2 Fabiano Fidêncio 2020-03-25 06:10:49 UTC
Cole,

Before actually going through the tedious official review process, there's one thing that caught my attention. Here's the output of the unpacked RPM:

> fidencio@dahmer /tmp/1816858-kata-agent/rpms-unpacked $ ls -lhaR *
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm:
> total 0
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 .
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 ..
> drwxrwxr-x. 5 fidencio fidencio 100 Mar 25 06:42 usr
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr:
> total 0
> drwxrwxr-x. 5 fidencio fidencio 100 Mar 25 06:42 .
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 ..
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 lib
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 libexec
> drwxrwxr-x. 4 fidencio fidencio  80 Mar 25 06:42 share
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/lib:
> total 0
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 .
> drwxrwxr-x. 5 fidencio fidencio 100 Mar 25 06:42 ..
> drwxr-xr-x. 3 fidencio fidencio  60 Mar 25 06:42 .build-id
>
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/lib/.build-id:
> total 0
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 .
> drwxrwxr-x. 3 fidencio fidencio 60 Mar 25 06:42 ..
> drwxr-xr-x. 2 fidencio fidencio 60 Mar 25 06:42 df
>
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/lib/.build-id/df:
> total 0
> drwxr-xr-x. 2 fidencio fidencio 60 Mar 25 06:42 .
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 ..
> lrwxrwxrwx. 1 fidencio fidencio 64 Mar 25 06:42 8eb6fe32584f97fb0f462e500f07819fd5ac83 -> ../../../../usr/libexec/kata-containers/agent/usr/bin/kata-agent
>
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec:
> total 0
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 .
> drwxrwxr-x. 5 fidencio fidencio 100 Mar 25 06:42 ..
> drwxr-xr-x. 3 fidencio fidencio  60 Mar 25 06:42 kata-containers
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers:
> total 0
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 .
> drwxrwxr-x. 3 fidencio fidencio 60 Mar 25 06:42 ..
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 agent

Eveyrthing is fine until here ...

> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers/agent:
> total 0
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 .
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 ..
> drwxr-xr-x. 4 fidencio fidencio 80 Mar 25 06:42 usr
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers/agent/usr:
> total 0
> drwxr-xr-x. 4 fidencio fidencio 80 Mar 25 06:42 .
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 ..
> drwxr-xr-x. 2 fidencio fidencio 60 Mar 25 06:42 bin
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 lib
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers/agent/usr/bin:
> total 26M
> drwxr-xr-x. 2 fidencio fidencio  60 Mar 25 06:42 .
> drwxr-xr-x. 4 fidencio fidencio  80 Mar 25 06:42 ..
> -rwxr-xr-x. 1 fidencio fidencio 26M Mar 25 06:38 kata-agent

I'd rather place the kata-agent binary together with kata-netmonm, kata-proxy, and kata-shim, in /usr/libexec/kata-containers

> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers/agent/usr/lib:
> total 0
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 .
> drwxr-xr-x. 4 fidencio fidencio 80 Mar 25 06:42 ..
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 systemd
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers/agent/usr/lib/systemd:
> total 0
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 .
> drwxr-xr-x. 3 fidencio fidencio 60 Mar 25 06:42 ..
> drwxr-xr-x. 2 fidencio fidencio 80 Mar 25 06:42 system
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/libexec/kata-containers/agent/usr/lib/systemd/system:
> total 8.0K
> drwxr-xr-x. 2 fidencio fidencio  80 Mar 25 06:42 .
> drwxr-xr-x. 3 fidencio fidencio  60 Mar 25 06:42 ..
> -rw-r--r--. 1 fidencio fidencio 582 Mar 25 06:38 kata-agent.service
> -rw-r--r--. 1 fidencio fidencio 332 Mar 25 06:38 kata-containers.target

For the systemd files, I'd rather place them in /usr/libexec/kata-containers/agent/systemd/

> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/share:
> total 0
> drwxrwxr-x. 4 fidencio fidencio  80 Mar 25 06:42 .
> drwxrwxr-x. 5 fidencio fidencio 100 Mar 25 06:42 ..
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 doc
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 licenses
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/share/doc:
> total 0
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 .
> drwxrwxr-x. 4 fidencio fidencio  80 Mar 25 06:42 ..
> drwxr-xr-x. 2 fidencio fidencio 100 Mar 25 06:42 kata-agent
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/share/doc/kata-agent:
> total 16K
> drwxr-xr-x. 2 fidencio fidencio  100 Mar 25 06:42 .
> drwxrwxr-x. 3 fidencio fidencio   60 Mar 25 06:42 ..
> -rw-r--r--. 1 fidencio fidencio  170 Mar 17 20:09 CODE_OF_CONDUCT.md
> -rw-r--r--. 1 fidencio fidencio  184 Mar 17 20:09 CONTRIBUTING.md
> -rw-r--r--. 1 fidencio fidencio 4.8K Mar 17 20:09 README.md
> 
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/share/licenses:
> total 0
> drwxrwxr-x. 3 fidencio fidencio 60 Mar 25 06:42 .
> drwxrwxr-x. 4 fidencio fidencio 80 Mar 25 06:42 ..
> drwxr-xr-x. 2 fidencio fidencio 60 Mar 25 06:42 kata-agent
>
> kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm/usr/share/licenses/kata-agent:
> total 12K
> drwxr-xr-x. 2 fidencio fidencio  60 Mar 25 06:42 .
> drwxrwxr-x. 3 fidencio fidencio  60 Mar 25 06:42 ..
> -rw-r--r--. 1 fidencio fidencio 12K Mar 17 20:09 LICENSE

Everything else is fine.

So, comments made, may I ask your take on those? Is there some specific reason behind the dir structure chosen for kata-agent binary and systemd files?

Comment 3 Fabiano Fidêncio 2020-03-25 06:16:26 UTC
(In reply to Fabiano Fidêncio from comment #2)

> So, comments made, may I ask your take on those? Is there some specific
> reason behind the dir structure chosen for kata-agent binary and systemd
> files?

And, of course there is a specific reason for that, explicitly mentioned in the spec file:
# Install the whole kata agent rooted in /usr/libexec
# The whole tree is copied into the appliance

Comment 4 Fabiano Fidêncio 2020-03-25 06:44:08 UTC
Package Review
==============

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

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

C/C++:
[-]: Package does not contain kernel modules.
[-]: Package contains no static executables.
[-]: Package does not contain any libtool archives (.la)
[-]: Rpath absent or only used for internal libs.

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.

[x]: Package does not own files or directories owned by other packages.
* Well, /usr/libexec/kata-containers is also owned by kata-shim / kata-runtime / kata-proxy.
  Is this an issue? I don't think so.

[x]: %build honors applicable compiler flags or justifies otherwise.
[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
[x]: 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.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: 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.
[x]: Package contains systemd file(s) if in need.

[x]: Useful -debuginfo package or justification otherwise.
* There's no -debuginfo package, but AFAIU it wouldn't be needed.

[!]: Package is not known to require an ExcludeArch tag.
* Package doesn't build on arm32, but this shouldn't be blocker.

[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.

[x]: Package complies to the Packaging Guidelines
* As much as possible, as it also tries to be compatible with EL8.

[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]: Dist tag is present.
[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]: Packages must not store files under /srv, /opt or /usr/local

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

Generic:
[-]: 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.
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.

[!]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
* gpgverify is not used, but shouldn't be a blocker

[?]: 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.
* arm32 is not supported for now

[!]: %check is present and all tests pass.
* Not exactly an issue for now.

[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]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: kata-agent-1.11.0-0.1.alpha1.fc33.x86_64.rpm
          kata-agent-1.11.0-0.1.alpha1.fc33.src.rpm
kata-agent.x86_64: W: spelling-error %description -l en_US osbuilder -> bodybuilder, builder
kata-agent.x86_64: W: unstripped-binary-or-object /usr/libexec/kata-containers/agent/usr/bin/kata-agent
kata-agent.src: W: spelling-error %description -l en_US osbuilder -> bodybuilder, builder
2 packages and 0 specfiles checked; 0 errors, 3 warnings.




Rpmlint (installed packages)
----------------------------
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "C.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "C.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
kata-agent.x86_64: W: spelling-error %description -l en_US osbuilder -> bodybuilder, builder
kata-agent.x86_64: W: invalid-url URL: https://github.com/kata-containers/agent <urlopen error [Errno -2] Name or service not known>
kata-agent.x86_64: W: unstripped-binary-or-object /usr/libexec/kata-containers/agent/usr/bin/kata-agent
1 packages and 0 specfiles checked; 0 errors, 3 warnings.

Comment 5 Christophe de Dinechin 2020-03-25 09:29:32 UTC
Reviewed the spec file rapidly. Looks good to me with two notes:

1) Do we need the -Sgit option for autosetup?

2) I would use the same DESTDIR for both make and make install. Often, makefiles introduce hard-to-debug dependencies on make variables, we don't want some mysterious failure down the line.

Comment 6 Cole Robinson 2020-03-25 14:07:41 UTC
(In reply to Fabiano Fidêncio from comment #3)
> (In reply to Fabiano Fidêncio from comment #2)
> 
> > So, comments made, may I ask your take on those? Is there some specific
> > reason behind the dir structure chosen for kata-agent binary and systemd
> > files?
> 
> And, of course there is a specific reason for that, explicitly mentioned in
> the spec file:
> # Install the whole kata agent rooted in /usr/libexec
> # The whole tree is copied into the appliance

Yup, and it allows us to use kata-agent 'make' to install the files for us.
If we wanted to use a different file hierarchy, we would need to manually
reimplement the install process which isn't future proof. FWIW I did something
similar for kata-osbuilder initially but it required some hacks there so
this was my workaround

Comment 7 Cole Robinson 2020-03-25 14:36:52 UTC
(In reply to Christophe de Dinechin from comment #5)
> Reviewed the spec file rapidly. Looks good to me with two notes:
> 
> 1) Do we need the -Sgit option for autosetup?
> 

If using git format-patch output for .patch files in the repo, using
-Sgit can be required in some instances IIRC, but I don't remember the details.
We can probably get away with out it, it's just what I use by default.

> 2) I would use the same DESTDIR for both make and make install. Often,
> makefiles introduce hard-to-debug dependencies on make variables, we don't
> want some mysterious failure down the line.

Good point, I will add that before committing

Comment 8 Gwyn Ciesla 2020-03-25 14:48:45 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/kata-agent

Comment 9 Fedora Update System 2020-03-25 17:59:25 UTC
FEDORA-2020-6cc0bb7f4f has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-6cc0bb7f4f

Comment 10 Fedora Update System 2020-03-25 21:07:10 UTC
FEDORA-2020-6cc0bb7f4f has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-6cc0bb7f4f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-6cc0bb7f4f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-04-02 00:31:25 UTC
FEDORA-2020-6cc0bb7f4f has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.