fc-queue-runner: store build outputs in normalized table
Replaces JSON blob storage with BuildOutput records and parse derivation outputs after successful build, then INSERT into `build_outputs` per output. Warnings are logged on storage failures, but it's not fatal. - Parse derivation outputs after successful build - INSERT into build_outputs table per output - Log warnings on storage failures (non-fatal) Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I30120a5ee4aea1bdb170987b22ddc2df6a6a6964
This commit is contained in:
parent
959aba0933
commit
ec28069b69
1 changed files with 26 additions and 0 deletions
|
|
@ -596,6 +596,32 @@ async fn run_build(
|
||||||
.map(|obj| obj.keys().cloned().collect())
|
.map(|obj| obj.keys().cloned().collect())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
// Store build outputs in normalized table
|
||||||
|
for (i, output_path) in build_result.output_paths.iter().enumerate() {
|
||||||
|
let output_name = output_names.get(i).cloned().unwrap_or_else(|| {
|
||||||
|
if i == 0 {
|
||||||
|
"out".to_string()
|
||||||
|
} else {
|
||||||
|
format!("out{i}")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if let Err(e) = repo::build_outputs::create(
|
||||||
|
pool,
|
||||||
|
build.id,
|
||||||
|
&output_name,
|
||||||
|
Some(output_path),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
tracing::warn!(
|
||||||
|
build_id = %build.id,
|
||||||
|
output_name = %output_name,
|
||||||
|
"Failed to store build output: {e}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Register GC roots and create build products for each output
|
// Register GC roots and create build products for each output
|
||||||
for (i, output_path) in build_result.output_paths.iter().enumerate() {
|
for (i, output_path) in build_result.output_paths.iter().enumerate() {
|
||||||
let output_name = output_names.get(i).cloned().unwrap_or_else(|| {
|
let output_name = output_names.get(i).cloned().unwrap_or_else(|| {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue