Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
feat(dbt-fal): cloud host resolution (#758)
Browse files Browse the repository at this point in the history
* feat: resolve host=cloud to api.alpha.fal.ai

* feat: also resolve cloud-eu
  • Loading branch information
mederka authored Feb 14, 2023
1 parent 5b7bbea commit 31e3de3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docsite/docs/dbt-fal/cloud/using_fal_cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sidebar_position: 1
Skip this step, if you already have the latest version of fal installed,

```bash
pip install --upgrade fal
pip install --upgrade fal[cloud]
```

## 1. Authenticate to fal cloud
Expand Down Expand Up @@ -45,7 +45,7 @@ fal_profile:
fal_cloud:
type: fal
db_profile: db
host: api.alpha.fal.ai
host: cloud
key_secret: MY_KEY_SECRET_VALUE
key_id: MY_KEY_ID_VALUE
db:
Expand All @@ -71,7 +71,7 @@ fal_profile:
prod:
type: fal
db_profile: db
host: rooster.fal.ai:60005
host: cloud
key_secret: MY_KEY_SECRET_VALUE
key_id: MY_KEY_ID_VALUE
db:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from dbt.fal.adapters.python import PythonConnectionManager


DEFAULT_HOSTS = {
"cloud": "api.alpha.fal.ai",
"cloud-eu": "api.eu.fal.ai",
}


class TeleportTypeEnum(StrEnum):
LOCAL = "local"
REMOTE_S3 = "s3"
Expand Down Expand Up @@ -45,7 +51,7 @@ def cancel(self, connection):
class FalCredentials(Credentials):
default_environment: str = "local"
teleport: Optional[TeleportCredentials] = None
host: str = ""
host: str = "cloud"
key_secret: str = ""
key_id: str = ""

Expand All @@ -54,6 +60,10 @@ class FalCredentials(Credentials):
database: str = ""
schema: str = ""

def __post_init__(self):
if self.host in list(DEFAULT_HOSTS.keys()):
self.host = DEFAULT_HOSTS[self.host]

@property
def type(self):
return "fal_experimental"
Expand Down

0 comments on commit 31e3de3

Please sign in to comment.