Skip to content

Remove underused targets (mainly building upstream RPMs) #1520

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

Merged

Conversation

mpreisler
Copy link
Member

Let's get rid of underused weird complexities in the build system. In the upstream repo it makes sense to build a tarball or a zip file but IMO it makes no sense to be building RPMs. The place to build RPMs is downstream distribution like Fedora or RHEL.

Martin Preisler added 3 commits October 21, 2016 11:06
It complicates our build system and we rarely use it. The workflow is to
build a tarball and a zip file and then build RPMs or other packages
from that in downstream. Upstream git repo is not the right place to be
building RPMs.
@mpreisler mpreisler added this to the 0.1.31 milestone Oct 21, 2016
@redhatrises
Copy link
Contributor

I see your point, but also disagree with it. IMO, I find it extremely useful for testing, exploring new features/bugfixs, etc. when upstream incorporates packaging in the build system, and find it a little annoying when you have to go find a spec file in some downstream system somewhere. IMO, it would be better to have the spec files upstream (except %changelog) rather than have multiple spec files that have to be updated. But, I am sure that there are reasons here that I am not seeing.

@mpreisler
Copy link
Member Author

What's the reason to make an RPM and then install it when you can just run make install? What if you are on Debian or Arch? Downstream packaging should be downstream.

We can definitely do some sort of CI/CD flow in Jenkins that will build nightly RPMs. We don't have to carry a spec file and the machinery to build RPMs in the upstream git to do that.

@redhatrises
Copy link
Contributor

I see your point. I would think it would be easier to setup automated testing for QE tasks if we can ever get to that point.

@redhatrises
Copy link
Contributor

redhatrises commented Oct 21, 2016

You do however remove the make git-tag which was supposed to make tagging a new version easier. Are you wanting to remove that as well?

@mpreisler
Copy link
Member Author

@redhatrises Yeah, if we decide to rip out the RPM building the git-tag target won't do much more than git tag x.y.z

@redhatrises
Copy link
Contributor

Ack.

@redhatrises redhatrises merged commit 02299eb into ComplianceAsCode:master Oct 21, 2016
@mpreisler
Copy link
Member Author

Dear SSG users, you have now found why the RPM target is missing in the SSG release you are using. Please be mad at @mpreisler and @redhatrises equally, they both deserve it.

@mpreisler mpreisler deleted the remove_underused_targets branch October 21, 2016 20:57
@shawndwells
Copy link
Member

Not sure why my reply didn't get picked up by GitHub...

image

So, if RPM building is now removed from SSG, where is the most appropriate place to put RPM build code? Should I make a new project (e.g. OpenSCAP/rpm-build) to put all this back into?

@redhatrises
Copy link
Contributor

redhatrises commented Oct 24, 2016

@shawndwells must have happened during the DOS attacks that were happening.
@mpreisler thoughts on Shawn's comment? Maybe we refactor RPM generation or revert this PR?

@mpreisler
Copy link
Member Author

@shawndwells In Fedora git, RHEL git, COPR git, etc...

http://pkgs.fedoraproject.org/cgit/rpms/scap-security-guide.git/tree/scap-security-guide.spec

@shawndwells
Copy link
Member

On 10/24/16 9:54 AM, Martin Preisler wrote:

@shawndwells https://github.com/shawndwells In Fedora git, RHEL git,
COPR git, etc...

http://pkgs.fedoraproject.org/cgit/rpms/scap-security-guide.git/tree/scap-security-guide.spec

Not sure I follow. How will that help me make on-demand RPMs? Place that
SPEC into a new project?

Shawn Wells
Chief Security Strategist
U.S. Public Sector
shawn@redhat.com | 443.534.0130

@mpreisler
Copy link
Member Author

mpreisler commented Oct 25, 2016

Why would you want to upload an unreleased SSG to NIST.gov? Why would anyone want to build an RPM from an unstable git version of SSG?

Both of those sound like massive support nightmares.

EDIT: We don't have make rpm in any other SCAP project and I think it's fairly rare in other upstream projects. Why is SSG special in this regard?

@mpreisler
Copy link
Member Author

Besides, uploading unsigned RPM content built from unofficial git spec to NIST.gov sounds like a bad idea. If it were me I would upload an official signed RPM or a plain ZIP file.

@shawndwells
Copy link
Member

Definitely need rpm creation to stay. It's a staple in almost all demos, downstream creates RPMs (e.g. NSA SIMP), and has become incredibly invaluable when customers want to create their own rpm based off newer versions than what ships in RHEL.

Not to mention, whenever my NIST.gov account gets recreated I'll be uploading RPMs per SSG release.

Rom building definitely has to stay. If it doesn't, we'll have to build an entirely different project to create rpm releases....

Shawn Wells

On Oct 21, 2016, at 11:05 AM, Martin Preisler notifications@github.com wrote:

What's the reason to make an RPM and then install it when you can just run make install? What if you are on Debian or Arch? Downstream packaging should be downstream.

We can definitely do some sort of CI/CD flow in Jenkins that will build nightly RPMs. We don't have to carry a spec file and the machinery to build RPMs in the upstream git to do that.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@mpreisler
Copy link
Member Author

Two related references:

I will reiterate that creating RPM on demand from unreleased git bits is not how packages are meant to work. If there is no repository and no signing involved I don't understand what the value is over zip or tarball files.

We could run scap-as-rpm on the nightly built ZIP file and provide that via jenkins. That would create an unsigned RPM every night from latest unreleased git bits. Definitely not for production use but might be useful for testing.

@redhatrises
Copy link
Contributor

@shawndwells I think @mpreisler brings up a good point about having a signed RPM rather than unsigned. I does seem weird that a security content that advocates enabling and using signed RPMs is not signed itself.

I wonder as an alternative if RH could internally build the SSG RPM nightly as well sign the rpm? Or if OpenSCAP can sign an rpm it generates if a key is imported? However, either of those may not be a possibility.

@redhatrises redhatrises added the Infrastructure Our content build system label Oct 25, 2016
@mpreisler mpreisler mentioned this pull request Oct 25, 2016
@trevor-vaughan
Copy link
Collaborator

So, I would like to request some easy way of building RPMs from the SSG repositories.

Given that I have to fork everything to make custom modifications, and I have my own signing keys, I'm happy to do the signing myself as long as I have an easy way to do so.

I definitely need the ability to generate a valid tarball and spec file from the latest git release.

I do not need the ability to build a full RPM or SRPM, I already have build scaffolding via mock to do that.

The SSG is a highly forked project and I like to have a nice consistent environment with RPMs so I would like to request that at least the ability to generate a valid spec file is restored.

@mpreisler
Copy link
Member Author

Given that I have to fork everything to make custom modifications, and I have my own signing keys, I'm happy to do the signing myself as long as I have an easy way to do so.

Could you please elaborate on what kind of custom modifications you need to make? Very likely we (or yourself) could make upstream changes that would make this easier if we knew what you were doing.

I definitely need the ability to generate a valid tarball and spec file from the latest git release.

make tarball stays and generates a proper source tarball. make zip generates a built SCAP zip bundle.

I am not sure what your release process is but if you make customizations and then release your own version of SSG you should rename it and mark it as your own. Using upstream spec that lists one of upstream developers as the maintainer will confuse users. I suggest you take the Fedora spec, alter it with your copyright, changelog, website and whatnot and use the tarball from upstream to build the RPM.

@trevor-vaughan
Copy link
Collaborator

trevor-vaughan commented Oct 31, 2016

The custom mods that I need are:

  1. OVAL tests that actually match my system
  2. Altered XCCDF mappings that match my users expectations
  3. Additional check logic that is specific to my user environments

We certainly will be pushing material back upstream once it has been proven to function as expected.

In the mean time, as with all other forks of software that we use, we will be installing the software via RPM in our environment.

Usually, what we do is we fork, maintain the existing spec file, then add our versioning to the top of the stack. This is 100% accurate and clearly denotes our custom changes in the local RPM changelog.

Without a local spec file that maintains all history...well.. frankly we'll do what we usually do which is to scavenge the spec file out of a Fedora SRPM and go from there.

While the absence of a spec file ins't a disaster, it does make it way easier for us to fork since forking is a requirement by design at this point.

We will be making commits, but you can't expect most of your Government users to do this. As such, the project should make it as easy as possible to distribute forks of the content into the field in a reusable, consistent, and auditable manner. AKA, a RPM.

@mpreisler
Copy link
Member Author

mpreisler commented Oct 31, 2016

@trevor-vaughan Correct me if I am wrong but it sounds like your use-case could be met with make tarball && rpmbuild -ba $your_spec && rpmsign $the_rpm.

Have you looked into scap-as-rpm I referenced above? That could be even more suitable than using make rpm.

We certainly will be pushing material back upstream once it has been proven to function as expected.

I recommend pushing material back as soon as possible. Otherwise you may be writing a bunch of checks in a way that we can never accept. Testing is definitely encouraged but proving that it works everywhere as expected is not necessary or practical.

People often postpone contributing back and then drop a huge pile of code on us. That is almost impossible for us to review and accept.

@radzy
Copy link

radzy commented Oct 31, 2016

@trevor-vaughan : I second @mpreisler 's comment about pushing things upstream ASAP. Waiting not only does creates an unreasonable load on the maintainers when you do push it, but it also tends to get your stuff out of sync, so that before you can get it accepted, you'll need to make major changes to reflect new upstream reorganization.

I also understand the sometimes political nature of pushing upstream. There are times when uploading things immediately can't be done for political reasons. But I recommend that you push back on those political decision makers as hard as you reasonably can, to keep your version and the upstream version in sync as closely as possible. You won't always succeed (or at least, I haven't), but the effort is better spent that way than reworking things in the code later on.

@trevor-vaughan
Copy link
Collaborator

@radzy and @mpreisler I 100% get the need to push early and push often. However, this circles back around to my argument that I should be able to have a very small overlay that I can maintain on top of your materials instead of needing to push back upstream because it may simply be irrelevant to most of the world.

scap-as-rpm looks OK but it's missing the Changelog. I feel that this is one of the more useful parts of the RPM to auditors and admins. Also, this now has me relying on a tool that may, or may not, keep up with the structure of the SSG codebase.

At this point, it sounds like you don't want to maintain a spec file in the codebase. This is fine but, once again, adding to the complexity of using the project thereby reducing the chance that you'll have additional outside committers moving forward. (Yes, I say this as the maintainer of a project that has a stupidly complex build process and keep trying to figure out how to fix it. So far, the answer has not been to make people look for more parts.)

@mpreisler
Copy link
Member Author

mpreisler commented Oct 31, 2016

@radzy and @mpreisler I 100% get the need to push early and push often. However, this circles back around to my argument that I should be able to have a very small overlay that I can maintain on top of your materials instead of needing to push back upstream because it may simply be irrelevant to most of the world.

You are 100% able to do that and always will be. This is an open source project. This PR is about making a divide between upstream and downstream that I believe is important going forward. It is definitely not about shutting down forks or anything of the sort.

scap-as-rpm looks OK but it's missing the Changelog. I feel that this is one of the more useful parts of the RPM to auditors and admins. Also, this now has me relying on a tool that may, or may not, keep up with the structure of the SSG codebase.

It looks like you want a well maintained RPM without maintaining it. scap-as-rpm is run on the Source DataStream or XCCDF file. As such it doesn't depend on how SSG is structured. You can give it any valid SDS file and it will work just fine.

The thing is, we really don't maintain a changelog in the upstream. It's a joke. Look at the last 10 entries:

* Wed Jun 22 2016 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.30-1
- Make new 0.1.30 upstream release

* Fri Apr 22 2016 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.29-1
- Make new 0.1.29 upstream release

* Tue Jan 19 2016 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.28-1
- Make new 0.1.28 upstream release

* Fri Dec 11 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.27-1
- Make new 0.1.27 upstream release

* Mon Oct 19 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.26-1
- Make new 0.1.26 upstream release

* Wed Aug 19 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.25-1
- Make new 0.1.25 upstream release

* Tue Jul 07 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.24-1
- Make new 0.1.24 release

* Mon Jun 22 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.23-1
- Make new 0.1.23 release

* Mon May 04 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.22-1
- Make new 0.1.22 release

* Fri Feb 20 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.21-1
- Make new 0.1.21 release

* Thu Jan 15 2015 Jan iankko Lieskovsky <jlieskov@redhat.com> 0.1.20-1
- Make new 0.1.20 release

At this point, it sounds like you don't want to maintain a spec file in the codebase. This is fine but, once again, adding to the complexity of using the project thereby reducing the chance that you'll have additional outside committers moving forward. (Yes, I say this as the maintainer of a project that has a stupidly complex build process and keep trying to figure out how to fix it. So far, the answer has not been to make people look for more parts.)

SSG is very much like that project. We are doing all this cleaning up and fat trimming to make it manageable going forward. SSG has grown organically into a copy pasted monster with a ton of weird "features" that nobody is using. With a ton of second-class products that somebody code dropped on us, that wouldn't build or validate. I think making SSG easy to start with and easy to patch is a much more important factor than being able to build arguably broken upstream RPMs using make rpm. That is the driving force behind ripping out build targets such as git-tag or rpm.

@trevor-vaughan
Copy link
Collaborator

@mpreisler Yeah, I had noticed the Changelog entries and that was a bit saddening.

Well, I've made my point and certainly have the ability to roll my own RPMs in my own special way.

I guess I would suggest putting a link to scap-as-rpm in the README.md file for people that need to roll their own and you can judge if it should go back in based on the number of hits to that repo (maybe).

@radzy
Copy link

radzy commented Oct 31, 2016

For me, the complexity is needless.

I cannot use the built-in RPM creation functionality during my
own distro's release processes. I did manually review it when
I was first getting started, to see what files I needed to point
my own process at, but that information is also available in the
install make target, which is what I looked at first.

So, again for me, the value is very very low, and what little
value there was is no longer needed at all.

The fact that it is RPM-centric is also a concern. Although my
distro does use RPMs at present, we're not strongly tied to that
format, and our customers can change it at any time.

(Aside: the same holds true of the XCCDF and OVAL content related
to RPMs, and the OpenSCAP rpm tests. Instead of RPM contents, we
must examine the file content after the RPM has been installed.
Could argue that that's the right way to do it regardless, but
that's a different discussion.)

So I'm certainly not opposed to deprecating RPM creation, and for
the "needless complexity" reason that Martin mentioned, I'm in
favor of deprecating it. At the same time, if there is someone who
really does get a large benefit from it, then I wouldn't want to
remove that benefit, either. But arguably, unsigned RPMs could
be considered lower value in the context of SSG.

@shawndwells
Copy link
Member

On 10/31/16 6:22 PM, radzy wrote:

So I'm certainly not opposed to deprecating RPM creation, and for
the "needless complexity" reason that Martin mentioned, I'm in
favor of deprecating it. At the same time, if there is someone who
really does get a large benefit from it, then I wouldn't want to
remove that benefit, either. But arguably, unsigned RPMs could
be considered lower value in the context of SSG.

I give about 3-5 SCAP conversations and workshops per week. Out of the
~15-20 customer visits per month, around 10 roll their own RPMs based on
our build system.

For some reason I'm failing to express how disruptive abruptly dropping
RPM creation was. Just yesterday, while speaking at a public event (Red
Hat Symposium), I was called out on stage for "that poor damned
decision to drop RPMs from upstream." From someone I've never even met
(or seen on GitHub or the mailing lists) before.

@shawndwells
Copy link
Member

And at this point, I'm literally going to have to maintain a fork of SSG, and point customers to contribute there, to get RPMs. Them I'm going to have to merge my fork, which will include US Gov contributions, periodically back to SSG. Total fucking disaster.

@redhatrises
Copy link
Contributor

In addition to @shawndwells comment, the FreeIPA project maintains rpm .spec files as well as build targets for making rpms. IMO, I think that we should revert as I think @shawndwells provides the justification to reverting and maintaining rpm builds.

@mpreisler
Copy link
Member Author

Alright, fair enough. I am still not convinced that building upstream RPMs has value but other people seem to think so and that's a good enough reason to keep it.

I will clean up this mess and add it back, hopefully tomorrow.

In retrospect we should have kept this PR unmerged for a while before people expressed their opinion.

@redhatrises
Copy link
Contributor

In retrospect we should have kept this PR unmerged for a while before people expressed their opinion.

Agreed. My fault on that one.

@radzy
Copy link

radzy commented Nov 3, 2016

+1 @shawndwells : great justification for having it.

With that, I agree that we should restore RPM creation.

@shawndwells
Copy link
Member

On 11/3/16 3:39 PM, Martin Preisler wrote:

Alright, fair enough. I am still not convinced that building upstream
RPMs has value but other people seem to think so and that's a good
enough reason to keep it.

I will clean up this mess and add it back, hopefully tomorrow.

In retrospect we should have kept this PR unmerged for a while before
people expressed their opinion.

Even on the Red Hat side: For USGCB content, we can upload releases
directly to NIST as we feel appropriate. In addition to datastream
files, need RPMs for those releases.

So - what is the best way to re-add the RPM build? As the one kicking
and screaming I'm happy to take the old .spec files and put them back
into the build. Will that get in the way of any of Martin's CMAKE work?

mpreisler pushed a commit to mpreisler/scap-security-guide that referenced this pull request Nov 4, 2016
…e_underused_targets"

This reverts commit 02299eb, reversing
changes made to 9f4d254.
@mpreisler
Copy link
Member Author

Adding RPM building back in #1540

Marked that as a blocker for the release.

mpreisler pushed a commit to mpreisler/scap-security-guide that referenced this pull request Nov 4, 2016
…e_underused_targets"

This reverts commit 02299eb, reversing
changes made to 9f4d254.
@mpreisler mpreisler mentioned this pull request Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants