]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
sepia-fog-images: Optionally pause the sepia queue
authorDavid Galloway <dgallowa@redhat.com>
Thu, 17 Jan 2019 13:43:22 +0000 (08:43 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 17 Jan 2019 14:21:52 +0000 (09:21 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
sepia-fog-images/build/build
sepia-fog-images/config/definitions/sepia-fog-images.yml

index e6e9033d009724b1c317f337c4b0af4225b88b36..a419b314ac918d51f843e8cff8c71b9cea9acf5b 100755 (executable)
@@ -177,29 +177,34 @@ set -ex
 # Restart dhcpd so servers PXE boot to FOG server
 ssh ubuntu@store01.front.sepia.ceph.com "sudo service dhcpd restart"
 
-# Get FOG 'Deploy' TaskID
-fogdeployid=$(curl -s -k -H "fog-api-token: ${FOG_API_TOKEN}" -H "fog-user-token: ${FOG_USER_TOKEN}" http://fog.front.sepia.ceph.com/fog/tasktype -d '{"name": "Deploy"}' -X GET | jq -r '.tasktypes[0].id')
-
-# Check for scheduled deploy tasks
-deploytasks=$(curl -s -k -H "fog-api-token: ${FOG_API_TOKEN}" -H "fog-user-token: ${FOG_USER_TOKEN}" http://fog.front.sepia.ceph.com/fog/task/active -d '{"typeID": "'${fogdeployid}'"}' -X GET | jq -r '.count')
-
-# If there are scheduled or active deploy tasks, pause the queue and let them finish.
-# Capturing a new OS image can interrupt active OS deployments.
-if [ $deploytasks -gt 0 ]; then
-  for type in $MACHINETYPES; do
-    # Only pause the queue for 20 minutes just in case anything goes wrong with the Jenkins job.
-    teuthology-queue --pause 1200 --machine_type $type
-  done
-  pausedqueue=true
-  currentretries=0
-  while [ $deploytasks -gt 0 ]; do
-    echo "$(date) -- $deploytasks FOG deploy tasks still queued.  Sleeping 10sec"
-    sleep 10
-    deploytasks=$(curl -s -k -H "fog-api-token: ${FOG_API_TOKEN}" -H "fog-user-token: ${FOG_USER_TOKEN}" http://fog.front.sepia.ceph.com/fog/task/active -d '{"typeID": "'${fogdeployid}'"}' -X GET | jq -r '.count')
-    ((++currentretries))
-    # Retry for 30min
-    funRetry $currentretries 180
-  done
+# Only pause the queue if needed
+if [ "$PAUSEQUEUE" == "true" ]; then
+  # Get FOG 'Deploy' TaskID
+  fogdeployid=$(curl -s -k -H "fog-api-token: ${FOG_API_TOKEN}" -H "fog-user-token: ${FOG_USER_TOKEN}" http://fog.front.sepia.ceph.com/fog/tasktype -d '{"name": "Deploy"}' -X GET | jq -r '.tasktypes[0].id')
+
+  # Check for scheduled deploy tasks
+  deploytasks=$(curl -s -k -H "fog-api-token: ${FOG_API_TOKEN}" -H "fog-user-token: ${FOG_USER_TOKEN}" http://fog.front.sepia.ceph.com/fog/task/active -d '{"typeID": "'${fogdeployid}'"}' -X GET | jq -r '.count')
+
+  # If there are scheduled or active deploy tasks, pause the queue and let them finish.
+  # Capturing a new OS image can interrupt active OS deployments.
+  if [ $deploytasks -gt 0 ]; then
+    for type in $MACHINETYPES; do
+      # Only pause the queue for 20 minutes just in case anything goes wrong with the Jenkins job.
+      teuthology-queue --pause 1200 --machine_type $type
+    done
+    pausedqueue=true
+    currentretries=0
+    while [ $deploytasks -gt 0 ]; do
+      echo "$(date) -- $deploytasks FOG deploy tasks still queued.  Sleeping 10sec"
+      sleep 10
+      deploytasks=$(curl -s -k -H "fog-api-token: ${FOG_API_TOKEN}" -H "fog-user-token: ${FOG_USER_TOKEN}" http://fog.front.sepia.ceph.com/fog/task/active -d '{"typeID": "'${fogdeployid}'"}' -X GET | jq -r '.count')
+      ((++currentretries))
+      # Retry for 30min
+      funRetry $currentretries 180
+    done
+  fi
+else
+  pausedqueue=false
 fi
 
 # Reboot all hosts so FOG can capture their OSes
index b52ec7cb1226a40c80609498e9b6b24c38b8a8dc..19fd593555d532e60dceaacdb3e8f88b98432217 100644 (file)
           name: CMANSIBLEBRANCH
           default: "master"
           description: "Optionally define a different ceph-cm-ansible branch (useful for testing)"
+      - string:
+          name: PAUSEQUEUE
+          default: "true"
+          description: "Should the teuthology queue be paused?  Recapturing an existing OS image will cause running reimages to fail without pausing the queue.  The queue can remain unpaused when a new distro/version is being captured.  Queue is paused by default."
 
     builders:
       - shell: