Patchwork D6929: ci: add comment about block duration pricing

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2019, 4:41 a.m.
Message ID <differential-rev-PHID-DREV-ddab323zo4vdctme2dt3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41876/
State New
Headers show

Comments

phabricator - Oct. 1, 2019, 4:41 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We can make things even cheaper if we remove the block duration
  from the spot request. I added a TODO to track this.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6929

AFFECTED FILES
  contrib/ci/lambda_functions/ci.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/ci/lambda_functions/ci.py b/contrib/ci/lambda_functions/ci.py
--- a/contrib/ci/lambda_functions/ci.py
+++ b/contrib/ci/lambda_functions/ci.py
@@ -572,6 +572,13 @@ 
     # there are no available spot instances. But we handle this by setting a
     # short request validity window and retrying in a different availability
     # zone. Eventually we should find someone willing to satisfy our request.
+    #
+    # TODO remove BlockDurationMinutes for even greater savings. By requesting
+    # a full block, we essentially create a 1 hour reservation rather than an
+    # instance that can be terminated whenever. The stronger guarantees make
+    # it more expensive. If we remove this, we will no longer have
+    # ActualBlockHourlyPrice in the spot request metdata and will need to
+    # update hourly cost accounting elsewhere in this file.
     res = ec2.request_spot_instances(
         BlockDurationMinutes=60,
         ValidUntil=datetime.datetime.utcnow() + datetime.timedelta(minutes=1),