Live data from Hacker News

Committing changes to a 130GB Git repository without full checkouts [video]

youtube.com

1–10 of 18 posts

Committing changes to a 130GB Git repository without full checkouts [video]

#1
Hey HN, would appreciate feedback on a version control for data toolset I am building, creatively called the Data Manager. When working with large repositories with data, full checkouts are problematic. Many git-for-data solutions will create a new copy of the entire datasets for each commit and none of them allow contributing to a data repo without full checkouts, to my knowledge. In the video, a workflow that does not require full checkouts of the datasets and still allows to commit changes in Git is presented. Specifically, it becomes possible to check out kilobytes to commit changes to a 130 gigabyte repository, including versions. Note that only diffs are committed, at row, column, and cell level, so the diffing that appears in the GUI will seem weird, since it will interpret the old diff as the file to be compared with the new one, when in fact they are both just diffs. The goal of the Data Manager is to version datasets and structured data in general, in a storage-efficient way, and easily identify and deploy to S3 datasets snapshots, identified by repository and commit sha (and optionally a tag) that need to be pulled for processing. S3 is also used to upload heavy files that are then pointed by reference, not URL, in Git commits. The no-full-checkout workflow shown applies naturally to adding data and can be extended to edits or deletions provided the old data is known. That is to ensure the creation of bidirectional diffs that enable navigating Git history both forward and backward, useful when caching snapshots.

The burden of checking out and building snapshots from diff history is now borne by localhost, but that may change, as mentioned in the video. Smart navigation of git history from the nearest available snapshots, building snapshots with Spark, and other ways to save on data transfer and compute are being evaluated. This paradigm enables hibernating or cleaning up history on S3 for datasets no longer necessary to create snapshots, like those that are deleted, if snapshots of earlier commits are not needed. Individual data entries could also be removed for GDPR compliance using versioning on S3 objects, orthogonal to git.

The prototype already cures the pain point I built it for: it was impossible to (1) uniquely identify and (2) make available behind an API multiple versions of a collection of datasets and config parameters, (3) without overburdening HDDs due to small, but frequent changes to any of the datasets in the repo and (4) while being able to see the diffs in git for each commit in order to enable collaborative discussions and reverting or further editing if necessary. Some background: I am building natural language AI algorithms (a) easily retrainable on editable training datasets, meaning changes or deletions in the training data are reflected fast, without traces of past training and without retraining the entire language model (sounds impossible), and (b) that explain decisions back to individual training data. LLMs have fixed training datasets, whereas editable datasets call for a system to manage data efficiently, plus I wanted to have something that integrates naturally with common, tried and tested tools such as Git, S3, and MySQL, hence the Data Manager.

I am considering open-source: is that the best way to go? Which license to choose?

Committing changes to a 130GB Git repository without full checkouts [video]
youtube.com

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#4
Looks like you've just reinvented GVFS (https://github.com/microsoft/VFSForGit) for a specific use case? Or is this just a partial clone? Or a shallow clone? Or both? It's unclear from the video if this is 130 GB of current state at the branch head or 130 GB of commit history.

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#5
I use git lfs. There are filter options for all commands so you don't need to checkout any more data than you want to/need to. Works like a charm for me!

I'd be curious to hear what features you are missing. We have repositories that would be as big as 100GB if you downloaded all large files for the full history, but I guess I don't see why you would want do that?

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#6
post #4

Looks like you've just reinvented GVFS ( https://github.com/microsoft/VFSForGit ) for a specific use case? Or is this just a partial clone? Or a shallow clone? Or both? It's unclear from the video if this is 130 GB of current state at the branch head or 130 GB of commit history.

It's like GVFS, but for pieces of a file at a time as well: rows, columns, or cells. A snapshot is recreated by putting those pieces together. If you have ten million rows in one file and only add a thousand rows daily, each commit will only contain those thousand rows in its tree, not the sum total that will then be diffed by your favorite diff tool, but really just the bidirectional diff. It is the low-level materialization of the diff Git paradigm whereby during merges and rebases the 3-way difference between object trees is taken and acted upon, but placing the diffs themselves (data-level diffs on top of file-level ones) under those trees, overriding Git semantics in that Git will now deduplicate the diffs, not the entire original files, in order to recognize them as new objects and commit the new tree. In git, you can see in the video the same file diff being overwritten, representing a new piece in every commit.

While you don't need the ten million rows to commit each new thousand rows, they are needed upon merging in order to detect conflicts. Object content referenced by S3 pointers is fetched if and when needed, but the git objects themselves are fetched since they are really small. It is neither partial nor shallow clone strictly, as all the objects and trees are downloaded in the current implementation, but the S3 pointers enable similar delaying and filtering behavior, like with DVC.

Sorry if the repo size is unclear, hope this is better: ~180 kB: current state at the branch head, includes pointers to S3 (exact size depends upon packs and indices), plus full history, also with pointers ~890 MB: current state at the branch head, after downloading all files referenced by pointers in the Git history from S3, plus full history, with pointers ~130 GB: commit history, this is what the repo would weigh on DVC or Git LFS, this repo corresponds to a use case with many small updates

With increasing repo size (even when the 2nd, 890 MB state, increases in size, let alone the fully materialized history), this enables working on the 1st (kBs) and still commit changes.

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#7
post #5

I use git lfs. There are filter options for all commands so you don't need to checkout any more data than you want to/need to. Works like a charm for me! I'd be curious to hear what features you are missing. We have repositories that would be as big as 100GB if you downloaded all large files for the full history, but I guess I don't see why you would want do that?

Which repo size after the filters do you work with on your machine and how many GBs do you have in Git LFS, that is, in the cloud? I hear people complain about costs, but it depends upon scale and change frequency, which can increase total repo size.

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#8
post #5

I use git lfs. There are filter options for all commands so you don't need to checkout any more data than you want to/need to. Works like a charm for me! I'd be curious to hear what features you are missing. We have repositories that would be as big as 100GB if you downloaded all large files for the full history, but I guess I don't see why you would want do that?

Which repo size after the filters do you work with on your machine and how many GBs do you have in Git LFS, that is, in the cloud? I hear people complain about costs, but it depends upon scale and change frequency, which can increase total repo size.

We wrote our own LFS API server (which is actually not very hard, about 100 lines of python was enough and it performs at scale) so we can directly leverage azure blob storage. If you don't walk this path and enable LFS in github or something like that the costs are obscene, yes. For us it's dirt cheap.

If I check out head of my repo and don't filter anything, it's a couple GBs.

Inside the azure blob storage container that backs our LFS API server, there's probably terabytes of data. It's really very very much.

We don't have any performance problems. One API instance can handle it. Of course we did make sure to implement it well... It's Uvicorn/Starlette, all IO is async and all CPU "intensive" work like JSON (de)serialization runs in a background threadpool.

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#9

Honestly, it’d be nice if there was like a PNGCrush for git repos. Or maybe even if Git offered zstd compression would be cool too.

Git does do compression on repos, but the fact that versioning repositories with (huge) data is still an open problem suggests that it is not the kind that fixes it. I might be mistaken, are you aware of any interesting compression methods applied to version control?

Re: Committing changes to a 130GB Git repository without full checkouts [video]

#10
post #8

Earlier quoted context omitted.

Which repo size after the filters do you work with on your machine and how many GBs do you have in Git LFS, that is, in the cloud? I hear people complain about costs, but it depends upon scale and change frequency, which can increase total repo size.

We wrote our own LFS API server (which is actually not very hard, about 100 lines of python was enough and it performs at scale) so we can directly leverage azure blob storage. If you don't walk this path and enable LFS in github or something like that the costs are obscene, yes. For us it's dirt cheap. If I check out head of my repo and don't filter anything, it's a couple GBs. Inside the azure blob storage containe…

That is really interesting and begs the question of how frequently you have changes in your data that lead to new commits. I am assuming here that you don't dedupe anything, that is, you throw the entire files into Azure with each version, since it's cheap enough for your purposes. Also, how frequently do you move head, even without committing anything new, perhaps to use another branch?
Post reply on HN