Ahmed Baha Eddine Alimi - B23-SD-01 [Lab18 + Bonus Task]#3284
Open
3llimi wants to merge 88 commits intoinno-devops-labs:masterfrom
Open
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab18 + Bonus Task]#32843llimi wants to merge 88 commits intoinno-devops-labs:masterfrom
3llimi wants to merge 88 commits intoinno-devops-labs:masterfrom
Conversation
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab10 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab11 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab12 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab13 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab14 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab15 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab16 + Bonus Task]
Ahmed Baha Eddine Alimi - B23-SD-01 [Lab17]
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lab 18 — Nix & Reproducible Builds
What was done:
pip install) with a fully declarative Nix-based build system, creating a custom derivation for the DevOps Info Servicepython3.withPackages, explicitly defining runtime dependencies (Flask) and ensuring isolation from system Pythonnix-build, producing a deterministic output in/nix/store/...and exposing the executable through a wrapped binarymakeWrapperto correctly configurePYTHONPATH, ensuring the application runs without relying on external environment configurationcleanSourceWith) to exclude unnecessary files (e.g.,.git, caches), reducing closure size and improving build determinismnix-buildexecutions producing identical store pathsnix-store --delete) followed by rebuild yielding the same hash<nixpkgs>caused hash drift, explaining why pinning is requiredContainerization:
dockerTools.buildLayeredImage, reusing the application derivation instead of rebuilding dependencies${app}/bin/...)created = "1970-01-01T00:00:01Z")nix-build docker.nixanddocker load, then validated runtime behavior via port mappingsha256sumof resulting images across rebuilds (identical hashes)Comparison & Analysis:
docker history) and explained differences in metadata and size tradeoffsBonus:
nixpkgsissuesflake.nixwith locked input (nixos-24.11) and reproducible outputs for both application and Docker imageflake.lockto guarantee identical builds across machines and timenix buildandnix build .#dockerImage, confirming reproducibilityOutcome: