-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepo.py
38 lines (25 loc) · 765 Bytes
/
repo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from dagster import FilesystemIOManager, graph, op, repository, schedule
from dagster_docker import docker_executor
@op
def hello():
return 1
@op
def goodbye(foo):
if foo != 1:
raise Exception("Bad io manager")
return foo * 2
@graph
def my_graph():
goodbye(hello())
my_job = my_graph.to_job(name="my_job")
my_step_isolated_job = my_graph.to_job(
name="my_step_isolated_job",
executor_def=docker_executor,
resource_defs={"io_manager": FilesystemIOManager(base_dir="/tmp/io_manager_storage")},
)
@schedule(cron_schedule="* * * * *", job=my_job, execution_timezone="US/Central")
def my_schedule(_context):
return {}
@repository
def deploy_docker_repository():
return [my_job, my_step_isolated_job, my_schedule]