Retrieve the approximate cost of the build job.
There is no api call for our instance flavour, so use close match.
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Change-Id: I7ea96ccabc76550989aa0dcb97b3806f0dd2e047
- ../common/include-agl-bitbake-image.sh
- ../common/include-agl-run-test-prepare.sh
- ../common/include-agl-run-test-rsync-changeid.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh
+
# publishers:
# - naginator:
# rerun-unstable-builds: true
- ../common/include-agl-lava-labs-prepare.sh
- ../common/include-agl-run-test-short.sh
- ../common/include-agl-lava-jobs-submit.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh
# publishers:
# - naginator:
- ../common/include-apps-build-app.sh
- ../common/include-apps-prepare-upload-folder.sh
- ../common/include-apps-rsync-download-changeid.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh
################################################################################
- ../common/include-agl-lava-labs-prepare.sh
- ../common/include-agl-app-run-test-short.sh
- ../common/include-agl-lava-jobs-submit.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh
#
# CIBT-start
--- /dev/null
+echo "########## Job cost (estimate) ############"
+
+set +e
+#set -x
+# Retrieve the current uptime (in seconds)
+uptime=$(awk '{print $1}' /proc/uptime)
+# Convert to integer by truncating fractional part' and round up by one
+((uptime=${uptime%\.*}+1))
+instance_type=$(curl -s http://169.254.169.254/latest/meta-data/instance-type | sed -e "s#-iops##g")
+#echo "INFO: Retrieving Pricing Info for: $instance_type"
+url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime"
+#echo "url=$url"
+json_block=$(curl -s "$url")
+echo "$json_block"
+
+set -e
+echo "########## Job cost (estimate) ############"
!include-raw-escape: include-doc-update.sh
- shell:
!include-raw-escape: include-doc-upload.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh
!include-raw-escape: include-prefetch.sh
- shell:
!include-raw-escape: include-rsync-prefetch.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh
- ../common/include-agl-lava-labs-prepare.sh
- ../common/include-agl-run-test-short-icefish.sh
- ../common/include-agl-lava-jobs-submit-only.sh
+ - conditional-step:
+ condition-kind: always
+ steps:
+ - shell:
+ !include-raw-escape:
+ - ../common/include-agl-get-cost.sh