Files
distcloud/distributedcloud/debian/deb_folder/rules
Li Zhu 287246bf4f DCorch Engine Update for Scalability
1. Refactor dcorch's generic_sync_manager.py and initial_sync_manager
   into a main process manager and a worker manager. The main manager
   will handle the allocation of eligible subclouds to each worker.
2. Rename the current EngineService to EngineWorkerService and introduce
   a new EngineService for the main process, similar to
   DCManagerAuditService and DCManagerAuditWorkerService.
3. Rename the current RPC EngineClient to EngineWorkerClient and
   introduce a new EngineClient. Adapt the RPC methods to accommodate
   the modifications in these main process managers and worker managers.
4. Move master resources data retrieval from each sync_thread to engine
   workers.
5. Implement 2 new db APIs for subcloud batch sync and state updates.
6. Remove code related to sync_lock and its associated db table schema.
7. Add ocf script for managing the start and stop of the dcorch
   engine-worker service, and make changes in packaging accordingly.
8. Bug fixes for the issues related to the usage of
   base64.urlsafe_b64encode and base64.urlsafe_b64decode in python3.
9. Update unit tests for the main process and worker managers.

Test Plan:
PASS: Verify that the dcorch audit runs properly every 5 minutes.
PASS: Verify that the initial sync runs properly every 10 seconds.
PASS: Verify that the sync subclouds operation runs properly every 5
      seconds.
PASS: Successfully start and stop the dcorch-engine and
      dcorch-engine-worker services using the sm commands.
PASS: Change the admin password on the system controller using
      the command "openstack --os-region-name SystemController user
      password set". Verify that the admin password is synchronized
      to the subcloud and the dcorch receives the corresponding sync
      request, followed by successful execution of sync resources for
      the subcloud.
PASS: Unmanage and then manage a subcloud, and verify that the initial
      sync is executed successfully for that subcloud.
PASS: Verify the removal of the sync_lock table from the dcorch db.

Story: 2011106
Task: 50013

Change-Id: I329847bd1107ec43e67ec59bdd1e3111b7b37cd3
Signed-off-by: lzhu1 <li.zhu@windriver.com>
2024-05-15 10:49:13 -04:00

107 lines
4.3 KiB
Makefile
Executable File

#!/usr/bin/make -f
#export DH_VERBOSE = 1
export PYBUILD_NAME = distributedcloud
export PBR_VERSION = 1.0.0
ROOT = $(CURDIR)/debian/tmp
SYSTEMD_DIR = $(ROOT)/usr/lib/systemd/system
TMP_DIR = $(ROOT)/usr/lib/tmpfiles.d
OCF_DIR = $(ROOT)/usr/lib/ocf/resource.d/openstack
SYS_CONF_DIR = $(ROOT)/etc
BIN_DIR = $(ROOT)/usr/bin
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_usrlocal:
# skip running dh_usrlocal
override_dh_install:
python3 setup.py install -f --install-layout=deb \
--root=$(CURDIR)/debian/tmp
python3 setup.py bdist_wheel \
--universal\
-d $(CURDIR)/debian/distributedcloud-wheels/usr/share/python-wheels
# install systemd unit files
install -p -D -m 644 files/dcmanager-api.service $(SYSTEMD_DIR)/dcmanager-api.service
install -p -D -m 644 files/dcmanager-manager.service $(SYSTEMD_DIR)/dcmanager-manager.service
install -p -D -m 644 files/dcmanager-audit.service $(SYSTEMD_DIR)/dcmanager-audit.service
install -p -D -m 644 files/dcmanager-audit-worker.service $(SYSTEMD_DIR)/dcmanager-audit-worker.service
install -p -D -m 644 files/dcmanager-orchestrator.service $(SYSTEMD_DIR)/dcmanager-orchestrator.service
install -p -D -m 644 files/dcorch-api.service $(SYSTEMD_DIR)/dcorch-api.service
install -p -D -m 644 files/dcorch-engine.service $(SYSTEMD_DIR)/dcorch-engine.service
install -p -D -m 644 files/dcorch-engine-worker.service $(SYSTEMD_DIR)/dcorch-engine-worker.service
install -p -D -m 644 files/dcorch-sysinv-api-proxy.service $(SYSTEMD_DIR)/dcorch-sysinv-api-proxy.service
install -p -D -m 644 files/dcorch-identity-api-proxy.service $(SYSTEMD_DIR)/dcorch-identity-api-proxy.service
install -p -D -m 644 files/dcdbsync-api.service $(SYSTEMD_DIR)/dcdbsync-api.service
install -p -D -m 644 files/dcorch.conf $(TMP_DIR)/dcorch.conf
install -p -D -m 644 files/dcmanager.conf $(TMP_DIR)/dcmanager.conf
# install systemd unit files for optional second instance
install -p -D -m 644 files/dcdbsync-openstack-api.service $(SYSTEMD_DIR)/dcdbsync-openstack-api.service
install -p -D -m 644 files/dcdbsync.conf $(TMP_DIR)/dcdbsync.conf
install -p -D -m 644 files/distcloud-syslog.conf $(SYS_CONF_DIR)/syslog-ng/conf.d/distcloud.conf
install -p -D -m 644 files/distcloud-logrotate.conf $(SYS_CONF_DIR)/logrotate.d/distcloud.conf
# install ocf scripts
install -d -m 755 $(OCF_DIR)
install -p -D -m 755 ocf/* $(OCF_DIR)/
# install dcorch cleaner
install -m 755 -D -p files/clean-dcorch $(BIN_DIR)/clean-dcorch
# install ansible overrides dir
install -d -m 600 $(ROOT)/var/opt/dc/ansible
# Generate sample config and add the current directory to PYTHONPATH so
# 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=./dcorch/config-generator.conf
PYTHONPATH=. oslo-config-generator --config-file=./dcdbsync/config-generator.conf
# install default config files
oslo-config-generator \
--config-file ./dcmanager/config-generator.conf \
--output-file ./dcmanager/dcmanager.conf.sample
install -p -D -m 640 ./dcmanager/dcmanager.conf.sample $(SYS_CONF_DIR)/dcmanager/dcmanager.conf
oslo-config-generator \
--config-file ./dcorch/config-generator.conf \
--output-file ./dcorch/dcorch.conf.sample
install -p -D -m 640 ./dcorch/dcorch.conf.sample $(SYS_CONF_DIR)/dcorch/dcorch.conf
oslo-config-generator \
--config-file ./dcdbsync/config-generator.conf \
--output-file ./dcdbsync/dcdbsync.conf.sample
install -p -D -m 640 ./dcdbsync/dcdbsync.conf.sample $(SYS_CONF_DIR)/dcdbsync/dcdbsync.conf
# install rvmc_install.py script
install -d $(ROOT)/usr/local/bin/
install -p -D -m 700 scripts/rvmc_install.py $(ROOT)/usr/local/bin
rm -rf $(ROOT)/usr/lib/python3/dist-packages/dcmanagerclient/tests
rm -rf $(ROOT)/usr/lib/python3/dist-packages/dccommon/tests
rm -rf $(ROOT)/usr/lib/python3/dist-packages/dcmanager/tests
rm -rf $(ROOT)/usr/lib/python3/dist-packages/dcorch/tests
dh_install
override_dh_auto_test:
echo "do nothing..."
override_dh_fixperms:
dh_fixperms \
--exclude etc/dcdbsync/dcdbsync.conf \
--exclude etc/dcmanager/dcmanager.conf \
--exclude etc/dcorch/dcorch.conf
execute_after_dh_fixperms:
# forcing 600 for /var/opt/dc/ansible
chmod 600 debian/distributedcloud-dcmanager/var/opt/dc/ansible