From 169b59316e95a3222dc0cdbaf5b95589919dce8b Mon Sep 17 00:00:00 2001 From: "Stephen C. Pope" Date: Mon, 25 Mar 2024 13:56:21 -0700 Subject: [PATCH] Config: Eliminate aws-testing (#12508) GitOrigin-RevId: 2f4fbc40519b9e0b7b6410207c96c6ea941e1a84 --- descarteslabs/config/settings.toml | 10 +++---- descarteslabs/config/tests/settings.toml | 10 +------ descarteslabs/config/tests/test_config.py | 32 +++++------------------ 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/descarteslabs/config/settings.toml b/descarteslabs/config/settings.toml index 4aff447a..1a0595b9 100644 --- a/descarteslabs/config/settings.toml +++ b/descarteslabs/config/settings.toml @@ -67,15 +67,15 @@ usage_url = "@format {this.PLATFORM_URL}/usage/v1" vector_url = "@format {this.PLATFORM_URL}/vector/v1" yaas_url = "@format {this.PLATFORM_URL}/yaas/v1" -[aws-testing] -# testing is now for aws but keep this until it is removed everywhere -default_domain = "@format dev.aws.{this.DOMAIN}" -platform_url = "@format https://platform.{this.DEFAULT_DOMAIN}" +[local] +# feel free to mess with anything here as needed +default_domain = "dev.localhost" +platform_url = "@format https://platform.dev.aws.descarteslabs.com" testing = true catalog_v2_url = "@format {this.PLATFORM_URL}/metadata/v1/catalog/v2" compute_url = "@format {this.PLATFORM_URL}/compute/v1" -iam_url = "@format https://iam.{this.DEFAULT_DOMAIN}" +iam_url = "@format https://{this.DEFAULT_DOMAIN}:8000" metadata_url = "@format {this.PLATFORM_URL}/metadata/v1" raster_url = "@format {this.PLATFORM_URL}/raster/v2" usage_url = "@format {this.PLATFORM_URL}/usage/v1" diff --git a/descarteslabs/config/tests/settings.toml b/descarteslabs/config/tests/settings.toml index 63b2defa..63ec9d4c 100644 --- a/descarteslabs/config/tests/settings.toml +++ b/descarteslabs/config/tests/settings.toml @@ -1,11 +1,3 @@ ["testing"] testing = "hello" -iam_url = "https://aws_url" - -["aws-testing"] -testing = "hello" -iam_url = "https://aws_url" - -["gcp-testing"] -testing = "hello" -iam_url = "https://gcp_url" +iam_url = "https://test_url" diff --git a/descarteslabs/config/tests/test_config.py b/descarteslabs/config/tests/test_config.py index c4265a20..9217ecde 100644 --- a/descarteslabs/config/tests/test_config.py +++ b/descarteslabs/config/tests/test_config.py @@ -88,7 +88,7 @@ def test_get_settings(self): def test_peek_settings(self): current_env = os.environ["DESCARTESLABS_ENV"] - env = "aws-testing" + env = "aws-production" settings = Settings.peek_settings(env) assert os.environ["DESCARTESLABS_ENV"] == current_env assert settings.env == env @@ -105,22 +105,17 @@ def test_bad_env(self): def test_default_auth(self): a = Auth() - a.domain == "http://gcp_url" + assert a.domain == "https://iam.dev.aws.descarteslabs.com" def test_auth_with_env(self): - with patch.dict(os.environ, {"DESCARTESLABS_ENV": "aws-testing"}): + with patch.dict(os.environ, {"DESCARTESLABS_ENV": "aws-production"}): a = Auth() - a.domain == "http://aws_url" + assert a.domain == "https://iam.production.aws.descarteslabs.com" - def test_auth_with_aws_config(self): - Settings.select_env("aws-testing") + def test_auth_with_test_config(self): + Settings.select_env("aws-production") a = Auth() - a.domain == "http://aws_url" - - def test_auth_with_gcp_config(self): - Settings.select_env("testing") - a = Auth() - a.domain == "http://gcp_url" + assert a.domain == "https://iam.production.aws.descarteslabs.com" def test_env(self): peek1_env = "aws-dev" @@ -175,19 +170,6 @@ class VerifyValues(unittest.TestCase): "VECTOR_URL": "https://platform.staging.aws.descarteslabs.com/vector/v1", "YAAS_URL": "https://platform.staging.aws.descarteslabs.com/yaas/v1", }, - "aws-testing": { - "CATALOG_V2_URL": "https://platform.dev.aws.descarteslabs.com/metadata/v1/catalog/v2", - "COMPUTE_URL": "https://platform.dev.aws.descarteslabs.com/compute/v1", - "IAM_URL": "https://iam.dev.aws.descarteslabs.com", - "LOG_LEVEL": "WARNING", - "METADATA_URL": "https://platform.dev.aws.descarteslabs.com/metadata/v1", - "PLATFORM_URL": "https://platform.dev.aws.descarteslabs.com", - "RASTER_URL": "https://platform.dev.aws.descarteslabs.com/raster/v2", - "TESTING": True, - "USAGE_URL": "https://platform.dev.aws.descarteslabs.com/usage/v1", - "VECTOR_URL": "https://platform.dev.aws.descarteslabs.com/vector/v1", - "YAAS_URL": "https://platform.dev.aws.descarteslabs.com/yaas/v1", - }, "testing": { "CATALOG_V2_URL": "https://platform.dev.aws.descarteslabs.com/metadata/v1/catalog/v2", "COMPUTE_URL": "https://platform.dev.aws.descarteslabs.com/compute/v1",