Browse Source

Merge pull request #8265 from vrutkovs/papr-split-logs

PAPR improvements
Vadim Rutkovsky 7 years ago
parent
commit
92cc441774
5 changed files with 17 additions and 8 deletions
  1. 1 0
      .papr-master-ha.inventory
  2. 1 0
      .papr.all-in-one.inventory
  3. 1 0
      .papr.inventory
  4. 13 7
      .papr.sh
  5. 1 1
      .papr.yml

+ 1 - 0
.papr-master-ha.inventory

@@ -13,6 +13,7 @@ openshift_check_min_host_disk_gb=1.5
 openshift_check_min_host_memory_gb=1.9
 openshift_portal_net=172.30.0.0/16
 openshift_enable_service_catalog=false
+debug_level=4
 
 [all:vars]
 # bootstrap configs

+ 1 - 0
.papr.all-in-one.inventory

@@ -13,6 +13,7 @@ openshift_check_min_host_disk_gb=1.5
 openshift_check_min_host_memory_gb=1.9
 openshift_portal_net=172.30.0.0/16
 openshift_enable_service_catalog=false
+debug_level=4
 
 [all:vars]
 # bootstrap configs

+ 1 - 0
.papr.inventory

@@ -12,6 +12,7 @@ openshift_master_default_subdomain="{{ lookup('env', 'RHCI_ocp_node1_IP') }}.xip
 openshift_check_min_host_disk_gb=1.5
 openshift_check_min_host_memory_gb=1.9
 openshift_portal_net=172.30.0.0/16
+debug_level=4
 
 [all:vars]
 # bootstrap configs

+ 13 - 7
.papr.sh

@@ -19,6 +19,7 @@ else
 fi
 export target_branch
 
+
 # Need to define some git variables for rebase.
 git config --global user.email "ci@openshift.org"
 git config --global user.name "OpenShift Atomic CI"
@@ -31,6 +32,9 @@ pip install -r requirements.txt
 PAPR_INVENTORY=${PAPR_INVENTORY:-.papr.inventory}
 PAPR_RUN_UPDATE=${PAPR_RUN_UPDATE:-0}
 
+# Human-readable output
+export ANSIBLE_STDOUT_CALLBACK=debug
+
 # ping the nodes to check they're responding and register their ostree versions
 ansible -vvv -i $PAPR_INVENTORY nodes -a 'rpm-ostree status'
 
@@ -40,25 +44,27 @@ upload_journals() {
     -m shell -a 'journalctl --no-pager > /tmp/journal'
   ansible -vvv -i $PAPR_INVENTORY all \
     -m fetch -a "src=/tmp/journal dest=journals/{{ inventory_hostname }}.log flat=yes"
+
+  # Split large files into parts, extracting a basename and preserving extention
+  find . -iname "*.log" -execdir sh -c 'split -b 4m --numeric-suffixes --additional-suffix=.log {} $(basename {} .log)_' \; -execdir rm -rf {} \;
 }
 
 trap upload_journals ERR
 
-# Store ansible log separately
-export ANSIBLE_LOG_PATH=ansible.log
-
 # run the prerequisites play
-ansible-playbook -v -i $PAPR_INVENTORY playbooks/prerequisites.yml
+ansible-playbook -vvv -i $PAPR_INVENTORY playbooks/prerequisites.yml
 
 # run the actual installer
-ansible-playbook -v -i $PAPR_INVENTORY playbooks/deploy_cluster.yml
+ansible-playbook -vvv -i $PAPR_INVENTORY playbooks/deploy_cluster.yml
 
 # Run upgrade playbook (to a minor version)
-if [[ "${PAPR_RUN_UPDATE:-0}" != "0" ]]; then
+if [[ "${PAPR_RUN_UPDATE}" != "0" ]]; then
   update_version="$(echo $target_branch | sed 's/\./_/')"
-  ansible-playbook -v -i $PAPR_INVENTORY playbooks/byo/openshift-cluster/upgrades/v${update_version}/upgrade.yml
+  ansible-playbook -vvv -i $PAPR_INVENTORY playbooks/byo/openshift-cluster/upgrades/v${update_version}/upgrade.yml
 fi
 
+upload_journals
+
 ### DISABLING TESTS FOR NOW, SEE:
 ### https://github.com/openshift/openshift-ansible/pull/6132
 

+ 1 - 1
.papr.yml

@@ -32,6 +32,7 @@ packages:
   - libffi-devel
   - openssl-devel
   - redhat-rpm-config
+  - findutils
 
 context: 'fedora/27/atomic'
 
@@ -40,7 +41,6 @@ tests:
 
 artifacts:
   - journals/
-  - ansible.log
 
 ---
 inherit: true