I am having a task and I’d like to find out, what slows it down. Actually I have a suspect, but log output does not help to confirm that. My actual work in the task takes 2m30 to run, but toe overall task needs much more time, and the overall job takes 1h46m.
What I found out so far is, that it took 1h30m from the last log entry of task execution until it was finally marked with a green tick. Meanwhile there was a cp process running in the container.
My suspect is, that I have used caches in my task, which are quite big (30GB). Its the build directory of an embedded linux, which does cross compiling. Without the cache the task needs 2h to complete by itself. With the cache its really fast.
Unfortunately I did not find much documentation about the details of the caches. Do they really need to be copied or are they just mounted? What else could that long-running copy command be? (Hint: the last copy command of my script copies an embedded linux image, which is approximately 250 MB in size).
Here are my build scripts for reference:
platform: linux image_resource: type: docker-image source: repository: docker-reg:5000/yocto-build-environment insecure_registries: [ "docker-reg:5000" ] inputs: - name: twms-yocto-base - name: twms-yocto-base-prepared caches: - path: work/build/cache - path: work/build/downloads - path: work/build/sstate-cache - path: work/build/tmp outputs: - name: twms-segin run: dir: twms-yocto-base path: ci/tasks/build-for-segin.sh
#!/usr/bin/env bash set -e set -u set -x mkdir -p ../work chown ci:ci ../work cd ../work chown ci:ci ./build || : chown ci:ci ./build/* || : rm ./work/build/tmp/deploy/images -rf sudo -u ci tar -x --no-same-owner -f ../twms-yocto-base-prepared/twms-yocto-base-prepared.tar # call the script in the root directory sudo -u ci ./build-for-segin.sh cp -r build/tmp/deploy/images ../twms-segin/