-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
4,454 additions
and
5,214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
pull_request_target: | ||
paths: | ||
- 'shell.nix' | ||
- './ci/**' | ||
- 'ci/**' | ||
|
||
permissions: {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"packageVersion": "132.0.2-1", | ||
"packageVersion": "133.0-1", | ||
"source": { | ||
"rev": "132.0.2-1", | ||
"sha256": "7DB0QSQHNRw991yRR5+/Oo4fpXCR/Zklxb7ILRIH0WM=" | ||
"rev": "133.0-1", | ||
"sha256": "1xf7gx3xm3c7dhch9gwpb0xp11lcyim1nrbm8sjljxdcs7iq9jy4" | ||
}, | ||
"firefox": { | ||
"version": "132.0.2", | ||
"sha512": "nqldn7GpQaxaW1DaZ+Ik88z4xAHybLYbt0rX9OHocG1GnEtjJXFPLLnN9QwycQN31ryhjdZbVdssOe8rJ6V/rg==" | ||
"version": "133.0", | ||
"sha512": "b16f9898bee4121914caef48d4f7f44bf9d69aee168586b02bf1b4f4197844fd10179e1b63b273f52929fb348030df36328f24993cd666969da4ddc82562a90c" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
coreutils, | ||
flattenReferencesGraph, | ||
lib, | ||
jq, | ||
runCommand, | ||
}: | ||
{ | ||
closureRoots, | ||
excludePaths ? [ ], | ||
# This could be a path to (or a derivation producing a path to) | ||
# a json file containing the pipeline | ||
pipeline ? [ ], | ||
debug ? false, | ||
}: | ||
if closureRoots == [ ] then | ||
builtins.toFile "docker-layers-empty" "[]" | ||
else | ||
runCommand "docker-layers" | ||
{ | ||
__structuredAttrs = true; | ||
# graph, exclude_paths and pipeline are expected by the | ||
# flatten_references_graph executable. | ||
exportReferencesGraph.graph = closureRoots; | ||
exclude_paths = excludePaths; | ||
inherit pipeline; | ||
nativeBuildInputs = [ | ||
coreutils | ||
flattenReferencesGraph | ||
jq | ||
]; | ||
} | ||
'' | ||
. .attrs.sh | ||
flatten_references_graph_arg=.attrs.json | ||
echo "pipeline: $pipeline" | ||
if jq -e '.pipeline | type == "string"' .attrs.json; then | ||
jq '. + { "pipeline": $pipeline[0] }' \ | ||
--slurpfile pipeline "$pipeline" \ | ||
.attrs.json > flatten_references_graph_arg.json | ||
flatten_references_graph_arg=flatten_references_graph_arg.json | ||
fi | ||
${lib.optionalString debug "export DEBUG=True"} | ||
flatten_references_graph "$flatten_references_graph_arg" > ''${outputs[out]} | ||
'' |
34 changes: 34 additions & 0 deletions
34
pkgs/build-support/docker/popularity-contest-layering-pipeline.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
lib, | ||
runCommand, | ||
jq, | ||
}: | ||
{ | ||
maxLayers, | ||
fromImage ? null, | ||
}: | ||
runCommand "popularity-contest-layering-pipeline.json" { inherit maxLayers; } '' | ||
# Compute the number of layers that are already used by a potential | ||
# 'fromImage' as well as the customization layer. Ensure that there is | ||
# still at least one layer available to store the image contents. | ||
# one layer will be taken up by the customisation layer | ||
usedLayers=1 | ||
${lib.optionalString (fromImage != null) '' | ||
# subtract number of base image layers | ||
baseImageLayersCount=$(tar -xOf "${fromImage}" manifest.json | ${lib.getExe jq} '.[0].Layers | length') | ||
(( usedLayers += baseImageLayersCount )) | ||
''} | ||
if ! (( $usedLayers < $maxLayers )); then | ||
echo >&2 "Error: usedLayers $usedLayers layers to store 'fromImage' and" \ | ||
"'extraCommands', but only maxLayers=$maxLayers were" \ | ||
"allowed. At least 1 layer is required to store contents." | ||
exit 1 | ||
fi | ||
availableLayers=$(( maxLayers - usedLayers )) | ||
# Produce pipeline which uses popularity_contest algo. | ||
echo '[["popularity_contest"],["limit_layers",'$availableLayers']]' > $out | ||
'' |
Oops, something went wrong.