Skip to content

Conversation

@eg-firebolt
Copy link
Contributor

@eg-firebolt eg-firebolt commented Oct 8, 2021

The API uses a different provider_id for each environment. Instead of hardcoding it, we will fetch it once per ResourceManager instance.

Slack thread: https://firebolt-analytics.slack.com/archives/C02DA1HHX40/p1633694589047900

@octavianzarzu30
Copy link

I just checked out this branch, and it works creating engines in prod.


def get_provider_id(client: Client) -> str:
"""Get the AWS provider_id."""
response = client.get(url="/compute/v1/providers")
Copy link
Contributor

Choose a reason for hiding this comment

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

Add error handling here. Check that json doesn't contain "error"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be handled by this hook: https://github.com/firebolt-analytics/firebolt-sdk/blob/189f34a8c4f1447282ceefd49fb7d547808dbd84/src/firebolt/client/hooks.py#L26

Looking at the docs: https://api.dev.firebolt.io/devDocs#operation/computeV1ListProviders

The hook parses out the "message" associated with an error. However, it currently does not examine the "error" field.

This kind of error handling needs to happen on pretty much all requests, so let's go over it in our Wednesday meeting to ensure we've got a good pattern, then I will apply it everywhere in a follow-on PR.

@eg-firebolt eg-firebolt merged commit ccff26c into master Oct 11, 2021
@eg-firebolt eg-firebolt deleted the eg.provider-fix branch October 11, 2021 17:21
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.

4 participants