The channel scripts hit into NixOS/nixos-org-configurations#212
sometimes when fetching ISOs from cache.nixos.org to copy to the
channels bucket. This makes runs take hours when they should take
minutes.
There is no benefit gained from going through cache.nixos.org for this
use case. As noticed by @K900, the .iso nar.xz files on the cache are
unlikely to be touched by anyone other than the channel scripts, so we
don't even end up pre-warming the cache or anything along those lines -
if anything, we just waste cache bytes that could be used by other
paths.
Fixes#67.
This is much, MUCH faster than the existing solution, especially on large channels.
It can be made even faster if we actually reuse anything whatsoever, but this is
a massive improvement in itself.
This allows to override the default TTL on Fastly. Let it know what
these objects should be refreshed more often.
FixesNixOS/nixos-org-configurations#169
Passing a list of parameters to `system` automatically gives us peace of
mind with regards to shell escaping. This is because it will not rely on
a shell invocation to run the given parameters, but directly exec to it.
The left-over shell invocations all use redirection.
They are thin wrappers over `system`, but two main points:
* They log the (unescaped) command.
* `run` will auto-die.
This removes the need to pepper `== 0 or die` in the script.
Resolving the values and being fancy is harder than the actual benefits
would give out.
Return all the info we have, and let the pager'd person deal with the
data.
A more durable solution would likely be to make a generic function that
wraps backticks and fails when $? is non-zero, rather than doing it
in-situ. There are other backtick uses that may be problematic
Prometheus now has a configured alert if an update job fails for a
while. Going back in time is not so unusual:
1. a hydra evaluation completes with some failed jobs
2. the channel advances to this commit
3. an admin restarts a failed job
4. the channel would go backward because the evaluation is complete
Since it is not a problem, make it a non-problematic exit code.
PRs to NixOS are a bit confused about if they should PR to release-* or nixos-* or nixpkgs-*. I think namespacing the refs will go a long way in making it more obvious.