feat: datasource

This commit is contained in:
tao.chen
2026-08-13 20:13:37 +08:00
parent 0b5b50edb9
commit 462617b66d
9 changed files with 601 additions and 14 deletions
+6 -5
View File
@@ -55,15 +55,16 @@ def resource_payload(
resource: DataResources,
storage_object: StorageObjects,
) -> dict[str, Any]:
# ``object_key`` is stored as ``workspace/{ws_id}/{user_id}/.resources/{file_name}``.
# Two Jupyter-facing path views:
# ``object_key`` is stored as ``{ws_id}/{user_id}/.resources/{file_name}``
# (see ``backend/services/storage.py:create_upload_record``). Two
# Jupyter-facing path views:
# - ``jupyter_accessible_path``: per-user Jupyter-relative path. The
# Jupyter root_dir is already ``workspace/{ws_id}/{user_id}/``, so we
# only return the tail ``.resources/{file_name}`` for copy-paste use.
# Jupyter root_dir is already ``workspace/{ws_id}/{user_id}/``, so
# we return the tail ``.resources/{file_name}`` for copy-paste use.
# - ``absolute_path``: full filesystem path inside the Jupyter
# container (the rclone mount root). Shape:
# ``{workspaces_root}/{ws_id}/{user_id}/.resources/{file_name}``.
workspace_prefix = f"workspace/{resource.workspace_id}/"
workspace_prefix = f"{resource.workspace_id}/"
user_prefix = f"{resource.owner_user_id}/"
jupyter_accessible_path = ""
absolute_path = ""