-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⭐ 💥 support RayJob via Dagster Pipes; rework of everything
- Loading branch information
1 parent
740087f
commit bc9bca1
Showing
25 changed files
with
1,298 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import os | ||
|
||
DEFAULT_DEPLOYMENT_NAME = ( | ||
os.getenv("DAGSTER_CLOUD_DEPLOYMENT_NAME") | ||
if os.getenv("DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT") == "0" | ||
else os.getenv("DAGSTER_CLOUD_GIT_BRANCH") | ||
) or "dev" | ||
|
||
IS_PROD = DEFAULT_DEPLOYMENT_NAME == "prod" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os | ||
from typing import Dict, Union, cast | ||
|
||
from dagster import InitResourceContext, OpExecutionContext | ||
|
||
from dagster_ray._base.constants import DEFAULT_DEPLOYMENT_NAME | ||
|
||
|
||
def get_dagster_tags(context: Union[InitResourceContext, OpExecutionContext]) -> Dict[str, str]: | ||
""" | ||
Returns a dictionary with common Dagster tags. | ||
""" | ||
assert context.dagster_run is not None | ||
|
||
labels = { | ||
"dagster.io/run_id": cast(str, context.run_id), | ||
"dagster.io/deployment": DEFAULT_DEPLOYMENT_NAME, | ||
# TODO: add more labels | ||
} | ||
|
||
if context.dagster_run.tags.get("user"): | ||
labels["dagster.io/user"] = context.dagster_run.tags["user"] | ||
|
||
if os.getenv("DAGSTER_CLOUD_GIT_BRANCH"): | ||
labels["dagster.io/git-branch"] = os.environ["DAGSTER_CLOUD_GIT_BRANCH"] | ||
|
||
if os.getenv("DAGSTER_CLOUD_GIT_SHA"): | ||
labels["dagster.io/git-sha"] = os.environ["DAGSTER_CLOUD_GIT_SHA"] | ||
|
||
return labels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from dagster_ray.kuberay.client.raycluster import RayClusterClient | ||
from dagster_ray.kuberay.client.rayjob import RayJobClient | ||
|
||
__all__ = ["RayClusterClient", "RayJobClient"] |
Oops, something went wrong.