feat(dvc): gzip + multi-chunk dvc_files tag serialization - #29
Conversation
Compress the dvc_files MLflow tag (gzip+base64, 'gz:' prefix) and split overflow into dvc_files__N chunks so the tag stays under the MLflow tag limit (MAX_TAG_VAL_LENGTH=8000) regardless of file count. deserialize detects the prefix and falls back to plaintext JSON for backward compat; serving reassembles the chunks before deserializing. Refs #28
리뷰이슈 #28과 PR 설명을 확인했습니다.
전반적으로 이슈에서 요구한 스코프(gz 압축 + 멀티청크 + 하위호환)를 정확히 구현했고, 테스트도 (통합 테스트 하나를 제외하면) 꼼꼼합니다. 승인해도 좋을 것 같습니다. |
Summary
Move the gzip + multi-chunk
dvc_filestag serialization into upstream so publish (notebook) and serving share one implementation, fixing a serialize/deserialize split-brain (downstream nubison/mlplatform#691).Previously the gz compression lived only in a downstream notebook-image patch. Serving runtime-installs the nubison version pinned in the model's
requirements.txt(official0.0.10), whosedeserialize_dvc_infois plainjson.loads— it raises on agz:tag, sodvc_info={}, DVC restore is skipped, and the model fails to load (No such file: weights_custom.pkl).Changes
Storage.py:serialize_dvc_info(gzip+base64,gz:prefix) /deserialize_dvc_info(gz:detection + plaintext backward compat) + new_chunk_tag_value/_reassemble_dvc_tag(split/rejoindvc_files__Nchunks so the tag stays underMAX_TAG_VAL_LENGTH=8000for any file count).Model.py:registerwritestags.update(_chunk_tag_value(serialize_dvc_info(dvc_info))).Service.py: reassembles chunks before deserializing on load.test/test_storage.py: gz prefix / plaintext backward compat / chunk split+reassemble / 500-file over-limit full pipeline.Backward compatibility
deserialize_dvc_infotransparently handles bothgz:and legacy plaintext JSON tags; single-chunk (nodvc_files__N) still works via_reassemble_dvc_tag.Verification
test/test_storage.pynew cases 7 PASS;test_storage.py+test_service.pyregression 73 PASS.dvc_files=gz:...; the staging inference server installed this branch, ran DVC restore (6/6, noNo such file),Service initialized, 1/1 Running, readyz/healthz/livez 200.Closes #28