diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 9f78c20bc6..4e29e9b2e6 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -499,6 +499,8 @@ function create_guest_image { $TROVE_MANAGE db_load_datastore_config_parameters "$TROVE_DATASTORE_TYPE" "$TROVE_DATASTORE_VERSION" \ $DEST/trove/trove/templates/$TROVE_DATASTORE_TYPE/validation-rules.json fi + # NOTE(wuchunyang): Create log directory so that guest agent can rsync logs to this directory + test -e /var/log/guest-agent-logs || sudo mkdir -p /var/log/guest-agent-logs/ && sudo chmod 777 /var/log/guest-agent-logs } function create_registry_container { diff --git a/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent-dev.service b/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent-dev.service index 261ac81184..e70562b868 100644 --- a/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent-dev.service +++ b/integration/scripts/files/elements/guest-agent/install.d/guest-agent-source-install/guest-agent-dev.service @@ -21,6 +21,15 @@ ExecStartPre=/bin/bash -c "test -e /home/GUEST_USERNAME/trove-installed || sudo ExecStartPre=/bin/bash -c "sudo chown -R GUEST_USERNAME:root /etc/trove /var/log/trove/ /home/GUEST_USERNAME/trove" +# The "[defult]" line in this file doesn't matter. +EnvironmentFile=/etc/trove/conf.d/guest_info.conf + +# rsync trove guest agent log to CONTROLLER nodes, this is extremely useful for debugging in CI. +ExecStartPre=/bin/bash -c "sudo rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /home/GUEST_USERNAME/.ssh/id_rsa' -az --exclude='.*' /var/log HOST_SCP_USERNAME@$CONTROLLER:/var/log/guest-agent-logs/$guest_id" + +# rsync trove containers stdout to CONTROLLER nodes +ExecStartPre=/bin/bash -c "sudo rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /home/GUEST_USERNAME/.ssh/id_rsa' -az --exclude='.*' /var/lib/docker/containers HOST_SCP_USERNAME@$CONTROLLER:/var/log/guest-agent-logs/$guest_id" + # Take care of the changes in requirements.txt ExecStartPre=/bin/bash -c "sudo /opt/guest-agent-venv/bin/pip install -r /home/GUEST_USERNAME/trove/requirements.txt -c /opt/upper-constraints.txt" diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 6b2ea91d47..fa9ef1534a 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -341,6 +341,8 @@ ovn-northd: false tempest_test_regex: ^trove_tempest_plugin\.tests tempest_test_blacklist: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/trove-tempest-plugin"].src_dir }}/tempest_blacklist.txt' + zuul_copy_output: + '/var/log/guest-agent-logs/': 'logs' - job: name: trove-tempest-postgres @@ -420,6 +422,8 @@ ovn-northd: false tempest_test_regex: ^trove_tempest_plugin\.tests tempest_test_blacklist: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/trove-tempest-plugin"].src_dir }}/tempest_blacklist.txt' + zuul_copy_output: + '/var/log/guest-agent-logs/': 'logs' - job: name: publish-trove-guest-image