Unverified Commit 2042665b authored by Wael Nasreddine's avatar Wael Nasreddine Committed by GitHub
Browse files

ncps: 0.7.3 -> 0.8.2 (#485524)

parents 58060645 e9294bec
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -163,25 +163,6 @@ in

  testScript =
    { nodes, ... }:
    let
      narinfoName =
        (lib.strings.removePrefix "/nix/store/" (
          lib.strings.removeSuffix "-empty-file" pkgs.emptyFile.outPath
        ))
        + ".narinfo";

      narinfoNameChars = lib.strings.stringToCharacters narinfoName;

      narinfoPath = lib.concatStringsSep "/" [
        (builtins.head nodes.minio.services.minio.dataDir)
        bucket
        "store/narinfo"
        (lib.lists.elemAt narinfoNameChars 0)
        ((lib.lists.elemAt narinfoNameChars 0) + (lib.lists.elemAt narinfoNameChars 1))
        narinfoName
        "xl.meta"
      ];
    in
    ''
      harmonia.start()
      minio.start()
@@ -206,13 +187,5 @@ in

      client0.wait_until_succeeds("curl -f http://ncps0:8501/ | grep '\"hostname\":\"${toString nodes.ncps0.services.ncps.cache.hostName}\"' >&2")
      client1.wait_until_succeeds("curl -f http://ncps1:8501/ | grep '\"hostname\":\"${toString nodes.ncps1.services.ncps.cache.hostName}\"' >&2")

      client0.succeed("cat /etc/nix/nix.conf >&2")
      client0.succeed("nix-store --realise ${pkgs.emptyFile}")

      client1.succeed("cat /etc/nix/nix.conf >&2")
      client1.succeed("nix-store --realise ${pkgs.emptyFile}")

      minio.succeed("cat ${narinfoPath} >&2")
    '';
}
+0 −27
Original line number Diff line number Diff line
@@ -145,25 +145,6 @@ in

  testScript =
    { nodes, ... }:
    let
      narinfoName =
        (lib.strings.removePrefix "/nix/store/" (
          lib.strings.removeSuffix "-empty-file" pkgs.emptyFile.outPath
        ))
        + ".narinfo";

      narinfoNameChars = lib.strings.stringToCharacters narinfoName;

      narinfoPath = lib.concatStringsSep "/" [
        (builtins.head nodes.minio.services.minio.dataDir)
        bucket
        "store/narinfo"
        (lib.lists.elemAt narinfoNameChars 0)
        ((lib.lists.elemAt narinfoNameChars 0) + (lib.lists.elemAt narinfoNameChars 1))
        narinfoName
        "xl.meta"
      ];
    in
    ''
      harmonia.start()
      minio.start()
@@ -184,13 +165,5 @@ in

      client0.wait_until_succeeds("curl -f http://ncps0:8501/ | grep '\"hostname\":\"${toString nodes.ncps0.services.ncps.cache.hostName}\"' >&2")
      client1.wait_until_succeeds("curl -f http://ncps1:8501/ | grep '\"hostname\":\"${toString nodes.ncps1.services.ncps.cache.hostName}\"' >&2")

      client0.succeed("cat /etc/nix/nix.conf >&2")
      client0.succeed("nix-store --realise ${pkgs.emptyFile}")

      client1.succeed("cat /etc/nix/nix.conf >&2")
      client1.succeed("nix-store --realise ${pkgs.emptyFile}")

      minio.succeed("cat ${narinfoPath} >&2")
    '';
}
+4 −18
Original line number Diff line number Diff line
@@ -63,23 +63,6 @@

  testScript =
    { nodes, ... }:
    let
      narinfoName =
        (lib.strings.removePrefix "/nix/store/" (
          lib.strings.removeSuffix "-empty-file" pkgs.emptyFile.outPath
        ))
        + ".narinfo";

      narinfoNameChars = lib.strings.stringToCharacters narinfoName;

      narinfoPath = lib.concatStringsSep "/" [
        nodes.ncps.services.ncps.cache.storage.local
        "store/narinfo"
        (lib.lists.elemAt narinfoNameChars 0)
        ((lib.lists.elemAt narinfoNameChars 0) + (lib.lists.elemAt narinfoNameChars 1))
        narinfoName
      ];
    in
    ''
      start_all()

@@ -92,6 +75,9 @@
      client.succeed("cat /etc/nix/nix.conf >&2")
      client.succeed("nix-store --realise ${pkgs.emptyFile}")

      ncps.succeed("cat ${narinfoPath} >&2")
      # Verify that the NAR file exists in the cache storage
      # We query the NAR hash from the client and then check if a file with that hash exists in the ncps storage
      nar_hash = client.succeed("nix-store -q --hash ${pkgs.emptyFile}").strip().split(":")[1]
      ncps.succeed(f"find ${nodes.ncps.services.ncps.cache.storage.local} -type f | grep {nar_hash}")
    '';
}
+3 −3
Original line number Diff line number Diff line
@@ -33,16 +33,16 @@ let

  finalAttrs = {
    pname = "ncps";
    version = "0.7.3";
    version = "0.8.2";

    src = fetchFromGitHub {
      owner = "kalbasit";
      repo = "ncps";
      tag = "v${finalAttrs.version}";
      hash = "sha256-6mpEe0i5NYQb5WK2/478VFkMNa6xqAIU1uwwhH2zc2M=";
      hash = "sha256-1VWEN1HYV52H/LCfAvFv3R9DxQbHNRnyay3p2BY8dCg=";
    };

    vendorHash = "sha256-nnt4HIG4Fs7RhHjVb7mYJ39UgvFKc46Cu42cURMmr1s=";
    vendorHash = "sha256-AcgC+zTS3eVsbcs0jim4zDBGc3lIjwPbdVT7/KQ9Lkc=";

    ldflags = [
      "-X github.com/kalbasit/ncps/pkg/ncps.Version=v${finalAttrs.version}"