armband: Enable deploy-cache 93/25193/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 30 Nov 2016 01:45:40 +0000 (02:45 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 30 Nov 2016 02:16:55 +0000 (03:16 +0100)
This enables the mechanism added in [1].

Armband just added support for caching deploy artifacts, like
bootstraps and target images, which take a lot of time at each deploy
to be built, considering it requires a cross-debootstrap via
qemu-user-static and binfmt.

For easier setup, the deploy cache depends on the local ISO storage
mechanism (/iso_mount/opnfv_ci), and reuses the same storage pool.

To enable deploy caching, just create the deploy-cache directory at:
/iso_mount/opnfv_ci/<branch>/deploy-cache

JIRA: ARMBAND-172

[1] https://gerrit.opnfv.org/gerrit/#/c/25191

Change-Id: I161205a87f13cd78e79b96bfc37a5f68aba093cc
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
jjb/armband/armband-deploy.sh

index e0631c4..4df9acf 100755 (executable)
@@ -71,10 +71,23 @@ ISO_FILE=$WORKSPACE/opnfv.iso
 # log file name
 FUEL_LOG_FILENAME="${JOB_NAME}_${BUILD_NUMBER}.log.tar.gz"
 
+# Deploy Cache (to enable just create the deploy-cache subdir)
+# NOTE: Only available when ISO files are cached using ISOSTORE mechanism
+DEPLOY_CACHE=${ISOSTORE:-/iso_mount/opnfv_ci}/${GIT_BRANCH##*/}/deploy-cache
+if [[ -d "${DEPLOY_CACHE}" ]]; then
+    echo "Deploy cache dir present."
+    echo "--------------------------------------------------------"
+    echo "Fuel@OPNFV deploy cache: ${DEPLOY_CACHE}"
+    DEPLOY_CACHE="-C ${DEPLOY_CACHE}"
+else
+    DEPLOY_CACHE=""
+fi
+
 # construct the command
 DEPLOY_COMMAND="$WORKSPACE/ci/deploy.sh -b ${LAB_CONFIG_URL} \
     -l $LAB_NAME -p $POD_NAME -s $DEPLOY_SCENARIO -i file://${ISO_FILE} \
-    -H -B ${DEFAULT_BRIDGE:-pxebr} -S $TMPDIR -L $WORKSPACE/$FUEL_LOG_FILENAME"
+    -H -B ${DEFAULT_BRIDGE:-pxebr} -S $TMPDIR -L $WORKSPACE/$FUEL_LOG_FILENAME \
+    ${DEPLOY_CACHE}"
 
 # log info to console
 echo "Deployment parameters"