Make update: Show Git LFS download progress #118673

Merged
Sergey Sharybin merged 5 commits from Sergey/blender:lfs_update_with_progress into blender-v4.1-release 2024-02-23 17:41:10 +01:00

Solves the issue of the script potentially sitting for a long time
without having any progress reported. Confusingly, such behavior
depends on Git version.

In older versions (< 2.33) there will be progress reported, but it
then got changed by the commit in Git:

7a132c628e

The delayed checkout is exactly how Git LFS integrates into the Git
process. Another affecting factor for the behavior is that submodule
configured to use "checkout" update policy is forced to have quite
flag passed to the "git checkout":

https://github.com/git/git/blob/v2.43.2/builtin/submodule--helper.c#L2258

This is done to avoid the long message at the end of checkout about
the detached state of HEAD, with instructions how to resolve that.

There are two possible solutions: either use "rebase" update policy
for submodules, or skip Git LFS download during the submodule update.

Changing the update policy is possible, but it needs to be done with
a bit of care, and possible revised process for updating/merging
tests data.

This change follows the second idea of delaying LFS download for a
later step, so the process is the following:

  • Run git submodule update, but tell Git LFS to not resolve the links
    by using GIT_LFS_SKIP_SMUDGE=1 environment variable.
  • Run git lfs pull for the submodule, to resolve the links.

Doing so bypasses hardcoded silencing in the Git. It also potentially
allows to recover from an aborted download process.

The git lfs pull seems to be a nominal step to resolve the LFS links
after the smudging has been skipped. It is also how in earlier Git
versions some Windows limitations were bypassed:

https://www.mankier.com/7/git-lfs-faq

The submodule update now also receives the "--progress" flag, which
logs the initial Git repository checkout process, which further
improves the feedback.

The byproduct of this change is that an error during precompiled
libraries and tests data update is not considered to be fatal.
It seems to be more fitting with other update steps, and allows
more easily reuse some code.

There is also a cosmetic change: the messages at the end of the
update process now have their own header, allowing more easily
see them in the wall-of-text.

Solves the issue of the script potentially sitting for a long time without having any progress reported. Confusingly, such behavior depends on Git version. In older versions (< 2.33) there will be progress reported, but it then got changed by the commit in Git: https://github.com/git/git/commit/7a132c628e57b9bceeb88832ea051395c0637b16 The delayed checkout is exactly how Git LFS integrates into the Git process. Another affecting factor for the behavior is that submodule configured to use "checkout" update policy is forced to have quite flag passed to the "git checkout": https://github.com/git/git/blob/v2.43.2/builtin/submodule--helper.c#L2258 This is done to avoid the long message at the end of checkout about the detached state of HEAD, with instructions how to resolve that. There are two possible solutions: either use "rebase" update policy for submodules, or skip Git LFS download during the submodule update. Changing the update policy is possible, but it needs to be done with a bit of care, and possible revised process for updating/merging tests data. This change follows the second idea of delaying LFS download for a later step, so the process is the following: - Run `git submodule update`, but tell Git LFS to not resolve the links by using GIT_LFS_SKIP_SMUDGE=1 environment variable. - Run `git lfs pull` for the submodule, to resolve the links. Doing so bypasses hardcoded silencing in the Git. It also potentially allows to recover from an aborted download process. The `git lfs pull` seems to be a nominal step to resolve the LFS links after the smudging has been skipped. It is also how in earlier Git versions some Windows limitations were bypassed: https://www.mankier.com/7/git-lfs-faq The submodule update now also receives the "--progress" flag, which logs the initial Git repository checkout process, which further improves the feedback. The byproduct of this change is that an error during precompiled libraries and tests data update is not considered to be fatal. It seems to be more fitting with other update steps, and allows more easily reuse some code. There is also a cosmetic change: the messages at the end of the update process now have their own header, allowing more easily see them in the wall-of-text.
Sergey Sharybin added 1 commit 2024-02-23 16:53:51 +01:00
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
63cc09755a
Make update: Show Git LFS download progress
Solves the issue of the script potentially sitting for a long time
without having any progress reported. Confusingly, such behavior
depends on Git version.

In older versions (< 2.33) there will be progress reported, but it
then got changed by the commit in Git:

  7a132c628e

The delayed checkout is exactly how Git LFS integrates into the Git
process. Another affecting factor for the behavior is that submodule
configured to use "checkout" update policy is forced to have quite
flag passed to the "git checkout":

  https://github.com/git/git/blob/v2.43.2/builtin/submodule--helper.c#L2258

This is done to avoid the long message at the end of checkout about
the detached state of HEAD, with instructions how to resolve that.

There are two possible solutions: either use "rebase" update policy
for submodules, or skip Git LFS download during the submodule update.

Changing the update policy is possible, but it needs to be done with
a bit of care, and possible revised process for updating/merging
tests data.

This change follows the second idea of delaying LFS download for a
later step, so the process is the following:
- Run `git submodule update`, but tell Git LFS to not resolve the links
  by using GIT_LFS_SKIP_SMUDGE=1 environment variable.
- Run `git lfs pull` for the submodule, to resolve the links.

Doing so bypasses hardcoded silencing in the Git. It also potentially
allows to recover from an aborted download process.

The `git lfs pull` seems to be a nominal step to resolve the LFS links
after the smudging has been skipped. It is also how in earlier Git
versions some Windows limitations were bypassed:

  https://www.mankier.com/7/git-lfs-faq

The submodule update now also receives the "--progress" flag, which
logs the initial Git repository checkout process, which further
improves the feedback.

The byproduct of this change is that an error during precompiled
libraries and tests data update is not considered to be fatal.
It seems to be more fitting with other update steps, and allows
more easily reuse some code.

There is also a cosmetic change: the messages at the end of the
update process now have their own header, allowing more easily
see them in the wall-of-text.
Sergey Sharybin requested review from Brecht Van Lommel 2024-02-23 16:54:31 +01:00
Member

this will also need to be done in build_files\windows\check_libraries.cmd as python isn't used for the initial checkout on windows.

this will also need to be done in `build_files\windows\check_libraries.cmd` as python isn't used for the initial checkout on windows.
Author
Owner

@LazyDodo Sure, but there are couple of points (which probably should have been stated in the description):

  • First, we need to agree it behaves correctly
  • Second, I wouldn't be able to test such change on Windows. The way environment variables are handled there is a bit suboptimal
@LazyDodo Sure, but there are couple of points (which probably should have been stated in the description): - First, we need to agree it behaves correctly - Second, I wouldn't be able to test such change on Windows. The way environment variables are handled there is a bit suboptimal
Author
Owner

@blender-bot build

@blender-bot build
Sergey Sharybin added 1 commit 2024-02-23 17:12:47 +01:00
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
c06b422282
Fix incorrect environment
Need to extend the OS environment, not override.
Author
Owner

@blender-bot build

@blender-bot build
Sergey Sharybin added 1 commit 2024-02-23 17:14:13 +01:00
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
0dd460019a
Fix missing inmport
Author
Owner

@blender-bot build

@blender-bot build
Member

Not a problem, I can do the work on windows once this lands

Not a problem, I can do the work on windows once this lands
Sergey Sharybin added 1 commit 2024-02-23 17:22:53 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
867e22d333
It is os.environ not os.environment
Author
Owner

@blender-bot build

@blender-bot build
Sergey Sharybin added 1 commit 2024-02-23 17:32:47 +01:00
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
d49c9367bf
Decrease verbosity of logging
Do not log existing os.environ content.
Author
Owner

@blender-bot build

@blender-bot build
Brecht Van Lommel approved these changes 2024-02-23 17:39:53 +01:00
Sergey Sharybin merged commit 9277377f6b into blender-v4.1-release 2024-02-23 17:41:10 +01:00
Sergey Sharybin deleted branch lfs_update_with_progress 2024-02-23 17:41:13 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#118673
No description provided.