summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2025-04-18 13:51:18 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2025-04-18 13:56:50 +0000
commitd560060e4c4208b0d2db023ed7c6a5e20af2c730 (patch)
treecdcd921867fc06620a8defefb8e92e63785b5ed6
parent050030c8d68194b27c3245af792b553ac6ea6b6d (diff)
downloadmeta-virtualization-d560060e4c4208b0d2db023ed7c6a5e20af2c730.tar.gz
docker-compose: limit the amount of data copied
The AWS dependency includes a VERY large set of directories, which are over 9G in size. To avoid some of this data movement, we suggest shallow clones and update our vendor rsync to exclude directories over 500M. This drastically speeds up the copy and overall build time. More investigation needs to be done, and perhaps a switch away from git clones for this recipe as the data over the network during fetch is still an issue. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/docker-compose/docker-compose_git.bb4
-rw-r--r--recipes-containers/docker-compose/relocation.inc30
2 files changed, 32 insertions, 2 deletions
diff --git a/recipes-containers/docker-compose/docker-compose_git.bb b/recipes-containers/docker-compose/docker-compose_git.bb
index e48ee9af..91ceb011 100644
--- a/recipes-containers/docker-compose/docker-compose_git.bb
+++ b/recipes-containers/docker-compose/docker-compose_git.bb
@@ -78,3 +78,7 @@ FILES:${PN} += " ${nonarch_libdir}/docker/cli-plugins/"
78 78
79INHIBIT_PACKAGE_STRIP = "1" 79INHIBIT_PACKAGE_STRIP = "1"
80INSANE_SKIP:${PN} += "ldflags already-stripped" 80INSANE_SKIP:${PN} += "ldflags already-stripped"
81
82# the AWS dependency is 8GB, try and control the
83# size of the clones
84BB_GIT_SHALLOW = "1" \ No newline at end of file
diff --git a/recipes-containers/docker-compose/relocation.inc b/recipes-containers/docker-compose/relocation.inc
index 469361ac..bb3aa599 100644
--- a/recipes-containers/docker-compose/relocation.inc
+++ b/recipes-containers/docker-compose/relocation.inc
@@ -197,13 +197,39 @@ do_compile:prepend() {
197 site_dest=$(echo $s | cut -d: -f1) 197 site_dest=$(echo $s | cut -d: -f1)
198 site_source=$(echo $s | cut -d: -f2) 198 site_source=$(echo $s | cut -d: -f2)
199 force_flag=$(echo $s | cut -d: -f3) 199 force_flag=$(echo $s | cut -d: -f3)
200
200 mkdir -p vendor.copy/$site_dest 201 mkdir -p vendor.copy/$site_dest
202
203 # create a temporary exclude file
204 exclude_file=$(mktemp)
205
206 find vendor.fetch/$site_source -type d -print0 | \
207 xargs -0 du -sBM 2>/dev/null | \
208 awk '{if ($1+0 > 500) print substr($0, index($0,$2))}' | \
209 sed 's|^vendor.fetch/||' > "$exclude_file"
210
201 if [ -n "$force_flag" ]; then 211 if [ -n "$force_flag" ]; then
202 echo "[INFO] $site_dest: force copying .go files" 212 echo "[INFO] $site_dest: force copying .go files"
203 rm -rf vendor.copy/$site_dest 213 rm -rf vendor.copy/$site_dest
204 rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest 214 rsync -a \
215 --exclude='vendor/' \
216 --exclude='.git/' \
217 --exclude-from="$exclude_file" \
218 vendor.fetch/$site_source/ vendor.copy/$site_dest
205 else 219 else
206 [ -n "$(ls -A vendor.copy/$site_dest/*.go 2> /dev/null)" ] && { echo "[INFO] vendor.fetch/$site_source -> $site_dest: go copy skipped (files present)" ; true ; } || { echo "[INFO] $site_dest: copying .go files" ; rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest ; } 220 if [ -n "$(ls -A vendor.copy/$site_dest/*.go 2> /dev/null)" ]; then
221 echo "[INFO] vendor.fetch/$site_source -> $site_dest: go copy skipped (files present)"
222 true
223 else
224 echo "[INFO] $site_dest: copying .go files"
225 rsync -a \
226 --exclude='vendor/' \
227 --exclude='.git/' \
228 --exclude-from="$exclude_file" \
229 vendor.fetch/$site_source/ vendor.copy/$site_dest
230 fi
207 fi 231 fi
232
233 rm -f "$exclude_file"
208 done 234 done
209} 235}