Skip to content

Commit

Permalink
Add a new entry point script to dump and delete ramdisk host provisio…
Browse files Browse the repository at this point in the history
…ning logs
  • Loading branch information
akiselev1 committed Nov 11, 2020
1 parent 070086d commit 02f8d61
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ARG PKGS_LIST=main-packages-list.txt

COPY ${PKGS_LIST} /tmp/main-packages-list.txt

RUN dnf install -y python3 python3-requests && \
RUN dnf install -y epel-release python3 python3-requests && \
curl https://raw.githubusercontent.com/openstack/tripleo-repos/master/tripleo_repos/main.py | python3 - -b master current-tripleo && \
dnf upgrade -y && \
dnf --setopt=install_weak_deps=False install -y $(cat /tmp/main-packages-list.txt) && \
Expand All @@ -56,6 +56,7 @@ COPY ./runhttpd.sh /bin/runhttpd
COPY ./runmariadb.sh /bin/runmariadb
COPY ./configure-ironic.sh /bin/configure-ironic.sh
COPY ./ironic-common.sh /bin/ironic-common.sh
COPY ./runlogwatch.sh /bin/runlogwatch.sh

# TODO(dtantsur): remove this script when we stop supporting running both
# API and conductor processes via one entry point.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The following entry points are provided:
- rundnsmasq - Runs the dnmasq dhcp server to provide addresses and initiate PXE boot of baremetal nodes. This includes a lightweight TFTP server. Details on dnsmasq can be found at http://www.thekelleys.org.uk/dnsmasq/doc.html.
- runhttpd - Starts the Apache web server to provide images via http for PXE boot and for deployment of the final images.
- runmariadb - Provides a database to store information associated with baremetal nodes.
- runlogwatch - Waits for host provisioning ramdisk logs to appear, prints their contents and deletes files.

All of the containers must share a common mount point or data store. Ironic requires files for both the TFTP server and HTTP server to be stored in the same partition. This common store must include, in <shared store>/html/images, the following images:
- ironic-python-agent.kernel
Expand Down
1 change: 1 addition & 0 deletions main-packages-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ python3-sushy
python3-sushy-oem-idrac
qemu-img
syslinux-nonlinux
inotify-tools
20 changes: 20 additions & 0 deletions runlogwatch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/bash

# Ramdisk logs path
LOG_DIR="/shared/log/ironic/deploy"

while :
do
until ls "${LOG_DIR}"/*.tar.gz 1> /dev/null 2>&1
do
sleep 5
done

for fn in "${LOG_DIR}"/*.tar.gz
do
echo "************ Contents of $fn ramdisk log file bundle **************"
tar -xOzvvf $fn | sed -e "s/^/$(basename $fn): /"
rm -f $fn
done
done

0 comments on commit 02f8d61

Please sign in to comment.