ovis-hpc / ldms

OVIS/LDMS High Performance Computing monitoring, analysis, and visualization project.
https://github.com/ovis-hpc/ovis-wiki/wiki
Other
98 stars 51 forks source link

ovis-base.spec.in has a variety of issues #9

Closed jhansonhpe closed 5 years ago

jhansonhpe commented 6 years ago

I'm trying to build rpms so make deployment easier. I have diffs to support sles, to run ldconfig in a post so that builds where we install to prefix other than /usr and some other clean up.

``diff --git a/packaging/ovis-base.spec.in b/packaging/ovis-base.spec.in index 78a4eb2..9b53eb0 100644 --- a/packaging/ovis-base.spec.in +++ b/packaging/ovis-base.spec.in @@ -6,7 +6,7 @@

%-define _unpackaged_files_terminate_build 0

%-define _missing_doc_files_terminate_build 0

-%define ldms_all System Environment/Libraries +%define ovis System Environment/Libraries

%if 0%{?rhel} && 0%{?rhel} <= 6 %{!?python2: %global python2 /usr/bin/python2} @@ -14,21 +14,50 @@ %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif

+%define suse %(if [ "%_vendor" = "suse" ]; then echo 1; else echo 0; fi) +%define redhat %(if [ "%_vendor" = "redhat" ]; then echo 1; else echo 0; fi) +%if "%{_vendor}" == "redhat" +%define is_rhel5 %(test -f /etc/redhat-release && grep -q "^Red Hat Enterprise Linux Server release 5" /etc/redhat-release && echo 1 || echo 0) +%define is_rhel6 %(test -f /etc/redhat-release && grep -q "^Red Hat Enterprise Linux Server release 6" /etc/redhat-release && echo 1 || echo 0) +%define is_rhel7 %(test -f /etc/redhat-release && grep -q "^Red Hat Enterprise Linux Server release 7" /etc/redhat-release && echo 1 || echo 0) +%else +%define is_rhel5 0 +%define is_rhel6 0 +%define is_rhel7 0 +%endif + +%if "%{_vendor}" == "suse" +%define is_sles11 %(test -f /etc/SuSE-release && grep -q "^SUSE Linux Enterprise Server 11" /etc/SuSE-release && echo 1 || echo 0) +%define is_sles12 %(test -f /etc/SuSE-release && grep -q "^SUSE Linux Enterprise Server 12" /etc/SuSE-release && echo 1 || echo 0) +%else +%define is_sles11 0 +%define is_sles12 0 +%endif + +

Main package

Summary: OVIS LDMS Commands and Libraries -Name: ldms-all +Name: ovis Version: @VERSION@ Release: ovis1%{?dist} License: GPLv2 or BSD -Group: %{ldms_all} +Group: %{ovis} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source: %{name}-%{version}.tar.gz -Requires: rpm >= 4.8.0 ovis-libevent2 boost-devel genders libyaml libyaml-devel python2 python2-devel -BuildRequires: doxygen openssl-devel libibverbs-devel librdmacm-devel gcc ovis-libevent2-devel glib2-devel libibmad-devel boost-devel genders ovis-libevent2 libyaml libyaml-devel python2 python2-devel gettext-devel +%if "%{_vendor}" == "suse" +Requires: rpm >= 4.8.0 libevent-2_0-5 boost-devel genders libyaml-0-2 libyaml-devel python2 python2-devel +BuildRequires: doxygen openssl-devel libibverbs-devel librdmacm-devel gcc libevent-devel glib2-devel libibmad-devel boost-devel genders libyaml-0-2 libyaml-devel python2 python2-devel gettext-devel +%endif +%if "%{_vendor}" == "redhat" +Requires: rpm >= 4.8.0 libevent boost-devel genders libyaml libyaml-devel python2 python2-devel +BuildRequires: doxygen openssl-devel libibverbs-devel librdmacm-devel gcc libevent-devel glib2-devel libibmad-devel boost-devel genders libyaml libyaml-devel python2 python2-devel gettext-devel +%endif Url: http://ovis.ca.sandia.gov/

-Prefix: /usr

+Prefix: @prefix@ +%define _prefix @prefix@ +%define _datadir %{_prefix}/share +%define _docdir %{_datadir}/doc

%description This package provides the LDMS commands and libraries, OVIS apis and transport libraries, and scalable object store libraries. @@ -48,6 +77,7 @@ echo bBUILDROOT $RPM_BUILD_ROOT %configure @ac_configure_args@ make

+# core %install echo TMPPATH %{_tmppath} echo BUILDROOT $RPM_BUILD_ROOT @@ -56,13 +86,12 @@ make DESTDIR=${RPM_BUILD_ROOT} install rm -f $RPM_BUILD_ROOT%{_libdir}/.la rm -f $RPM_BUILD_ROOT%{_libdir}/ovis-ldms/lib.la

fix in subsequent after sorting use of sysconfdir or share/baler in baler

-rm $RPM_BUILD_ROOT%{_prefix}/etc/ovis/eng-dictionary rm $RPM_BUILD_ROOT%{bindir}/test rm $RPM_BUILD_ROOT%{_bindir}/ldms_ban.sh -mv $RPM_BUILD_ROOT%{_docdir}/ovis-ldms-/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ -mkdir $RPM_BUILD_ROOT%{_sysconfdir} -cp -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/sample_init_scripts/genders/etc/init.d $RPM_BUILD_ROOT%{_sysconfdir} -cp -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/sample_init_scripts/genders/etc/sysconfig $RPM_BUILD_ROOT%{_sysconfdir} +cp -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/sample_init_scripts/genders/ $RPM_BUILD_ROOT%{_sysconfdir}/%{name} +rm $RPM_BUILD_ROOT%{_docdir}/%{name}-lib-%{version}/README +rm $RPM_BUILD_ROOT%{_docdir}/%{name}-lib-%{version}/COPYING +rm $RPM_BUILD_ROOT%{_docdir}/%{name}-lib-%{version}/ChangeLog

%clean rm -rf $RPM_BUILD_ROOT @@ -72,16 +101,17 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/ %{_bindir}/ %{_sbindir}/* -%{_docdir}/%{name}-%{version}/COPYING -%{_docdir}/%{name}-%{version}/ChangeLog -%{_docdir}/%{name}-%{version}/AUTHORS +%{_docdir}/%{name}-ldms-%{version}/COPYING +%{_docdir}/%{name}-ldms-%{version}/ChangeLog +%{_docdir}/%{name}-ldms-%{version}/AUTHORS +%{_docdir}/%{name}-ldms-%{version}/README

end core

devel

%package devel Summary: LDMS devel package Group: %{ldms_grp} -Requires: ldms-all = @VERSION@ +Requires: ovis = @VERSION@ %description devel This is a development package of Lightweight Distributed Metric System (LDMS). Users who want to implement their own sampler or store must install this @@ -99,7 +129,7 @@ package. %package initscripts Summary: LDMS initscripts for libgenders control of %{name} Group: %{ldms_grp} -Requires: ldms-all = @VERSION@ +Requires: ovis = @VERSION@ %description initscripts This is the libgenders based boot scripts for LDMS daemons. Users must provide information via /etc/genders (or alternate file) @@ -108,43 +138,54 @@ to make these scripts operate. They are required to fail out of the box. %files initscripts %defattr(-,root,root) %{_sysconfdir}// + +%post -n initscripts +/sbin/ldconfig + +%postun -n initscripts +/sbin/ldconfig +

end initscripts

+# doc %package doc Summary: Documentation files for %{name} -Group: %{ldms_all} +Group: %{ovis}

Requires: %{name}-devel = %{version}-%{release}

%description doc -Doxygen files for ldms-all package. +Doxygen files for ovis package. %files doc %defattr(-,root,root) %{_mandir}// -%{_datadir}/doc/%{name}-%{version} +#%{_datadir}/doc/%{name}-%{version} +%{_datadir}/doc %docdir %{_defaultdocdir} +#end doc

+# python2 %package python2 Summary: Python files for LDMS %description python2 Python files for LDMS %files python2 %defattr(-,root,root) -%{python2_sitelib}/ +%{_prefix}/lib/python2.7/site-packages/

end python2

see https://fedoraproject.org/wiki/Packaging:Python_Old

and https://fedoraproject.org/wiki/Packaging:Python

-

%changelog - Thu Oct 13 2015 Ben Allan baallan@sandia.gov 3.0.0-1 + Wed Feb 14 2018 Jeff Hanson jeff.hanson@hpe.com 3.0.1-1 +clean up of rpm creation + Tue Oct 13 2015 Ben Allan baallan@sandia.gov 3.0.0-1 update to v3. - Thu Aug 25 2015 Ben Allan baallan@sandia.gov 2.4.5-1 + Tue Aug 25 2015 Ben Allan baallan@sandia.gov 2.4.5-1 update to latest upstream. - Thu Jul 29 2015 Ben Allan baallan@sandia.gov 2.4.4-1 +* Wed Jul 29 2015 Ben Allan baallan@sandia.gov 2.4.4-1 update to latest upstream.

jhansonhpe commented 6 years ago

Sorry that looks horrible.

baallan commented 6 years ago

Hi, the spec file you reference has, I thought, been removed from the next release (if not the current one). We have refactored rpm/deb packaging out of the source repositories. A more SLES appropriate (cray derived) packaging will be found in https://github.com/baallan/distribution/tree/master/cle6.unstable (I should also note that the current packaging scheme deployed for Cray XC is maintained by Tom Tucker, my cle6 is an older, more granular scheme).

My public repo for packaging scripts is structured to easily accept contributions from other platforms and developers (each in its own directory). It is also structured so (for related platforms) it is easy to make updates and see differences in the various packaging schemes using graphical diff tools. If you would like to contribute, please let me know or make a pull request.

As you will find if you persist in reading the baallan/distribution repo documentation, we have for several reasons put significant effort into making rpms for some platforms relocatable and even installable by users without access to the host's rpm database. If you are packaging for a specific platform, you are not obliged to follow that pattern.

jhansonhpe commented 6 years ago

Where, then, are the right repo(s) to get current release? https://ovis.ca.sandia.gov/index.php/Main_Page points only to here. I realize that when one configures for sos it references opengrid repos.

baallan commented 6 years ago

I have updated the wiki downloads page to reference the separate packaging scripts repository I mentioned in my earlier reply. The ovis source code repository is the one you have already found.

jhansonhpe commented 6 years ago

I have made a sles12 directory that builds. Do you have suggestions for testing the as built rpms? I was thinking to test balerd.master to take in a node's syslog and balerd.slave to forward another node to the master and that bquery can show patterns. For ldms just be sure the as built daemon start correctly and expose metrics.

baallan commented 6 years ago

Others may have suggestions for testing baler. For LDMS, if you included in your sles12 packaging the scripts from ldms/scripts (which end up in $bindir in a source build), some of these may work as ldms tests for you. ldms_plugins_list.sh ldms-meminfo.sh and ldms-py-subset_test.sh are some of my favorites.

baallan commented 5 years ago

@jhansonhpe This issue seems to have gone inactive. Reopen if needed or let us know what else we can do for you.