You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2021/05/07 14:00:37 UTC

[airflow-ci-infra] branch main updated: Use the cheaper ASG in Ohio (#24)

This is an automated email from the ASF dual-hosted git repository.

ash pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-ci-infra.git


The following commit(s) were added to refs/heads/main by this push:
     new 97579ac  Use the cheaper ASG in Ohio (#24)
97579ac is described below

commit 97579acca38d3584104715a4da91c6bd15389dea
Author: Ash Berlin-Taylor <as...@firemirror.com>
AuthorDate: Fri May 7 15:00:29 2021 +0100

    Use the cheaper ASG in Ohio (#24)
---
 lambdas/scale_out_runner/.chalice/config.json | 3 ++-
 lambdas/scale_out_runner/app.py               | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lambdas/scale_out_runner/.chalice/config.json b/lambdas/scale_out_runner/.chalice/config.json
index bd29d8c..669f935 100644
--- a/lambdas/scale_out_runner/.chalice/config.json
+++ b/lambdas/scale_out_runner/.chalice/config.json
@@ -11,7 +11,8 @@
       "iam_policy_file": "prod_iam.json",
       "environment_variables": {
         "GH_WEBHOOK_TOKEN_ENCRYPTED": "AQICAHg1MGVq8MAqYXSkkgy6iL19KSI14nJw8DelmHFuRpAfvQEh/mniWicOD0N1aVuHhp+VAAAAfDB6BgkqhkiG9w0BBwagbTBrAgEAMGYGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMVqkAu70BaR2rDQ4qAgEQgDlIAxDrBlblL6XNKkJIs+zrNEMcGpS68JnoVh2s1oKEzbBXzYS16/9ZrW9CwUV4ULAd2EsGb90iz74=",
-        "ACTIONS_SQS_URL": "https://sqs.eu-central-1.amazonaws.com/827901512104/actions-runner-requests"
+        "ASG_NAME": "RunnerASG",
+        "ASG_REGION_NAME": "us-east-2"
       }
     }
   },
diff --git a/lambdas/scale_out_runner/app.py b/lambdas/scale_out_runner/app.py
index 2f40fb1..a02b341 100644
--- a/lambdas/scale_out_runner/app.py
+++ b/lambdas/scale_out_runner/app.py
@@ -30,6 +30,7 @@ app = Chalice(app_name='scale_out_runner')
 app.log.setLevel(logging.INFO)
 
 ASG_GROUP_NAME = os.getenv('ASG_NAME', 'AshbRunnerASG')
+ASG_REGION_NAME = os.getenv('ASG_REGION_NAME', None)
 TABLE_NAME = os.getenv('COUNTER_TABLE', 'GithubRunnerQueue')
 _commiters = set()
 GH_WEBHOOK_TOKEN = None
@@ -177,7 +178,7 @@ def increment_dynamodb_counter(delta: int = 1) -> int:
 
 
 def scale_asg_if_needed(num_queued_jobs: int) -> dict:
-    asg = boto3.client('autoscaling')
+    asg = boto3.client('autoscaling', region_name=ASG_REGION_NAME)
 
     resp = asg.describe_auto_scaling_groups(
         AutoScalingGroupNames=[ASG_GROUP_NAME],