Make ipa-downloader error fail the build 76/3876/3
authorTodd Malsbary <todd.malsbary@intel.com>
Thu, 5 Nov 2020 23:23:24 +0000 (15:23 -0800)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Mon, 16 Nov 2020 17:42:23 +0000 (17:42 +0000)
Running the image in the background and then issuing docker wait fails
to detect a failed return code from the container as docker wait
prints the return code of the container and exits with 0.

Check explicitly that the ironic-python-agent files the httpd
container needs are downloaded.

This change also removes extraneous whitespace from the generated
ironic.env.

Issue-ID: ICN-499
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Icc0f7ce5b19c47008c37d59c3f029809c68b16cc

deploy/metal3-vm/02_configure_host.sh
env/metal3/03_launch_prereq.sh

index de48d9b..634d4ee 100755 (executable)
@@ -181,16 +181,16 @@ else
   POD_NAME=""
 fi
 
-cat <<EOF > ${PWD}/ironic.env                                                 
-PROVISIONING_INTERFACE=provisioning                                               
-DHCP_RANGE=172.22.0.10,172.22.0.100                                               
+cat <<EOF > ${PWD}/ironic.env
+PROVISIONING_INTERFACE=provisioning
+DHCP_RANGE=172.22.0.10,172.22.0.100
 IPA_BASEURI=https://images.rdoproject.org/train/rdo_trunk/current-tripleo
-DEPLOY_KERNEL_URL=http://172.22.0.1/images/ironic-python-agent.kernel             
-DEPLOY_RAMDISK_URL=http://172.22.0.1/images/ironic-python-agent.initramfs         
-IRONIC_ENDPOINT=http://172.22.0.1:6385/v1/                                        
-IRONIC_INSPECTOR_ENDPOINT=http://172.22.0.1:5050/v1/                              
-CACHEURL=http://172.22.0.1/images                                                 
-IRONIC_FAST_TRACK=false                                                           
+DEPLOY_KERNEL_URL=http://172.22.0.1/images/ironic-python-agent.kernel
+DEPLOY_RAMDISK_URL=http://172.22.0.1/images/ironic-python-agent.initramfs
+IRONIC_ENDPOINT=http://172.22.0.1:6385/v1/
+IRONIC_INSPECTOR_ENDPOINT=http://172.22.0.1:5050/v1/
+CACHEURL=http://172.22.0.1/images
+IRONIC_FAST_TRACK=false
 EOF
 
 # Start image downloader container
@@ -200,6 +200,12 @@ sudo "${CONTAINER_RUNTIME}" run -d --net host --privileged --name ipa-downloader
 
 sudo "${CONTAINER_RUNTIME}" wait ipa-downloader
 
+if [ ! -e "$IRONIC_DATA_DIR/html/images/ironic-python-agent.kernel" ] ||
+   [ ! -e "$IRONIC_DATA_DIR/html/images/ironic-python-agent.initramfs" ]; then
+    echo "Failed to get ironic-python-agent"
+    exit 1
+fi
+
 # Start dnsmasq, http, mariadb, and ironic containers using same image
 # See this file for env vars you can set, like IP, DHCP_RANGE, INTERFACE
 sudo "${CONTAINER_RUNTIME}" run -d --net host --privileged --name dnsmasq \
index 75865b1..9d58f57 100755 (executable)
@@ -87,6 +87,12 @@ function install_ironic_container {
 
     docker wait ipa-downloader
 
+    if [ ! -e "$IRONIC_DATA_DIR/html/images/ironic-python-agent.kernel" ] ||
+       [ ! -e "$IRONIC_DATA_DIR/html/images/ironic-python-agent.initramfs" ]; then
+        echo "Failed to get ironic-python-agent"
+        exit 1
+    fi
+
     # Start dnsmasq, http, mariadb, and ironic containers using same image
     # See this file for env vars you can set, like IP, DHCP_RANGE, INTERFACE
     docker run -d --net host --privileged --name dnsmasq \