-
Notifications
You must be signed in to change notification settings - Fork 0
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 (#10)
⭐ 💥 support RayJob via Dagster Pipes; small breaking API changes
- Loading branch information
1 parent
47d3a64
commit f14b80a
Showing
30 changed files
with
1,830 additions
and
1,000 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
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.