Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make 'make check' more consistent, and better documented, across projects #566

Conversation

bcrocker15
Copy link
Contributor

@bcrocker15 bcrocker15 commented Mar 31, 2021

Makefile:

Abolish the 'prepare-check' target, merging its functionality into
'check' target. In 'check' target, conditionally install

  • python3-flexmock
  • python3-requre

depending on presence/absence of /usr/share/doc/python3-flexmock
and /usr/bin/requre-patch respectively.

Check for

  • ansible-bender
  • podman

in 'build' target.

Remove all mention of unused python3-tox.

CONTRIBUTING.md:

Remove all mention of unused tox.

Remove mention of prepare-check (merged into 'check' target).
Document installation of python3-flexmock and python3-requre
by 'make check', ansible-bender and podman by 'make build'.

Include note about 7.1 GB of disk space consumed by 'make build'.

Mention conditional installation of

  • ansible-bender
  • podman
  • python3-requre
  • python3-flexmock

Minor language & spelling fixes.

Fixes #579

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

Copy link
Member

@lachmanfrantisek lachmanfrantisek left a comment

Choose a reason for hiding this comment

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

Thanks for improving that!

Makefile Outdated Show resolved Hide resolved
Makefile Outdated
Comment on lines 17 to 13
if ! test -x /usr/bin/tox ; then sudo dnf -y install python3-tox ; fi
if ! test -x /usr/bin/requre-patch ; then sudo dnf -y install python3-requre ; fi
if ! test -d /usr/share/doc/python3-flexmock ; then sudo dnf -y install python3-flexmock ; fi
Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

ogr/services/github/project.py Outdated Show resolved Hide resolved
@bcrocker15 bcrocker15 self-assigned this May 5, 2021
@bcrocker15 bcrocker15 changed the title Update prepare-check to install python3-requre, python3-flexmock Make 'make check' more consistent, and better documented, across projects May 5, 2021
@bcrocker15 bcrocker15 force-pushed the ogr-makefile-update-prepare-check branch from 00b73cb to f339c39 Compare May 5, 2021 19:45
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

Makefile Outdated
@@ -4,12 +4,13 @@ PY_PACKAGE := ogr
OGR_IMAGE := ogr

build: recipe.yaml
if ! test -x /usr/bin/ansible-bender ; then sudo dnf -y install ansible-bender ; fi
Copy link
Contributor

Choose a reason for hiding this comment

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

I think -y should be removed here, as this might potentially install software on someones system, and they might want to first review what is installed.

Also, mind that by doing this, these make targets won't be usable on any other Linux distro then Fedora Linux and family (where dnf is used for package management). Sometimes we have contributors who are using Ubuntu or even MacOS. So having a list of dependencies in CONTRIBUTING.md would be more useful for them. In part, this was the reason I was arguing to create a separate target to install the required tooling, independent of make check.

And lastly: if dnf is used to install packages, probably using rpm to check if those packages are already installed would be semantically more correct and more resilient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree about (dnf) -y, EXCEPT that Zuul really hates being presented
with the interactive dialogue; see the results of the latest push
below, summarized here:
...
Install 2 Packages

Total download size: 229 k
Installed size: 891 k
Is this ok [y/N]: Operation aborted.
make: *** [Makefile:20: check] Error 1

At the same time, I introduced some code to detect whether the OS is
Fedora and set (new) PACKAGE_CHECKER and PACKAGE_INSTALLER
accordingly.

I totally agree about using rpm (rpm -q --quiet) to check whether
packages are already installed, so PACKAGE_CHECKER = rpm -q --quiet
on Fedora.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree about (dnf) -y, EXCEPT that Zuul really hates being presented
with the interactive dialogue; see the results of the latest push
below, summarized here:
...
Install 2 Packages

Total download size: 229 k
Installed size: 891 k
Is this ok [y/N]: Operation aborted.
make: *** [Makefile:20: check] Error 1

Yet another argument to have a separate make target to install dependencies and one to run the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I will reintroduce the 'prepare-check' target and move the
dependency checks back under it, and I'll use similar constructs
in our other projects.

@bcrocker15 bcrocker15 force-pushed the ogr-makefile-update-prepare-check branch from f339c39 to bfb3af2 Compare May 10, 2021 23:00
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@bcrocker15 bcrocker15 force-pushed the ogr-makefile-update-prepare-check branch from bfb3af2 to 1960705 Compare May 11, 2021 16:04
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@csomh
Copy link
Contributor

csomh commented May 12, 2021

@bcrocker15 I see the tests are passing now, is this ready for review?

@bcrocker15 bcrocker15 marked this pull request as ready for review May 12, 2021 12:21
@bcrocker15 bcrocker15 force-pushed the ogr-makefile-update-prepare-check branch from 1960705 to ab13c63 Compare May 12, 2021 18:23
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@bcrocker15
Copy link
Contributor Author

regate

Copy link
Contributor

@csomh csomh left a comment

Choose a reason for hiding this comment

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

I have one more note on this, otherwise looks fine. Thanks! 👍

CONTRIBUTING.md Outdated
Comment on lines 64 to 67
NOTE that 'make build' uses approximately 7.1 GB of disk space; see /etc/containers/storage.conf
for the location of this storage. It is typically /var/lib/containers/storage for root,
$HOME/.local/share/containers/storage for non-root users. ('make check-in-container' does not use
appreciably more storage.)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this information could get out of date quickly, might vary from system to system, and most of it is a repetition of the podman/buildah documentation. But there is some value mentioning that building the container image will require a handful of GB of storage. Maybe mention just that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I acknowledge that the required disk storage, and its location, might
change over time. But I think we have to start somewhere, and I think
we need both pieces of information; as a user, my first question after
learning that OGR 'make check' requires 7.1 GB of storage space would
be "WHERE do I need 7.1 GB free?"

Please note also that the buildah manpage itself recapitulates
information from the podman manpage:

buildah:
--root value

   Storage root dir (default:  "/var/lib/containers/storage"  for  UID  0,
   "$HOME/.local/share/containers/storage"  for  other users) Default root
   dir is configured in /etc/containers/storage.conf

podman:
--root=value

   Storage root dir in which data, including images, is  stored  (default:
   "/var/lib/containers/storage"  for  UID 0, "$HOME/.local/share/contain‐
   ers/storage"  for  other  users).   Default  root  dir  configured   in
   /etc/containers/storage.conf.

Copy link
Contributor

Choose a reason for hiding this comment

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

Buildah and podman are sister projects, they track each other closely and share many of the developers. We don't do either, so duplicating information from their man pages instead of referencing it, creates the risk of ultimately giving incorrect or misleading guidance for future contributors of this project. In my view it is outside of the scope of this contribution guide to teach its readers about container tooling and how to configure it, especially if that tooling has appropriate documentation.

Please update the note to the following:

NOTE that 'make build' requires a handful of GB of storage. Consult `man containers-storage.conf` to learn more about container storage paths (usually, for rootless users)  and configuration.

@bcrocker15 bcrocker15 requested a review from csomh May 13, 2021 19:40
@bcrocker15 bcrocker15 force-pushed the ogr-makefile-update-prepare-check branch from ab13c63 to 5fd32ed Compare May 14, 2021 14:29
Copy link
Contributor

@csomh csomh left a comment

Choose a reason for hiding this comment

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

Good to be merged. Thank you!

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@bcrocker15 bcrocker15 added the mergeit When set, zuul wil gate and merge the PR. label May 14, 2021
@mfocko
Copy link
Member

mfocko commented May 14, 2021

recheck

should be fixed now

@bcrocker15
Copy link
Contributor Author

regate

1 similar comment
@csomh
Copy link
Contributor

csomh commented May 17, 2021

regate

@csomh csomh added mergeit When set, zuul wil gate and merge the PR. and removed mergeit When set, zuul wil gate and merge the PR. labels May 17, 2021
@mfocko
Copy link
Member

mfocko commented May 17, 2021

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@csomh
Copy link
Contributor

csomh commented May 20, 2021

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

Introduce IS_FEDORA to record whether we're building on Fedora,
and to introduce a model for conditionalizing on OS; introduce
PACKAGE_CHECKER to check for presence of package, and
PACKAGE_INSTALLER to install a package.

In 'prepare-check' target, check for and conditionally install:

- python3-flexmock
- python3-requre

depending on presence/absence of /usr/share/doc/python3-flexmock
and /usr/bin/requre-patch respectively.

Introduce 'prepare-build' target, check for and conditionally
install:

- ansible-bender
- podman

in 'build' target.

Remove all mention of unused python3-tox.

CONTRIBUTING.md:

Remove all mention of unused tox.

Document installation of python3-flexmock and python3-requre by
'make prepare-check', ansible-bender and podman by 'make prepare-build'.

Include note about multiple GB of disk space consumed by 'make build'.

Mention conditional installation of

- ansible-bender
- podman
- python3-requre
- python3-flexmock

Minor language & spelling fixes.

Fixes OGR issue packit#579

Signed-off-by: Ben Crocker <[email protected]>
@bcrocker15 bcrocker15 force-pushed the ogr-makefile-update-prepare-check branch from 5fd32ed to b834535 Compare May 20, 2021 12:23
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@csomh
Copy link
Contributor

csomh commented May 20, 2021

regate

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit f1d906b into packit:main May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make 'make check' more consistent (and better documented) across all projects
4 participants