tvl-depot/ops/pipelines
sterni 17d78867bb feat(ops/pipelines/depot): only evaluate once if possible
We currently evaluate every target twice -- once when the depot pipeline
is built and once when actually running the build step in question. Nix
evaluation is quite slow especially given heavy use of import from
derivation in depot, so avoiding the second evaluation is desireable.

Evaluating a derivation yields a `drv` file in the nix store which can
be passed to `nix-store --realise` in order to build it eliminating the
need to wait for evaluation. We can obtain the path to the `drv` file
while building the pipeline via `target.drvPath` and remember it for the
build later.

However we need to work around a flaw (or oversight) in Nix's dependency
tracking via string context: This is based on derivations, not output
path (because this is what evaluation deals with, likely). This is no
problem per se, but an issue is that Nix can't express a dependency on
a `drv` file without any of its output paths. This means for us that we
either have to build all output paths at evaluation time (which we don't
want, obviously) or to deal with the fact that the `drv` file we need
may be garbage collected at any moment after discarding the string
context -- then nix is unable to track the reference from the pipeline
to the `drv` file in the store.

So to prevent a race condition between the pipeline and the garbage
collector we fall back to the normal nix-build invocation as we did
before.

Change-Id: I9ef8bd233085dc6e30eba54f403ea03ac2d35748
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3426
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-08-26 15:24:33 +00:00
..
depot.nix feat(ops/pipelines/depot): only evaluate once if possible 2021-08-26 15:24:33 +00:00
fallback.yaml feat(ops/pipelines): Add a fallback Buildkite configuration 2020-11-17 22:33:11 +00:00
README.md docs: Update README for the repository itself 2020-08-17 21:52:58 +00:00
static-pipeline.yaml fix(ops/piplines/static-pipeline): add --show-trace to nix-build 2021-01-30 09:02:09 +00:00

This folder contains the dynamic configuration for our Buildkite CI setup.

The configuration is built and dynamically loaded by Buildkite at the start of each CI pipeline.