It'd be useful to know how long it's taking on your environment to compress
with your not-so-fast VM.
Hi. I applied the attached patch and then looked at the build logs.
For the 18 affected packages, using AWS machines with 2 CPUs,
where I already measured that the failure happens more often
than on machines with 1 CPU, these are the averages:
COLLECTSTATIC TIME: 0.9 seconds
COMPRESS TIME: 5.1 seconds
I applaud that you want to find the "right fix" for this.
I would like too, but we should also consider the cost/benefit ratio.
In this case, I have already paid most of the cost, with my own time
doing tests, and I think that's not fair.
I think we should be realistic.
My dream would be to be able to build the whole archive
(let's say the 37000 packages in trixie) with a total number
of build failures which is closer to 0 than to 1.
Currently that's just a dream, because the "total number
of build failures" is actually a random variable, which
depends in turn on all the packages which ftbfs randomly,
each with a different probability.
For my dream to become true, we would have to ensure that
all packages ftbfs with a probability less than 1/(2*37000).
Then the expected number of build failures would be closer
to 0 than to 1.
The last proposed patch reduces the probability of
failure in 18 packages from 0.05 to 0.05 to the power of 5,
i.e. something in the order of 0.0000003.
Considering that there are some packages out there
which ftbfs randomly with a probability of 10% or 20%,
I hope you will understand why I feel that trying to find
the perfect fix for this is a waste of time,
both for you and for me.
So please, consider the last proposed patch.
We can still try to find the root cause *after* that,
at least in theory (well, not that I'm highly motivated
to continue given the circumstances), but first and foremost,
packages should build reliably, and this has been a
real pain for me for too much time already.
As an example, when I tested the attached patch to
determine the compress time, one of the packages
failed to build again, and I had to retrigger the
build again for that particular package to have
complete data for the average compress times.
Thanks.
--- a/debian/openstack-dashboard.postinst
+++ b/debian/openstack-dashboard.postinst
@@ -9,8 +9,13 @@ rebuild_static() {
# Compress the JS and CSS with python-compressor and python-lesscpy
if [ -x /usr/share/openstack-dashboard/manage.py ] ; then
+ T1=$(date +%s)
/usr/share/openstack-dashboard/manage.py collectstatic
--noinput --clear
+ T2=$(date +%s)
/usr/share/openstack-dashboard/manage.py compress --force
+ T3=$(date +%s)
+ echo COLLECTSTATIC TIME: $((${T2}-${T1}))
+ echo COMPRESS TIME: $((${T3}-${T2}))
fi
if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ];
then