Daniel Kim
03/11/2021, 9:30 PMyuhan
03/11/2021, 9:38 PMDaniel Kim
03/11/2021, 9:39 PMyuhan
03/11/2021, 9:40 PMfs_io_manager
will use the local_artifact_storage
configured in your dagster instance yaml as the base_dir by defaultDaniel Kim
03/11/2021, 9:44 PMyuhan
03/11/2021, 9:45 PMbase_dir
as a config on the fs_io_manager. here are some examples:
at definition time
@pipeline(
mode_defs=[ModeDefinition(resource_defs={"io_manager": fs_io_manager.configured({"base_dir": "path/to/dir"})})],
)
def pipe():
...
or via run_config / yaml:
resources:
<io_manager>:
config:
base_dir: <path/to/dir>
base_dir
is a config on a resource, where the resource is an io managerDaniel Kim
03/11/2021, 10:05 PMyuhan
03/11/2021, 10:09 PMDaniel Kim
03/11/2021, 10:11 PMyuhan
03/11/2021, 10:12 PMDaniel Kim
03/11/2021, 10:14 PMyuhan
03/11/2021, 10:55 PMscript_relative_path(
str(DS_RODEO_HOME / 'notebooks' / '2_Dimensionality_Reduction.ipynb')
)
"file_manager": local_file_manager.configured({"base_dir": "/tmp/aaa/"})
you can find the notebooks.Daniel Kim
03/12/2021, 1:56 PMError when attempting to materialize executed notebook using file manager (falling back to local): SerializableErrorInfo(message="PermissionError: [WinError 5] Access is denied: 'D:/'\n", stack=[' File "D:\\Python38\\envs\\ds_rodeo\\lib\\site-packages\\dagstermill\\solids.py", line 229, in _t_fn\n executed_notebook_file_handle = compute_context.resources.file_manager.write(\n', ' File "D:\\Python38\\envs\\ds_rodeo\\lib\\site-packages\\dagster\\core\\storage\\file_manager.py", line 261, in write\n self.ensure_base_dir_exists()\n', ' File "D:\\Python38\\envs\\ds_rodeo\\lib\\site-packages\\dagster\\core\\storage\\file_manager.py", line 227, in ensure_base_dir_exists\n mkdir_p(self.base_dir)\n', ' File "D:\\Python38\\envs\\ds_rodeo\\lib\\site-packages\\dagster\\utils\\__init__.py", line 126, in mkdir_p\n os.makedirs(path)\n', ' File "D:\\Python38\\lib\\os.py", line 223, in makedirs\n mkdir(name, mode)\n'], cls_name='PermissionError', cause=None)
Here's my pipeline definition:
@pipeline(
mode_defs=[
ModeDefinition(
resource_defs={
"io_manager": fs_io_manager,
"file_manager": local_file_manager.configured(
{"base_dir": "D:/"}
)
},
)
]
)
def notebook_pipeline():
dim_reduction()
I wonder perhaps Windows paths with drive letter is not supported or not working with base_dir
. I will try something else using a relative path.{"base_dir": "outputs"}
and it works relative to where I executed the dagit command. So it appears the base_dir only accepts relative path. Is there a way to set absolute path? I looked at dagster.utils module, but I see only methods for relative path.yuhan
03/12/2021, 4:09 PMDaniel Kim
03/15/2021, 12:12 PMmax
03/15/2021, 6:04 PMD:\
?Daniel Kim
03/19/2021, 1:39 PM