Skip to content

Commit

Permalink
Implement spec file for openstack-kolla
Browse files Browse the repository at this point in the history
The package built with this spec file was able to successfully build
kolla images using the "kolla-build" tool on CentOS 7.
  • Loading branch information
steveb committed Nov 21, 2016
0 parents commit cfc07ca
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions openstack-kolla.spec
@@ -0,0 +1,61 @@
Name: openstack-kolla
Version: XXX

This comment has been minimized.

Copy link
@sdake

sdake Dec 13, 2016

I'm a fan of Vin Diesel, however, XXX doesn't seem to make sense for the Version 👍

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

This is RDO fu, XXX gets replaced by the RDO tooling (it allows tools like DLRN to build from git master)

This comment has been minimized.

Copy link
@sdake

sdake Dec 15, 2016

makes sense

Release: XXX

This comment has been minimized.

Copy link
@sdake

sdake Dec 13, 2016

release can just be 1 in this case

This comment has been minimized.

Copy link
@sdake

sdake Dec 15, 2016

this also makes sense.

Summary: Refresh system configuration

This comment has been minimized.

Copy link
@sdake

sdake Dec 13, 2016

Summary seems off.

This comment has been minimized.

Copy link
@steveb

steveb Dec 16, 2016

Author Owner

done


License: ASL 2.0
URL: http://pypi.python.org/pypi/kolla
Source0: http://tarballs.openstack.org/kolla/kolla-%{version}.tar.gz

BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python2-devel
BuildRequires: python-pbr

This comment has been minimized.

Copy link
@sdake

sdake Dec 13, 2016

IIRC RDO doesn't use PBR as it adds additional complexity to the build process. i'd recommend cross-referencing this against other packages in RDO - since my knowledge of RDO packaging is limited and perhaps RDO packaging has changed to include PBR.

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

I assume it does so DLRN can build a version from git


Requires: python-setuptools
Requires: python-gitdb
Requires: GitPython
Requires: python-jinja2
Requires: python-docker-py
Requires: python-six
Requires: python2-oslo-config
Requires: python-crypto
Requires: python-netaddr

%description
Templates and tools from the Kolla project to build OpenStack container images.

%prep
%setup -q -n kolla-%{upstream_version}

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

Since %{upstream_version} is used, please add this %{!?upstream_version: %global upstream_version %{version}%{?milestone}} at the top of the spec file.

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

done


%build
%{__python} setup.py build

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

It should be %{__python2} setup.py build or %py2_build

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

done


%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

It should be %{__python} setup.py install -O1 --skip-build --root %{buildroot} or %py2_install

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

I assume you meant %{__python2} ..., done


mkdir -p %{buildroot}%{_datadir}/kolla/docker
cp -vr docker/ %{buildroot}%{_datadir}/kolla

# setup.cfg required for kolla-build to discover the version
install -p -D -m 644 setup.cfg %{buildroot}%{_datadir}/kolla/setup.cfg

# remove tests
rm -fr %{buildroot}%{python_sitelib}/kolla/tests

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

Do not delete the tests, create a new sub package -tests and keep all the tests there.
It would be good to run tests under %check section while rpm build process.

This comment has been minimized.

Copy link
@sdake

sdake Dec 13, 2016

Running the tests requires a dependency of docker being enabled in the build environment. The tox code that runs the tests in the stable branches would work well for newton and mitaka, however, they have been removed in master. Since running the tests adds a bunch of complexity and the test code is gated upstream with voting gates, it may be possible to just ignore it for now.

Alternatively if you really desire to go down that path, recommend speaking to Jeffrey4l on irc (#openstack-kolla), as he has been doing most of the gate rework that removed the tox testing which "made it easy" previously.

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

Requiring docker and building images makes these more functional tests, I don't think it will be practical to run these during the package build in environments like DLRN.

This comment has been minimized.

Copy link
@sdake

sdake Dec 15, 2016

Tend to agree.


# remove tools
rm -fr %{buildroot}%{_datadir}/kolla/tools

%files
%doc README.rst
%doc LICENSE

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

It should be %license LICENSE

This comment has been minimized.

Copy link
@steveb

steveb Dec 16, 2016

Author Owner

done

%doc %{_datadir}/kolla/doc
%doc %{_datadir}/kolla/etc_examples

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

configuration files does not goes under %doc macro. Under %install section
install -d -m 755 %{buildroot}%{_sysconfdir}/kolla
cp -vr etc_examples %{buildroot}%{_sysconfdir}/kolla
then under %files
replace "%doc %{_datadir}/kolla/etc_examples" with %{_sysconfdir}/kolla/*

This comment has been minimized.

Copy link
@sdake

sdake Dec 13, 2016

I'm not sure this is quite correct. I'm not sure where etc_examples comes from. Looking at the stable branches for both newton and mitaka as well as master I see:

master: https://github.com/openstack/kolla/tree/master/etc
newton: https://github.com/openstack/kolla/tree/stable/newton/etc
mitaka: https://github.com/openstack/kolla/tree/stable/mitaka/etc

I'm not sure how this spec file builds.

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

This might be something which arrived early in ocata and was removed with k8s split. I'll delete it.

This comment has been minimized.

Copy link
@sdake

sdake Dec 15, 2016

k8s was always a separate repo. kolla-ansible was split, but its possible although the stable trees don't have those dirs. Kolla doesn't backport feature changes (and etc_examples would be a feature).

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

oh yeah, I meant kolla-ansible

This comment has been minimized.

Copy link
@steveb

steveb Dec 15, 2016

Author Owner

@sdake etc_examples comes from etc/ as processed by the python packaging: https://github.com/openstack/kolla/blob/master/setup.cfg#L34

This comment has been minimized.

Copy link
@sdake

sdake Dec 16, 2016

apologies for the noise on that one; sadly I wrote that setup.cfg initially (although blame shows I didn't change that line) and have since forgotten about it :)

This comment has been minimized.

Copy link
@steveb

steveb Dec 16, 2016

Author Owner
%doc %{_datadir}/kolla/openrc-example

This comment has been minimized.

Copy link
@chkumar246

chkumar246 Nov 29, 2016

%doc %{_datadir}/kolla/openrc-example should be %{_datadir}/kolla/openrc-example

This comment has been minimized.

Copy link
@steveb

steveb Dec 16, 2016

Author Owner

done

%{_bindir}/kolla-build
%{_bindir}/kolla-genpwd
%{python_sitelib}/kolla*
%{_datadir}/kolla/docker
%{_datadir}/kolla/setup.cfg

%changelog

3 comments on commit cfc07ca

@sdake
Copy link

@sdake sdake commented on cfc07ca Dec 13, 2016

Choose a reason for hiding this comment

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

Steve,
I'm not sure if you have read through this wall of text: https://fedoraproject.org/wiki/Packaging:Guidelines

but its worth a read if you can spare 5-10 hours :) If not, skip ahead to:
https://fedoraproject.org/wiki/Packaging:Guidelines#Use_rpmlint

If you wan't to go further on bulletproofing the spec file, I'd highly recommend using this tool available in EPEL (sudo yum install fedora-review) that automates the process of checking for packaging defects:
https://fedorahosted.org/FedoraReview/

@steveb
Copy link
Owner Author

@steveb steveb commented on cfc07ca Dec 15, 2016

Choose a reason for hiding this comment

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

rpmlint passes other than the 404 for kolla-XXX.tar.gz, but every RDO spec file does this.

@sdake
Copy link

@sdake sdake commented on cfc07ca Dec 15, 2016

Choose a reason for hiding this comment

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

nice work steve!

Please sign in to comment.