Test running tasks in create-traballs.sh script in parallel, 4 at a time
I am running at test on colchicifolium where I execute task in the create-tarballs script in parallel, 4 at a time.
I am testing how much time we can save with the overall execution and if we will use give or take the same resources (monitoring: https://grafana1.torproject.org/d/Z7T7Cfemz/node-exporter-full?orgId=1&var-job=node&var-node=colchicifolium.torproject.org&var-port=9100)
Merge request reports
Activity
assigned to @hiro
mentioned in issue #40024 (closed)
114 echo `date` "Creating symlink for" ${TARBALLS[$i]} 114 echo `date` "Creating symlink for" ${TARBALLS[$i]} 115 115 ln -s ${DIRECTORIES[$i]} ${TARBALLS[$i]} 116 116 else 117 117 # This is a workaround for the "tar u" bug in GNU tar 1.20 118 echo `date` "Touching symlink and directories for" ${TARBALLS[$i]} 118 echo `date` "Touching symlink and directories for" ${TARBALLS[$i]} 119 119 find -L ${TARBALLS[$i]} -type d | xargs touch 120 120 fi 121 121 done 122 122 123 N=4 123 124 for (( i = 0 ; i < ${#TARBALLS[@]} ; i++ )); do 124 echo `date` "Creating" ${TARBALLS[$i]}'.tar.xz' 125 tar -I "xz -9e" -c -h -f ${TARBALLS[$i]}.tar.xz ${TARBALLS[$i]} 125 ((j=j%N)); ((j++==0)) && wait i think i understand what this does, but a comment would certainly not hurt here.
also: have you considered just rewriting this entire thing in a sane programming language as opposed to a scripting language like bash?
i have this mental boundary that when i start doing arithmetic, parallel processing, or when i cross 100 lines, i rewrite my program in python (used to be perl, now it's python, but you might prefer golang or rust, whatever...)
mentioned in commit a285fbca
mentioned in issue tpo/tpa/team#40650 (closed)