-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support pulling by a specific commit or a date #48
Comments
Currently, atlas performs the following sequence:
I think it would be as simple as changing the I might have found a way to keep the reduced download size, but it would require some experimentation, and I'm not sure yet which versions of git support it. |
By switching from clone to an explicit init+fetch we can get better control of what commits are fetched. clone only allows targeting a branch or a tag, but fetch can ask for any commit. The caveat is that the server needs to allow this via `uploadpack.allowReachableSHA1InWant` and similar. Minor changes: - checkout is now also quiet by default See openedx#48
By switching from clone to an explicit init+fetch we can get better control of what commits are fetched. clone only allows targeting a branch or a tag, but fetch can ask for any commit. The caveat is that the server needs to allow this via `uploadpack.allowReachableSHA1InWant` and similar. Minor changes: - checkout is now also quiet by default See openedx#48
I ended up opening a PR for the second approach: #61 |
Hey @timmc-edx!! Thanks a ton for your contribution!! I'm glad you chose this feature to implement. Additionaly, I need to review in details the two options you've mentioned to ensure I fully understand the performance impact. Download Size issuesIf we go with the worst option: full The 24MB is a three times as large as 8MB at the moment, but difference (repo size vs commit size) grows exponentially. So in the future it's expected that the difference is more of 20 or even 100x (1000MB vs 10MB). The translation pull, happens multiple times during a server rebuild, so 24MB pull in 8 images would be more like 192MB instead of 64MB. Atlas is used by both developers on their local machine and CI servers with sometimes choppy or slow internet connection. Sometimes the developer only needs to pull iOS app which is a few kilobytes of data and in such cases a |
Yeah, I wasn't envisioning the "pull everything and then delete" as a long-term solution since it looked like the only other option might require a newer minimum version of git. But I think the other solution I came up with is better anyhow. I'm not sure where I got 8 MB from in that previous comment; edx-platform currently gets 14 MB of translations. I put some logging lines into the version of atlas that currently gets installed into atlas -- each line calls
With the version I submitted as a PR, also pulling main:
As to git compatibility... I got it to pass integration tests with 2.25.1 in the GitHub CI, but when I run that version of git locally with the latest atlas, it downloads 115 MB of stuff. Something about sparse checkouts or shallow cloning not working?
...but maybe it's OK that the oldest supported version of git does this, as long as it otherwise works. (Interestingly, with the version in my PR it only downloads 65 MB. I haven't checked why.) |
We can require a newer version of Anyway, I will review the solution in details and get back to you. |
Just to be clear, the 2.25.1 issue is not that it doesn't work, but that it pulls more than necessary (both with the current atlas and my proposed change). At most, I would recommend adding a warning that older versions of git may be less efficient. It should be fine to keep supporting it. |
Currently the
atlas pull
supports a--branch
argument which accepts only git branches and tags.atlas pull
could be more verstile if it supported a more generic--revision
argument which could accept the following revisions:git checkout open-release/quince.master
git checkout open-release/quince.1
git checkout f098hab11
git checkout 'main@{2020-11-06}'
as supported by https://linux.die.net/man/1/git-rev-parseThe text was updated successfully, but these errors were encountered: