feat(lib): add foldImageLayers helper + formatter; refresh fleet pin
Lift the nix2container reproducible=false layer-chain helper (duplicated verbatim across ii-agent, ii-researcher, temporal-based-ci, mempalace image, ComfyUI) into parity.lib.foldImageLayers so the rationale lives in one place. Add nixfmt-rfc-style formatter and a foldImageLayers contract probe to the smoke check. Bump fleet-pins input to current HEAD.
This commit is contained in:
@@ -28,9 +28,13 @@
|
||||
wrap =
|
||||
name: pkgs: args:
|
||||
(builders pkgs).${name} args;
|
||||
imageLayers = import ./lib/image-layers.nix;
|
||||
in
|
||||
{
|
||||
mkParityBuilders = builders;
|
||||
# Pkgs-independent nix2container layer-chain helper (lib/image-layers.nix):
|
||||
# parity.lib.foldImageLayers buildLayer [ { deps = …; } … ]
|
||||
inherit (imageLayers) foldImageLayers;
|
||||
mkPyPiWheelPublish = wrap "mkPyPiWheelPublish";
|
||||
mkPyPiWheelPublishMulti = wrap "mkPyPiWheelPublishMulti";
|
||||
mkS390xNpmPublish = wrap "mkS390xNpmPublish";
|
||||
@@ -60,8 +64,15 @@
|
||||
text = ''exec bash ${./ci/pipeline-doctor.sh} "$@"'';
|
||||
};
|
||||
|
||||
# Smoke check: instantiate every builder with stub args so the apps eval.
|
||||
# Smoke check: instantiate a builder with stub args so the apps eval, and
|
||||
# exercise foldImageLayers with a stub buildLayer so its contract (each
|
||||
# layer gets reproducible=false + the prior layers) can't silently break.
|
||||
builders = import ./lib/builders.nix { inherit pkgs; };
|
||||
imageLayers = import ./lib/image-layers.nix;
|
||||
layerProbe = imageLayers.foldImageLayers (c: c) [
|
||||
{ deps = [ pkgs.hello ]; }
|
||||
{ deps = [ pkgs.coreutils ]; }
|
||||
];
|
||||
smoke = pkgs.runCommand "parity-lib-smoke" { } ''
|
||||
: "${
|
||||
builtins.toString (
|
||||
@@ -74,6 +85,9 @@
|
||||
)
|
||||
)
|
||||
}"
|
||||
${lib.optionalString (
|
||||
builtins.length layerProbe != 2 || (builtins.elemAt layerProbe 1).reproducible
|
||||
) ''echo "foldImageLayers contract broken" >&2; exit 1''}
|
||||
touch $out
|
||||
'';
|
||||
in
|
||||
@@ -90,6 +104,8 @@
|
||||
};
|
||||
|
||||
checks.smoke = smoke;
|
||||
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user