Keystone DB sync - service build instructions

This update contains the build instructions for the newly introduced
DB record synchronization service. This new service provides REST
APIs to read/write/update identity database. The REST APIs is
intended to be used internally by DC Orchestrator to synchronize
identity resources between central cloud and subclouds.

(cherry picked from commit e628cc02d0dc8573f5dd59893a5c080a653063b4)

Conflicts:
	distributedcloud/centos/distributedcloud.spec

Story: 2002842
Task: 22787
Depends-On: https://review.opendev.org/#/c/655727
Change-Id: Iebb0dc0d26c2b4088889946d48bb15ca94cab252
Signed-off-by: Andy Ning <andy.ning@windriver.com>
This commit is contained in:
Andy Ning 2019-01-15 16:15:21 -05:00 committed by Don Penney
parent 5d7870d7e9
commit 7589f962b5
7 changed files with 81 additions and 18 deletions

4
centos_iso_image.inc Normal file
View File

@ -0,0 +1,4 @@
# distributedcloud
distributedcloud-dcmanager
distributedcloud-dcorch
distributedcloud-dcdbsync

View File

@ -3,4 +3,4 @@ SRC_DIR="$CGCS_BASE/git/distributedcloud"
COPY_LIST="$FILES_BASE/*" COPY_LIST="$FILES_BASE/*"
TIS_BASE_SRCREV=e82c7b43362bceb8d4ae9d121d023e42268204db TIS_BASE_SRCREV=e82c7b43362bceb8d4ae9d121d023e42268204db
TIS_PATCH_VER=GITREVCOUNT+8 TIS_PATCH_VER=GITREVCOUNT+9

View File

@ -23,6 +23,10 @@ Source4: dcorch-engine.service
Source5: dcorch-sysinv-api-proxy.service Source5: dcorch-sysinv-api-proxy.service
Source6: dcorch-snmp.service Source6: dcorch-snmp.service
Source7: dcorch-identity-api-proxy.service Source7: dcorch-identity-api-proxy.service
Source8: dcdbsync-api.service
Source9: dcmanager.conf
Source10: dcorch.conf
Source11: dcdbsync.conf
BuildArch: noarch BuildArch: noarch
@ -80,6 +84,12 @@ Requires: openstack-ras
%description dcorch %description dcorch
Distributed Cloud Orchestrator Distributed Cloud Orchestrator
%package dcdbsync
Summary: DC DCorch DBsync Agent
%description dcdbsync
Distributed Cloud DCorch DBsync Agent
%prep %prep
%autosetup -n %{pypi_name}-%{version} %autosetup -n %{pypi_name}-%{version}
@ -95,44 +105,58 @@ export PBR_VERSION=%{version}
# oslo-config-generator doesn't skip heat's entry points. # oslo-config-generator doesn't skip heat's entry points.
PYTHONPATH=. oslo-config-generator --config-file=./dcmanager/config-generator.conf PYTHONPATH=. oslo-config-generator --config-file=./dcmanager/config-generator.conf
PYTHONPATH=. oslo-config-generator --config-file=./dcorch/config-generator.conf PYTHONPATH=. oslo-config-generator --config-file=./dcorch/config-generator.conf
PYTHONPATH=. oslo-config-generator --config-file=./dcdbsync/config-generator.conf
%install %install
export PBR_VERSION=%{version} export PBR_VERSION=%{version}
%{__python2} setup.py install -O1 --skip-build --root %{buildroot} \ %{__python2} setup.py install -O1 --skip-build --root %{buildroot} \
--single-version-externally-managed --single-version-externally-managed
mkdir -p $RPM_BUILD_ROOT/wheels install -d $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/ install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
mkdir -p %{buildroot}/var/log/dcmanager install -d -m 755 %{buildroot}%{_tmpfilesdir}
mkdir -p %{buildroot}/var/cache/dcmanager install -d -m 755 %{buildroot}/var/log/dcmanager
mkdir -p %{buildroot}/var/run/dcmanager install -d -m 755 %{buildroot}/var/cache/dcmanager
mkdir -p %{buildroot}/etc/dcmanager/ install -d -m 755 %{buildroot}%{_sysconfdir}/dcmanager/
# install systemd unit files # install systemd unit files
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/dcmanager-api.service install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/dcmanager-api.service
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/dcmanager-manager.service install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/dcmanager-manager.service
install -p -D -m 644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}
# install default config files # install default config files
cd %{_builddir}/%{pypi_name}-%{version} && oslo-config-generator --config-file ./dcmanager/config-generator.conf --output-file %{_builddir}/%{pypi_name}-%{version}/etc/dcmanager/dcmanager.conf.sample cd %{_builddir}/%{pypi_name}-%{version} && oslo-config-generator --config-file ./dcmanager/config-generator.conf --output-file %{_builddir}/%{pypi_name}-%{version}%{_sysconfdir}/dcmanager/dcmanager.conf.sample
install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}/etc/dcmanager/dcmanager.conf.sample %{buildroot}%{_sysconfdir}/dcmanager/dcmanager.conf install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}%{_sysconfdir}/dcmanager/dcmanager.conf.sample %{buildroot}%{_sysconfdir}/dcmanager/dcmanager.conf
mkdir -p %{buildroot}/var/log/dcorch install -d -m 755 %{buildroot}/var/log/dcorch
mkdir -p %{buildroot}/var/cache/dcorch install -d -m 755 %{buildroot}/var/cache/dcorch
mkdir -p %{buildroot}/var/run/dcorch install -d -m 755 %{buildroot}%{_sysconfdir}/dcorch/
mkdir -p %{buildroot}/etc/dcorch/
# install systemd unit files # install systemd unit files
install -p -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/dcorch-api.service install -p -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/dcorch-api.service
install -p -D -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/dcorch-engine.service install -p -D -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/dcorch-engine.service
install -p -D -m 644 %{SOURCE5} %{buildroot}%{_unitdir}/dcorch-sysinv-api-proxy.service install -p -D -m 644 %{SOURCE5} %{buildroot}%{_unitdir}/dcorch-sysinv-api-proxy.service
install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/dcorch-snmp.service install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/dcorch-snmp.service
install -p -D -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/dcorch-identity-api-proxy.service install -p -D -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/dcorch-identity-api-proxy.service
install -p -D -m 644 %{SOURCE10} %{buildroot}%{_tmpfilesdir}
# install ocf scripts # install ocf scripts
install -d -m 755 ${RPM_BUILD_ROOT}/usr/lib/ocf/resource.d/openstack install -d -m 755 ${RPM_BUILD_ROOT}/usr/lib/ocf/resource.d/openstack
install -p -D -m 755 ocf/* ${RPM_BUILD_ROOT}/usr/lib/ocf/resource.d/openstack/ install -p -D -m 755 ocf/* ${RPM_BUILD_ROOT}/usr/lib/ocf/resource.d/openstack/
# install default config files # install default config files
cd %{_builddir}/%{pypi_name}-%{version} && oslo-config-generator --config-file ./dcorch/config-generator.conf --output-file %{_builddir}/%{pypi_name}-%{version}/etc/dcorch/dcorch.conf.sample cd %{_builddir}/%{pypi_name}-%{version} && oslo-config-generator --config-file ./dcorch/config-generator.conf --output-file %{_builddir}/%{pypi_name}-%{version}%{_sysconfdir}/dcorch/dcorch.conf.sample
install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}/etc/dcorch/dcorch.conf.sample %{buildroot}%{_sysconfdir}/dcorch/dcorch.conf install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}%{_sysconfdir}/dcorch/dcorch.conf.sample %{buildroot}%{_sysconfdir}/dcorch/dcorch.conf
# dc dbsync agent
install -d -m 755 %{buildroot}/var/log/dcdbsync
install -d -m 755 %{buildroot}/var/cache/dcdbsync
install -d -m 755 %{buildroot}%{_sysconfdir}/dcdbsync/
# install systemd unit files
install -p -D -m 644 %{SOURCE8} %{buildroot}%{_unitdir}/dcdbsync-api.service
install -p -D -m 644 %{SOURCE11} %{buildroot}%{_tmpfilesdir}
# install default config files
cd %{_builddir}/%{pypi_name}-%{version} && oslo-config-generator --config-file ./dcdbsync/config-generator.conf --output-file %{_builddir}/%{pypi_name}-%{version}%{_sysconfdir}/dcdbsync/dcdbsync.conf.sample
install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}%{_sysconfdir}/dcdbsync/dcdbsync.conf.sample %{buildroot}%{_sysconfdir}/dcdbsync/dcdbsync.conf
%files dcmanager %files dcmanager
%license LICENSE %license LICENSE
@ -144,11 +168,14 @@ install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}/etc/dcorch/dcorch.conf
%{_bindir}/dcmanager-manager %{_bindir}/dcmanager-manager
%{_unitdir}/dcmanager-manager.service %{_unitdir}/dcmanager-manager.service
%{_bindir}/dcmanager-manage %{_bindir}/dcmanager-manage
%{_tmpfilesdir}/dcmanager.conf
%dir %attr(0755,root,root) %{_localstatedir}/log/dcmanager %dir %attr(0755,root,root) %{_localstatedir}/log/dcmanager
%dir %attr(0755,root,root) %{_localstatedir}/run/dcmanager
%dir %attr(0755,root,root) %{_localstatedir}/cache/dcmanager %dir %attr(0755,root,root) %{_localstatedir}/cache/dcmanager
%dir %attr(0755,root,root) %{_sysconfdir}/dcmanager %dir %attr(0755,root,root) %{_sysconfdir}/dcmanager
%config(noreplace) %attr(-, root, root) %{_sysconfdir}/dcmanager/dcmanager.conf %config(noreplace) %attr(-, root, root) %{_sysconfdir}/dcmanager/dcmanager.conf
%dir %attr(0755,root,root) /usr/lib/ocf/resource.d/openstack
%defattr(-,root,root,-)
/usr/lib/ocf/resource.d/openstack/dcmanager-*
%files dcorch %files dcorch
@ -166,14 +193,31 @@ install -p -D -m 640 %{_builddir}/%{pypi_name}-%{version}/etc/dcorch/dcorch.conf
%{_bindir}/dcorch-manage %{_bindir}/dcorch-manage
%{_bindir}/dcorch-snmp %{_bindir}/dcorch-snmp
%{_unitdir}/dcorch-snmp.service %{_unitdir}/dcorch-snmp.service
%{_tmpfilesdir}/dcorch.conf
%dir %attr(0755,root,root) %{_localstatedir}/log/dcorch %dir %attr(0755,root,root) %{_localstatedir}/log/dcorch
%dir %attr(0755,root,root) %{_localstatedir}/run/dcorch
%dir %attr(0755,root,root) %{_localstatedir}/cache/dcorch %dir %attr(0755,root,root) %{_localstatedir}/cache/dcorch
%dir %attr(0755,root,root) %{_sysconfdir}/dcorch %dir %attr(0755,root,root) %{_sysconfdir}/dcorch
%config(noreplace) %attr(-, dcorch, dcorch) %{_sysconfdir}/dcorch/dcorch.conf %config(noreplace) %attr(-, dcorch, dcorch) %{_sysconfdir}/dcorch/dcorch.conf
%dir %attr(0755,root,root) /usr/lib/ocf/resource.d/openstack %dir %attr(0755,root,root) /usr/lib/ocf/resource.d/openstack
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/lib/ocf/resource.d/openstack/* /usr/lib/ocf/resource.d/openstack/dcorch-*
%files dcdbsync
%license LICENSE
%{python2_sitelib}/dcdbsync*
%{python2_sitelib}/distributedcloud-*.egg-info
%exclude %{python2_sitelib}/dcdbsync/tests
%{_bindir}/dcdbsync-api
%{_unitdir}/dcdbsync-api.service
%{_tmpfilesdir}/dcdbsync.conf
%dir %attr(0755,root,root) %{_localstatedir}/log/dcdbsync
%dir %attr(0755,root,root) %{_localstatedir}/cache/dcdbsync
%dir %attr(0755,root,root) %{_sysconfdir}/dcdbsync
%config(noreplace) %attr(-, root, root) %{_sysconfdir}/dcdbsync/dcdbsync.conf
%dir %attr(0755,root,root) /usr/lib/ocf/resource.d/openstack
%defattr(-,root,root,-)
/usr/lib/ocf/resource.d/openstack/dcdbsync-*
%pre dcorch %pre dcorch
getent group dcorch >/dev/null || groupadd -r --gid 173 dcorch getent group dcorch >/dev/null || groupadd -r --gid 173 dcorch

View File

@ -0,0 +1,12 @@
[Unit]
Description=DC DBsync Agent API Service
After=syslog.target network.target postgresql.service
[Service]
Type=simple
User=root
ExecStart=/usr/bin/dcdbsync-api --config-file /etc/dcdbsync/dcdbsync.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /var/run/dcdbsync 0755 root root -

View File

@ -0,0 +1 @@
d /var/run/dcmanager 0755 root root -

View File

@ -0,0 +1 @@
d /var/run/dcorch 0755 root root -