This commit automatically triggers the local restore after remote subcloud installation during an auto-restore operation. It also adds support for using a backup file initially stored on the system controller by copying it to the miniboot.iso, which is then transferred via kickstart to the subcloud [1]. [1]: https://review.opendev.org/c/starlingx/metal/+/951876 Test Plan: Before running the following tests, prestage the subcloud for install and create two backups, one with --local-only and another without it. 01. PASS - Run a subcloud restore with --auto. Verify that the subcloud is auto-restored with the backup stored inside the system controller. 02. PASS - Run a subcloud restore with --auto and --local-only. Verify that the subcloud is auto-restored with the local backup stored inside the subcloud. 03. PASS - Run a subcloud restore with --auto and force a failure during restore. Verify that the restore playbook detects the failure correctly. 04. PASS - Copy the local platform backup file to /opt/platform-backup/factory/<sw-version>/ and run a subcloud restore with --factory. Verify that the subcloud is restored using the backup stored in the factory directory. 05. PASS - After a subcloud is auto restored, verify that the /opt/platform-backup/auto-restore directory is removed. 06. PASS - After a subcloud is auto restored, restart the subcloud and verify that the dc-auto-restore systemd service is not triggered. 07. PASS - After a subcloud is auto restored, verify that the log file /var/log/auto-restore.log exists and contains all the logged data from the execute-restore.sh script and the restore playbook output. 08. PASS - Run the standard subcloud restore operation (without --auto or --factory) and verify that it's still working. 09. PASS - Verify that the temporary directory and all staged files are deleted after the subcloud install operation is complete. Depends-On: https://review.opendev.org/c/starlingx/utilities/+/951881 Depends-On: https://review.opendev.org/c/starlingx/metal/+/951876 Story: 2011454 Task: 52361 Change-Id: I457801093b39c783bb61c1a531bddf8e877ec039 Signed-off-by: Gustavo Herzmann <gustavo.herzmann@windriver.com>
133 lines
5.7 KiB
Makefile
Executable File
133 lines
5.7 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/dcmanager-orchestrator-worker.service $(SYSTEMD_DIR)/dcmanager-orchestrator-worker.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/dcagent-api.service $(SYSTEMD_DIR)/dcagent-api.service
|
|
|
|
install -p -D -m 644 files/dc-auto-restore.service $(SYSTEMD_DIR)/dc-auto-restore.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 -p -D -m 644 files/dcagent.conf $(TMP_DIR)/dcagent.conf
|
|
install -p -D -m 644 files/dccertmon.conf $(TMP_DIR)/dccertmon.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
|
|
PYTHONPATH=. oslo-config-generator --config-file=./dcagent/config-generator.conf
|
|
PYTHONPATH=. oslo-config-generator --config-file=./dccertmon/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
|
|
|
|
oslo-config-generator \
|
|
--config-file ./dcagent/config-generator.conf \
|
|
--output-file ./dcagent/dcagent.conf.sample
|
|
install -p -D -m 640 ./dcagent/dcagent.conf.sample $(SYS_CONF_DIR)/dcagent/dcagent.conf
|
|
|
|
oslo-config-generator \
|
|
--config-file ./dccertmon/config-generator.conf \
|
|
--output-file ./dccertmon/dccertmon.conf.sample
|
|
install -p -D -m 640 ./dccertmon/dccertmon.conf.sample $(SYS_CONF_DIR)/dccertmon/dccertmon.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
|
|
|
|
# install ipmi_sel_event_monitor.py and execute-restore.sh auto-restore scripts
|
|
install -p -D -m 700 scripts/ipmi_sel_event_monitor.py $(ROOT)/usr/local/bin
|
|
install -p -D -m 700 scripts/execute-restore.sh $(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
|
|
rm -rf $(ROOT)/usr/lib/python3/dist-packages/dcagent/tests
|
|
rm -rf $(ROOT)/usr/lib/python3/dist-packages/dccertmon/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 \
|
|
--exclude etc/dcagent/dcagent.conf \
|
|
--exclude etc/dccertmon/dccertmon.conf
|
|
|
|
execute_after_dh_fixperms:
|
|
# forcing 600 for /var/opt/dc/ansible
|
|
chmod 600 debian/distributedcloud-dcmanager/var/opt/dc/ansible
|