How does repo init --reference actually help reduce the build space.

43 views
Skip to first unread message

anish anil

unread,
Nov 24, 2021, 2:30:37 PM11/24/21
to Android Building
Hello Experts,

We are working on Android-S and saw that each CI user uses nearly 385 GB of space on there local FS,  when doing a "repo init " and repo Sync" operation. we wanted to optimize the storage and the network speed and as per the man pages we observed that this can be achieved using the --reference command.

As per the documentation:

*************
The --reference option can be used to point to a directory that has the content of a --mirror sync. This will make the working directory use as much data as possible from the local reference directory when fetching from the server. This will make the sync go a lot faster by reducing data traffic on the network.
*************

First Clone:

We followed the steps and created the first reference copy and saw that the initial space occupied was close to 385 GB.

User-1
The first user now did a repo init and repo sync and we saw the total time for this activity was only 23 minutes but it also reduced the size considerably to 63 GB.

user-2
The second user now did a repo init and repo sync and we saw the total time for this activity was only 23 minutes and it also reduced the size to 63 GB.

I do see the network performance improvement but wondering how the actual size moved from 385 GB to 63 GB and what is actually there in the 63 GB and what is the real concept behind the reference option WRT the space reduction.

Command used:

********
export Mirror="/data/Android-s"

repo init -u ssh://$US...@android1.test.com:29418/android/manifest -b tmainline -m t-r-mainline.xml --repo-url=ssh://android1.test.com:29418/android1/repo --repo-branch=test-stable --no-repo-verify --reference=$Mirror

********
Any leads or documentation around it is really helpful on how the space is getting crunched and if this can also lead to any issues during the build and any precautions to be taken during this command operation.

Thank you,
Anish
Reply all
Reply to author
Forward
0 new messages