From 228706acb600ab1bf5ddc1e739685f336b82ac5f Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:01:15 +0100 Subject: [PATCH 1/5] docker-distribution: 2.8.3 -> 3.0.0-alpha.1 --- .../virtualization/docker/distribution.nix | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/virtualization/docker/distribution.nix b/pkgs/applications/virtualization/docker/distribution.nix index 1a22aa0fafbf..68e637cd1e45 100644 --- a/pkgs/applications/virtualization/docker/distribution.nix +++ b/pkgs/applications/virtualization/docker/distribution.nix @@ -1,19 +1,43 @@ -{ lib, buildGoPackage, fetchFromGitHub }: +{ lib +, buildGoModule +, fetchFromGitHub +, fetchpatch +}: -buildGoPackage rec { +buildGoModule rec { pname = "distribution"; - version = "2.8.3"; - rev = "v${version}"; - - goPackagePath = "github.com/docker/distribution"; + version = "3.0.0-alpha.1"; src = fetchFromGitHub { owner = "docker"; repo = "distribution"; - inherit rev; - sha256 = "sha256-6/clOTkI1JnDjb+crcHmjbQlaqffP/sntGqUB2ftajU="; + rev = "v${version}"; + hash = "sha256-reguAtBkEC9OMUTdCtFY6l0fkk28VoA0IlPcQ0sz84I="; }; + patches = [ + # fix: load gcs credentials and client inside DriverConstructor + # Needed to pass the tests. Remove with next update. + (fetchpatch { + url = "https://github.com/distribution/distribution/commit/14366a2dff6a8f595e39d258085381731b43cec6.diff"; + hash = "sha256-0ns9JuIeLBzRLMVxY6uaWTIYcRRbuwQ+n9tmK+Pvf4U="; + }) + # fix: add missing skip in s3 driver test + # Needed to pass the tests. Remove with next update. + (fetchpatch { + url = "https://github.com/distribution/distribution/commit/6908e0d5facd31ed32046df03a09040c964be0b3.patch"; + hash = "sha256-ww+BwBGw+dkZ2FhVzynehR+sNYCgq8/KkPDP9ac6NWg="; + }) + ]; + + vendorHash = null; + + checkFlags = [ + # TestHTTPChecker: requires internet access. + # TestInMemoryDriverSuite: timeout after 10 minutes, looks like a deadlock. + "-skip=^TestHTTPChecker$|^TestInMemoryDriverSuite$" + ]; + meta = with lib; { description = "Docker toolset to pack, ship, store, and deliver content"; license = licenses.asl20; From 4b74b465e4abd403ab3c66e428050ff2ab404686 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:14:40 +0100 Subject: [PATCH 2/5] docker-distribution: rename to distribution --- .../distribution.nix => by-name/di/distribution/package.nix} | 0 pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 1 insertion(+), 2 deletions(-) rename pkgs/{applications/virtualization/docker/distribution.nix => by-name/di/distribution/package.nix} (100%) diff --git a/pkgs/applications/virtualization/docker/distribution.nix b/pkgs/by-name/di/distribution/package.nix similarity index 100% rename from pkgs/applications/virtualization/docker/distribution.nix rename to pkgs/by-name/di/distribution/package.nix diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 49918da44dba..f02b082dc15c 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -261,6 +261,7 @@ mapAliases ({ dhcp = throw "dhcp (ISC DHCP) has been removed from nixpkgs, because it reached its end of life"; # Added 2023-04-04 dibbler = throw "dibbler was removed because it is not maintained anymore"; # Added 2024-05-14 dnnl = oneDNN; # Added 2020-04-22 + docker-distribution = distribution; # Added 2023-12-26 docker-machine = throw "'docker-machine' has been removed, because the upstream project was archived"; # Added 2023-12-27 docker-machine-kvm = throw "'docker-machine-kvm' has been removed, because 'docker-machine' was archived upstream and removed"; # Added 2023-12-27 docker-machine-xhyve = throw "'docker-machine-xhyve' has been removed, because 'docker-machine' was archived upstream and removed"; # Added 2023-12-27 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 38c65b8f36c0..0e188b67e203 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30237,8 +30237,6 @@ with pkgs; docker-machine-hyperkit = callPackage ../applications/networking/cluster/docker-machine/hyperkit.nix { }; docker-machine-kvm2 = callPackage ../applications/networking/cluster/docker-machine/kvm2.nix { }; - docker-distribution = callPackage ../applications/virtualization/docker/distribution.nix { }; - dockfmt = callPackage ../development/tools/dockfmt { }; afterburn = callPackage ../tools/admin/afterburn { }; From 77a81b7c8c870428897f5b765e40fa50f2263c59 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:20:18 +0100 Subject: [PATCH 3/5] distribution: update repo owner and meta --- pkgs/by-name/di/distribution/package.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/di/distribution/package.nix b/pkgs/by-name/di/distribution/package.nix index 68e637cd1e45..64c04ebaefdb 100644 --- a/pkgs/by-name/di/distribution/package.nix +++ b/pkgs/by-name/di/distribution/package.nix @@ -9,7 +9,7 @@ buildGoModule rec { version = "3.0.0-alpha.1"; src = fetchFromGitHub { - owner = "docker"; + owner = "distribution"; repo = "distribution"; rev = "v${version}"; hash = "sha256-reguAtBkEC9OMUTdCtFY6l0fkk28VoA0IlPcQ0sz84I="; @@ -39,9 +39,18 @@ buildGoModule rec { ]; meta = with lib; { - description = "Docker toolset to pack, ship, store, and deliver content"; + description = "Toolkit to pack, ship, store, and deliver container content"; + longDescription = '' + Distribution is a Open Source Registry implementation for storing and distributing container + images and other content using the OCI Distribution Specification. The goal of this project + is to provide a simple, secure, and scalable base for building a large scale registry solution + or running a simple private registry. + ''; + homepage = "https://distribution.github.io/distribution/"; + changelog = "https://github.com/distribution/distribution/releases/tag/v${version}"; license = licenses.asl20; - maintainers = []; + maintainers = [ ]; + mainProgram = "registry"; platforms = platforms.unix; }; } From 66c729f19141027233b320617b22f6ddb53900b2 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:24:29 +0100 Subject: [PATCH 4/5] distribution: add version test --- pkgs/by-name/di/distribution/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/di/distribution/package.nix b/pkgs/by-name/di/distribution/package.nix index 64c04ebaefdb..9ade1080e3e2 100644 --- a/pkgs/by-name/di/distribution/package.nix +++ b/pkgs/by-name/di/distribution/package.nix @@ -2,6 +2,8 @@ , buildGoModule , fetchFromGitHub , fetchpatch +, testers +, distribution }: buildGoModule rec { @@ -38,6 +40,13 @@ buildGoModule rec { "-skip=^TestHTTPChecker$|^TestInMemoryDriverSuite$" ]; + passthru = { + tests.version = testers.testVersion { + package = distribution; + version = "v${version}"; + }; + }; + meta = with lib; { description = "Toolkit to pack, ship, store, and deliver container content"; longDescription = '' From 58d8ba6d7f02a83b03ee992cb2af95784543f5d1 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:29:57 +0100 Subject: [PATCH 5/5] distribution: add update script --- pkgs/by-name/di/distribution/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/di/distribution/package.nix b/pkgs/by-name/di/distribution/package.nix index 9ade1080e3e2..9da917b51218 100644 --- a/pkgs/by-name/di/distribution/package.nix +++ b/pkgs/by-name/di/distribution/package.nix @@ -2,6 +2,7 @@ , buildGoModule , fetchFromGitHub , fetchpatch +, nix-update-script , testers , distribution }: @@ -45,6 +46,7 @@ buildGoModule rec { package = distribution; version = "v${version}"; }; + updateScript = nix-update-script { }; }; meta = with lib; {