-
Notifications
You must be signed in to change notification settings - Fork 17
[docker] Remove cached git repositories from docker image #179
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
[docker] Remove cached git repositories from docker image #179
Conversation
swift-kim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In previous PR (#176 ), the build docker image had some cached
.gitdirectories forgclient synctime shortening, which was not a great help because of increasing download time of the docker image. 😢
Why does caching the directories increase the image downloading time? As far as I understand they are fake git directories and supposed to be small in size.
| # After `gclient sync`, the mtime of all synchronized files will be changed | ||
| # to newer than the cached out files. Therefore, this script changes the mtime | ||
| # of all files to OLD time and changes only the mtime of the changed files | ||
| # to NEW time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this matter?
Actually the overall workflow is not very intuitive for me. For what do you restore mtimes and save checksums of files? Are both gclient-reduce-deps and gclient-fast-sync required and should they be separate files? (As far as I understand the both exist for the same reason: reducing the gclient sync time.) Why do you run gclient sync -v --no-history --shallow after gclient-fast-sync? (Isn't gclient-fast-sync supposed to replace gclient sync, assuming from its name?) Why is gclient-fast-sync.py alone a python script while other tools are written in shell script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The reason for
restoring mtimesis for the incremental build. Aftergclient sync, the mtime of all synchronized files will be changed to newer than the cached out files. So ninja build will try to clean build always. to solve this problem, this script changes the mtime of all files to OLD time except new changed files. - Yes, those scripts can be one. But I was difficult to set the name of that script....
- Please see the test workflow file: https://github.com/WonyoungChoi/engine/blob/citest/.github/workflows/build.yml.
- name: gclient sync
run: |
gclient-reduce-deps
gclient-fast-sync
gclient sync -v --no-history --shallowgclient-fast-sync.pyscript uses some python classes of thedepot-toolsto parse DEPS file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about gclient-prepare-sync for the merged one. looks like..
- name: gclient sync
run: |
gclient-prepare-sync --reduce-deps --shallow-sync
gclient sync -v --no-history --shallow
In previous PR (#176 ), the cached .git directories are about dart, dart's third parties and skia. that was about 2GB size. |
939cdba to
24915f6
Compare
Use scripts newly added to improve the sync performance.
24915f6 to
14fb6c8
Compare
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
* [docker] Remove cached git repositories from docker image Use scripts newly added to improve the sync performance. * Fix format
Use scripts newly added to improve the sync performance.
Use scripts newly added to improve the sync performance.
Use
gclient-prepare-syncscript newly added instead of the.gitcached directory for reducinggclient synctime.In previous PR (#176 ), the build docker image had some cached
.gitdirectories forgclient synctime shortening, which was not a great help because of increasing download time of the docker image. 😢Therefore, I offer a new method.
tizen-toolsimage.gclient-prepare-syncscript to shortengclient-synctime. Thegclient syncdownloads overly many objects to perform builds, even if the--no-historyoption is used. This script downloads only single commit required for the build to shorten the overallgclient synctime.Test result: https://github.com/WonyoungChoi/engine/actions/runs/1197699330
Test worklfow: https://github.com/WonyoungChoi/engine/blob/citest/.github/workflows/build.yml
the sample build workflow: