lablup / lablup/backend.ai

Rewire TUS PATCH/HEAD to chunk-based store

Open
#11,761 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

## Scope

This is where the user-visible bug fix lands. Replace the single-file append in tus_upload_part with the metadata-driven chunk store from BA-3974 [2/6].

## Deliverables

- `src/ai/backend/storage/api/client.py` — tus_check_session and tus_upload_part rewired to TusUploadSession; helpers _resolve_session_dir, _tus_response_headers.
- `src/ai/backend/storage/volumes/vfs/__init__.py` — prepare_upload creates a directory (no longer a touched file).
- Rewritten handler tests for the new flow (header validation, session-not-found, happy path, multi-chunk assembly, idempotent replay, size-exceeded).
- News fragment (one-sentence fix entry).

## Acceptance

- TUS 1.0.0 wire contract (PATCH/HEAD/OPTIONS on /upload) unchanged — existing tus-js-client based clients work without modification.
- Multi-chunk uploads assemble into a byte-perfect final file.
- pants fmt/lint/check/test passes including transitive check.

## Depends on

BA-3974 [2/6] (storage class).

JIRA Issue: BA-6156

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.