-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
W&B integration follow up 2/ update example to defs (#12059)
### Summary & Motivation depends on #10470 this PR converts the example from using repository to defs as the entry point, per changes in 1.1.7 (#11167) ### How I Tested These Changes - local dagit can load - unit test
- Loading branch information
Showing
6 changed files
with
47 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.dagster] | ||
module_name = "with_wandb" |
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,38 @@ | ||
from dagster import ( | ||
Definitions, | ||
StringSource, | ||
load_assets_from_package_module, | ||
make_values_resource, | ||
) | ||
from dagster_wandb import wandb_artifacts_io_manager, wandb_resource | ||
|
||
from . import assets | ||
from .ops.launch.run_launch_agent import run_launch_agent_example | ||
from .ops.launch.run_launch_job import run_launch_job_example | ||
from .ops.partitioned_job import partitioned_job_example | ||
from .ops.simple_job import simple_job_example | ||
|
||
wandb_config = make_values_resource( | ||
entity=StringSource, | ||
project=StringSource, | ||
) | ||
|
||
defs = Definitions( | ||
assets=load_assets_from_package_module(assets), | ||
jobs=[ | ||
simple_job_example, | ||
partitioned_job_example, | ||
run_launch_agent_example, | ||
run_launch_job_example, | ||
], | ||
resources={ | ||
"wandb_config": wandb_config.configured( | ||
{ | ||
"entity": {"env": "WANDB_ENTITY"}, | ||
"project": {"env": "WANDB_PROJECT"}, | ||
} | ||
), | ||
"wandb_resource": wandb_resource.configured({"api_key": {"env": "WANDB_API_KEY"}}), | ||
"io_manager": wandb_artifacts_io_manager.configured({"cache_duration_in_minutes": 60}), | ||
}, | ||
) |
Empty file.
This file was deleted.
Oops, something went wrong.
9 changes: 6 additions & 3 deletions
9
examples/with_wandb/with_wandb_tests/test_basic_wanb_example.py
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
from with_wandb.repository import dagster_with_wandb | ||
from with_wandb import defs | ||
|
||
|
||
def test_can_load(): | ||
assert dagster_with_wandb.get_job("simple_job_example") | ||
def test_defs_can_load(): | ||
assert defs.get_job_def("simple_job_example") | ||
assert defs.get_job_def("partitioned_job_example") | ||
assert defs.get_job_def("run_launch_agent_example") | ||
assert defs.get_job_def("run_launch_job_example") |
This file was deleted.
Oops, something went wrong.