Skip to content

Improve time required to clone repositories in initContainer #1417

@ZohebShaikh

Description

@ZohebShaikh

Currently the repos are cloned in sync and it clones everything(default)

The solution that I propose to this is

  1. Using Asycn IO to do the clone ( There is no native support for this but it is easy to implement more details here)

  2. Do git clone with the following option --filter=blob:none more details here

There is --filter=tree:0 which is also a good option but in my personal opinion going with blob:none is better because the thing that we want to avoid cloning is the gh-pages branch but clone most of the source code which the blob:none is good at.

Here is the size difference for the following options for blueapi in terms of size

311M    /tmp/blueapi/
11M     /tmp/blueapi-blob-none/ # --filter=blob:none
6.9M    /tmp/blueapi-tree-0/ # --filter=tree:0

And for dodal much bigger improvement

585M    /tmp/dodal/
33M     /tmp/dodal-blob-none/ #--filter=blob:none
9.8M    /tmp/dodal-tree-0/ # --filter=tree:0

To clone dodal without any options takes 1m35s

This is a better approach and will definetly improve the time required for the initContainer to start

Acceptance Criteria

  • InitContainer start time with large git repositories significantly faster than before

Metadata

Metadata

Assignees

No one assigned

    Labels

    deploymentStuff related to running in production container

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions