Removed several gzip operations

As log storage takes care of compression is better to avoid performing
any gzip activity on *text* files that we want to access with the
browser.

Change-Id: I7dcd1cf569fea5e536926f7188af953c3301af0f
This commit is contained in:
Sorin Sbarnea 2020-01-16 17:41:37 +00:00
parent 868a0a079b
commit f54d582f28
6 changed files with 7 additions and 23 deletions

View File

@ -20,22 +20,10 @@
rsync -var --no-links /etc/containers/ {{ workspace }}/etc/containers/ || true
rsync -var --no-links --include 'yum.repos.d/***' --include 'yum.conf' --include 'dnf/***' --exclude='*' /etc/ {{ workspace }}/etc/ || true
gzip -r "{{ workspace }}/logs" "{{ workspace }}/conf" "{{ workspace }}/etc"
chmod -R a+r "{{ workspace }}"
chown -R {{ ansible_user }}: "{{ workspace }}"
changed_when: true
- name: Rename compressed text based files to end with txt.gz extension
become: true
shell: >
set -o pipefail &&
find {{ workspace }}/logs {{ workspace }}/conf {{ workspace }}/etc -type f |
awk 'function rename(orig)
{ new=orig; sub(/\.gz$/, ".txt.gz", new); system("mv " orig " " new) }
/\.(conf|ini|json|sh|log|yaml|yml|repo|cfg|j2|py)\.gz$/ { rename($0) }
/(\/logs\/|\/etc\/)[^ \/\.]+\.gz$/ { rename($0) }';
changed_when: true
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
no_log: true
synchronize:

View File

@ -54,4 +54,4 @@ SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogL
# NOTE(pabelanger): this logic should be inverted to only include what developers need, not exclude things on the filesystem.
TARCMD="sudo XZ_OPT=-3 tar -cJf - --exclude=var/log/journal --exclude=udev/hwdb.bin --exclude=etc/puppet/modules --exclude=etc/project-config --exclude=etc/services --exclude=selinux/targeted --exclude=etc/services --exclude=etc/pki /var/log /etc"
JLOGCMD="sudo journalctl --output short-precise | gzip -c | sudo dd of=/var/log/journal-text.txt.gz"
JLOGCMD="sudo journalctl --output short-precise | sudo dd of=/var/log/journal-text.txt"

View File

@ -98,12 +98,10 @@ source $LOCAL_WORKING_DIR/bin/activate
set -u
source $OOOQ_DIR/ansible_ssh_env.sh
sudo unbound-control dump_cache > /tmp/dns_cache.txt
sudo chown {{ ansible_user_id }}: /tmp/dns_cache.txt
cat /tmp/dns_cache.txt | gzip - > $LOGS_DIR/dns_cache.txt.gz
sudo unbound-control dump_cache > $LOGS_DIR/dns_cache.txt
mkdir -p $LOGS_DIR/quickstart_files
find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do gzip -cf \$i > $LOGS_DIR/quickstart_files/\$(basename \$i).txt.gz; done
find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do cp -l \$i $LOGS_DIR/quickstart_files/\$(basename \$i); done
$QUICKSTART_COLLECTLOGS_CMD > $LOGS_DIR/quickstart_collect_logs.log || \
echo "WARNING: quickstart collect-logs failed, check quickstart_collectlogs.log for details"

View File

@ -54,4 +54,4 @@ SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogL
# NOTE(pabelanger): this logic should be inverted to only include what developers need, not exclude things on the filesystem.
TARCMD="sudo XZ_OPT=-3 tar -cJf - --exclude=var/log/journal --exclude=udev/hwdb.bin --exclude=etc/puppet/modules --exclude=etc/project-config --exclude=etc/services --exclude=selinux/targeted --exclude=etc/services --exclude=etc/pki /var/log /etc"
JLOGCMD="sudo journalctl --output short-precise | gzip -c | sudo dd of=/var/log/journal-text.txt.gz"
JLOGCMD="sudo journalctl --output short-precise | sudo dd of=/var/log/journal-text.txt"

View File

@ -38,7 +38,7 @@ nova console-log bmc-${ENVNUM} | tail -n 100 | awk -v envnum="$ENVNUM" '$0=envnu
# Save all the consoles in the stack to a dedicated directory, stripping out ANSI color codes.
for server in $(openstack server list -f value -c Name | grep baremetal-${ENVNUM}) bmc-$ENVNUM ; do
openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' | gzip > $CONSOLE_LOG_PATH/$server-console.log.gz || true
openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' > $CONSOLE_LOG_PATH/$server-console.log || true
done

View File

@ -185,15 +185,13 @@ fi
popd
sudo unbound-control dump_cache > /tmp/dns_cache.txt
sudo chown ${USER}: /tmp/dns_cache.txt
cat /tmp/dns_cache.txt | gzip - > $LOGS_DIR/dns_cache.txt.gz
sudo unbound-control dump_cache > $LOGS_DIR/dns_cache.txt
if [[ "$PERIODIC" == 1 && -e $WORKSPACE/hash_info.sh ]] ; then
echo export JOB_EXIT_VALUE=$exit_value >> $WORKSPACE/hash_info.sh
fi
mkdir -p $LOGS_DIR/quickstart_files
find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do gzip -cf $i > $LOGS_DIR/quickstart_files/$(basename $i).txt.gz; done
find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do cp -l $i $LOGS_DIR/quickstart_files/$(basename $i); done
echo 'Quickstart completed.'
exit $exit_value