Open mfocko opened 2 months ago
Since this has been caught as part of the
run_copr_build_handler
, we do not need the full history
We are cloning the repo there only to get the config, right? Then making a shallow clone makes complete sense, I just don't think passing --tags
is necessary (it would pull only the tags pointing to the cloned commit anyway).
There is also another option, treeless clone:
$ git clone -v --tags --filter=tree:0 -- https://github.com/systemd/systemd.git
Cloning into 'systemd'...
POST git-upload-pack (175 bytes)
POST git-upload-pack (gzip 19369 to 9522 bytes)
remote: Enumerating objects: 77751, done.
remote: Counting objects: 100% (183/183), done.
remote: Compressing objects: 100% (183/183), done.
remote: Total 77751 (delta 1), reused 86 (delta 0), pack-reused 77568
Receiving objects: 100% (77751/77751), 23.53 MiB | 19.67 MiB/s, done.
Resolving deltas: 100% (492/492), done.
remote: Enumerating objects: 467, done.
remote: Counting objects: 100% (185/185), done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 467 (delta 7), reused 70 (delta 4), pack-reused 282
Receiving objects: 100% (467/467), 197.63 KiB | 1.69 MiB/s, done.
Resolving deltas: 100% (8/8), done.
remote: Enumerating objects: 5915, done.
remote: Counting objects: 100% (4053/4053), done.
remote: Compressing objects: 100% (3445/3445), done.
remote: Total 5915 (delta 1099), reused 708 (delta 605), pack-reused 1862
Receiving objects: 100% (5915/5915), 15.88 MiB | 11.78 MiB/s, done.
Resolving deltas: 100% (1380/1380), done.
Updating files: 100% (6130/6130), done.
That's about 39 MiB in total and it could in theory work in place of full clones.
A config option with a default to clone just the last commit might be a good approach.
We are cloning the repo there only to get the config, right?
That's actually not true, we are getting the config via API earlier. The cloning happens anytime LocalProject
is initialised, so there is room for improvement as well (probably related to #1955, EDIT: also https://github.com/packit/packit/issues/1581).
Description
During the problems with our queue on Monday, it's been discovered that the last executed command in both of our
long-running
workers has been (or replace with different repository):Given the size of the systemd repository from the example and its presence in both of the workers, it is suspected that the clone of the large repository resulted in the queue being “choked” by cloning large repository in the workers.
Since this has been caught as part of the
run_copr_build_handler
, we do not need the full history, it will be cloned for the build (and potential user-specified actions) in Copr build environment anyways.TODO
--depth=1
sync-release
anduptream-koji-build
Sizes of repository
Current command »218 MiB«
Only cloning the latest commit »16 MiB«