Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @01:59PM
(#35930896)
Full checkouts of large data repositories are problematic. In the video, a workflow that does not require full checkouts of the datasets and still allows to commit diff-based changes in Git. This naturally applies to new data, and can be applied to edits or deletions provided the old data is known - this is to ensure the creation of bidirectional diffs that enable navigating Git history both forward and backward, useful when caching snapshots. Feedback is most welcome!
On open-source: should this toolset be open sourced? Which license to choose?
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @05:27PM
(#35932916)
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:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @11:43PM
(#35935147)
Fully agree. Compression in many cases removes the ability to diff easily, however. In a large dataset where, in terms of size, 1% of the original data undergoes changes, or new data the size of 1% of the original dataset is added, I think compressing does not compare with just deduplicating the unchanged 99% in terms of storage, but when speed is the #1 factor, the discussion is more nuanced. It might be interesting to have a combination of deduplication and better compression of the changes, in some form, to get the optimal tradeoff. Repo sizes in ML these days are high, I'm curious which repository compression techniques are being evaluated and deployed.
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by wrfopk on Saturday May 13, 2023 @04:42PM
(#35932500)
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:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @05:14PM
(#35932802)
It's like GVFS, but for pieces of a file at a time as well: rows, columns, or cells. In git, you can see in the video the same file diff being overwritten, representing a new piece in every commit. A snapshot is recreated by putting those pieces together. Since S3 pointers are used, it is neither partial nor shallow clone strictly, as all the objects and trees are downloaded in the current implementation, but the pointers enable similar delaying 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
With increasing repo size (even the 2nd, 890 MB state), this enables working on the 1st (kBs) and still commit changes.
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by korijn on Saturday May 13, 2023 @05:03PM
(#35932687)
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:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @05:21PM
(#35932864)
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:Check out kilobytes, Git commit dataset changes to a 130 ...
by korijn on Saturday May 13, 2023 @05:24PM
(#35932893)
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:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @05:33PM
(#35932964)
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?
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by korijn on Saturday May 13, 2023 @05:49PM
(#35933120)
LFS stores files by content hash, so deduplication happens that way. But you're right that if you frequently make small changes to a single large file, it's wasteful.
In our case though we don't frequently change files, we just get lots and lots of new big files coming in all the time.
Moving head, as in, to check out another branch locally? Somewhat regularly I guess. I suppose you're wondering about performance in that scenario? It's usually quite good since git-lfs does some local caching as well. I've never needed to wait longer than a couple of seconds. I'm usually on a wired 1000/1000 Mbit optic fibre connection, and transfers are directly to and from an azure blob storage container (the LFS API server only generates download and upload URLs, it intentionally doesn't transfer any data), with parallel connections and chunking etc, so it doesn't really get any better than that. And all of that is out of the box functionality too. :)
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @06:23PM
(#35933349)
Sorry I should have been more specific, I meant block deduplication, or any form of deduplication at a level lower than the entire file. File deduplication can only get you so far, depending on the use case. XetHub does block deduplication, whereas I am implementing data-level deduplication, which is slower in recreating dataset snapshots (can be parallelized and delegated), but allows savings on disk space with small but frequent changes and can be tied to collaborative features to show diffs, comment on them, and revert or edit changes where needed, all while pointing clearly to specific commits. And also potentially fork data or cumulative changes.
Yes I meant either checking out other branches locally, or in the general case pointing to another branch to indicate to any services to make data from that branch available to wherever it's consumed. I am assuming that each incoming new file is then added to data pipelines, possibly just a few. Sounds like you are in the sweet spot where you have the speed you want and, given unfrequent changes, you are fine with the versions taking up terabytes on Azure, since they are mostly new data.
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @07:27PM
(#35933813)
Just read the second paragraph. Currently expanding merge resolution assistance to deal with the general merge conflict case, as well as implementing revert and cherry-pick assistance. Unsure if that is what you were wondering? You probably don't want to do that with 100 GB if most of your commits are new data, rather than changes, yet I wonder whether all incoming new files are then queued into the same pipelines and the reason why they are separate files is not to have to deal with one giant cumulative file for which the older parts would not be deduped in Git LFS, which is a great reason, or whether those files are anyway different file types in terms of contents and intended use, another great reason, or something else altogether. Are you processing data by including anything in a given folder in a given commit?
Re:Check out kilobytes, Git commit dataset changes to a 130 ...
by eliomattia on Saturday May 13, 2023 @10:30PM
(#35934825)
The two are not mutually exclusive, in principle. Depending on workflows, sizes, and change frequencies, each has advantages. Sparse checkouts can be useful with small files that specific individuals can focus upon, among other things. This is for larger datasets that change daily and for facilitating versioning in workflows with incoming data. This is an interesting use case: https://news.ycombinator.com/item?id=35763004
On open-source: should this toolset be open sourced? Which license to choose?
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
With increasing repo size (even the 2nd, 890 MB state), this enables working on the 1st (kBs) and still commit changes.
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?
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.
In our case though we don't frequently change files, we just get lots and lots of new big files coming in all the time.
Moving head, as in, to check out another branch locally? Somewhat regularly I guess. I suppose you're wondering about performance in that scenario? It's usually quite good since git-lfs does some local caching as well. I've never needed to wait longer than a couple of seconds. I'm usually on a wired 1000/1000 Mbit optic fibre connection, and transfers are directly to and from an azure blob storage container (the LFS API server only generates download and upload URLs, it intentionally doesn't transfer any data), with parallel connections and chunking etc, so it doesn't really get any better than that. And all of that is out of the box functionality too. :)
Yes I meant either checking out other branches locally, or in the general case pointing to another branch to indicate to any services to make data from that branch available to wherever it's consumed. I am assuming that each incoming new file is then added to data pipelines, possibly just a few. Sounds like you are in the sweet spot where you have the speed you want and, given unfrequent changes, you are fine with the versions taking up terabytes on Azure, since they are mostly new data.