Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update default endpoint URL #30

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

amarsjac
Copy link
Contributor

@amarsjac amarsjac commented Sep 8, 2023

What was the problem/requirement? (What/Why)

default endpoint url needs to be updated

What was the solution? (How)

Update with new url endpoint

What is the impact of this change?

service targetgets

How was this change tested?

via unit tests

Was this change documented?

no

Is this a breaking change?

no

@amarsjac amarsjac requested a review from a team as a code owner September 8, 2023 16:51
@amarsjac amarsjac changed the title chore: Update default endpoint URL WIP DO NOT MERGE UNTIL MONDAY chore: Update default endpoint URL Sep 8, 2023
@amarsjac amarsjac marked this pull request as draft September 8, 2023 18:22
@@ -26,8 +26,7 @@
# Environment variable that, if set, overrides the value of CONFIG_FILE_PATH
CONFIG_FILE_PATH_ENV_VAR = "DEADLINE_CONFIG_FILE_PATH"
# The default Amazon Deadline Cloud endpoint URL
# TODO: This is currently set to our closed-beta endpoint. We need to remove this for GA.
DEFAULT_DEADLINE_ENDPOINT_URL = "https://btpdb6qczg.execute-api.us-west-2.amazonaws.com"
DEFAULT_DEADLINE_ENDPOINT_URL = "https://deadline.us-west-2.amazonaws.com"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't hardcode the region to us-west-2 here. Also we should just be able to drop the endpoint URL altogether as the AmazonBeaLineModel will generate an SDK that autogenerates the URL altogether. All we need to provide to the client is the region

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 is there a reason that we shouldn't make the default None rather than a specific URL? We should be obtaining the endpoint URL from the model.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this field entirely from the CLI, config file, and the UI. I was recently looking into other options, and found that https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html works: you can set an environment variable AWS_ENDPOINT_URL_DEADLINE=https://... and any deadline service calls will use it. (Note: that env var does not work on awscli v1, only awscli v2 and boto3.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the hardcoded URL the URL endpoint is now fetched from the en var AWS_ENDPOINT_URL_DEADLINE I have also stripped the UI element

@amarsjac amarsjac changed the title WIP DO NOT MERGE UNTIL MONDAY chore: Update default endpoint URL chore: Update default endpoint URL Sep 18, 2023
@amarsjac amarsjac marked this pull request as ready for review September 18, 2023 14:06
@@ -26,8 +26,7 @@
# Environment variable that, if set, overrides the value of CONFIG_FILE_PATH
CONFIG_FILE_PATH_ENV_VAR = "DEADLINE_CONFIG_FILE_PATH"
# The default Amazon Deadline Cloud endpoint URL
# TODO: This is currently set to our closed-beta endpoint. We need to remove this for GA.
DEFAULT_DEADLINE_ENDPOINT_URL = "https://btpdb6qczg.execute-api.us-west-2.amazonaws.com"
DEFAULT_DEADLINE_ENDPOINT_URL = "https://deadline.us-west-2.amazonaws.com"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 is there a reason that we shouldn't make the default None rather than a specific URL? We should be obtaining the endpoint URL from the model.

src/deadline/job_attachments/aws/aws_config.py Outdated Show resolved Hide resolved
mwiebe
mwiebe previously requested changes Sep 22, 2023
@@ -26,8 +26,7 @@
# Environment variable that, if set, overrides the value of CONFIG_FILE_PATH
CONFIG_FILE_PATH_ENV_VAR = "DEADLINE_CONFIG_FILE_PATH"
# The default Amazon Deadline Cloud endpoint URL
# TODO: This is currently set to our closed-beta endpoint. We need to remove this for GA.
DEFAULT_DEADLINE_ENDPOINT_URL = "https://btpdb6qczg.execute-api.us-west-2.amazonaws.com"
DEFAULT_DEADLINE_ENDPOINT_URL = "https://deadline.us-west-2.amazonaws.com"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this field entirely from the CLI, config file, and the UI. I was recently looking into other options, and found that https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html works: you can set an environment variable AWS_ENDPOINT_URL_DEADLINE=https://... and any deadline service calls will use it. (Note: that env var does not work on awscli v1, only awscli v2 and boto3.)

@amarsjac amarsjac force-pushed the amarsjac/update_endpoint_url branch 2 times, most recently from 92c14ca to 77333f9 Compare October 25, 2023 15:55
Remove Endpoint URL from UI

Signed-off-by: Marshall Jackson <amarsjac@amazon.com>
@amarsjac amarsjac dismissed mwiebe’s stale review October 25, 2023 20:34

Got approval to dismiss via slack, he is AFK and this is time sensitive

@@ -114,7 +124,7 @@ def get_boto3_client(service_name: str, config: Optional[ConfigParser] = None) -
session = get_boto3_session(config=config)

if service_name == "deadline":
deadline_endpoint_url = get_setting("settings.deadline_endpoint_url", config=config)
deadline_endpoint_url = get_deadline_endpoint_url(config=config)
client = session.client(service_name, endpoint_url=deadline_endpoint_url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just omit endpoint_url entirely from this (and other places which use the enpoint url) if it's not in an env var? Then it would default to the service model installed right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From marks comment it appears that we don't even need the logic to set in our calls it if AWS_ENDPOINT_URL_DEADLINE is set as an env var because awscliv2 and boto3 handle it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this PR has been merged. Can we address this in a follow up? @amarsjac

@amarsjac amarsjac merged commit e6b20e6 into mainline Oct 25, 2023
18 checks passed
@amarsjac amarsjac deleted the amarsjac/update_endpoint_url branch October 25, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants