From 567cd7f1660d59962ea3a8ee4a8e2b4b1f4ecacc Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Wed, 6 Nov 2024 17:23:43 +0100 Subject: [PATCH] Make CONTAINER_RUNTIME a global override for all executors --- localstack-core/localstack/config.py | 6 +++++- localstack-core/localstack/runtime/analytics.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/localstack-core/localstack/config.py b/localstack-core/localstack/config.py index 87a02e0b0b25d..053fbfca6c53e 100644 --- a/localstack-core/localstack/config.py +++ b/localstack-core/localstack/config.py @@ -870,6 +870,9 @@ def populate_edge_configuration( or (EXTERNAL_SERVICE_PORTS_START + 50) ) +# The default container runtime to use +CONTAINER_RUNTIME = os.environ.get("CONTAINER_RUNTIME", "").strip() or "docker" + # PUBLIC v1: -Xmx512M (example) Currently not supported in new provider but possible via custom entrypoint. # Allow passing custom JVM options to Java Lambdas executed in Docker. LAMBDA_JAVA_OPTS = os.environ.get("LAMBDA_JAVA_OPTS", "").strip() @@ -979,7 +982,7 @@ def populate_edge_configuration( # PUBLIC: docker (default), kubernetes (pro) # Where Lambdas will be executed. -LAMBDA_RUNTIME_EXECUTOR = os.environ.get("LAMBDA_RUNTIME_EXECUTOR", "").strip() +LAMBDA_RUNTIME_EXECUTOR = os.environ.get("LAMBDA_RUNTIME_EXECUTOR", CONTAINER_RUNTIME).strip() # PUBLIC: 20 (default) # How many seconds Lambda will wait for the runtime environment to start up. @@ -1239,6 +1242,7 @@ def use_custom_dns(): "CFN_STRING_REPLACEMENT_DENY_LIST", "CFN_VERBOSE_ERRORS", "CI", + "CONTAINER_RUNTIME", "CUSTOM_SSL_CERT_PATH", "DEBUG", "DEBUG_HANDLER_CHAIN", diff --git a/localstack-core/localstack/runtime/analytics.py b/localstack-core/localstack/runtime/analytics.py index 94bba45cda138..112ba16937a1b 100644 --- a/localstack-core/localstack/runtime/analytics.py +++ b/localstack-core/localstack/runtime/analytics.py @@ -8,6 +8,7 @@ LOG = logging.getLogger(__name__) TRACKED_ENV_VAR = [ + "CONTAINER_RUNTIME", "DEBUG", "DEFAULT_REGION", # Not functional; deprecated in 0.12.7, removed in 3.0.0 "DISABLE_CORS_CHECK", @@ -17,6 +18,7 @@ "DNS_ADDRESS", "DYNAMODB_ERROR_PROBABILITY", "EAGER_SERVICE_LOADING", + "ECS_TASK_EXECUTOR", "EDGE_PORT", "ENFORCE_IAM", "IAM_SOFT_MODE",