Merge pull request #29942 from elitak/ipfs

Ipfs: prepare for autoMigrate fix
This commit is contained in:
Franz Pletz 2017-10-04 03:07:25 +02:00 committed by GitHub
commit d6f7e2f6f6
5 changed files with 106 additions and 2 deletions

View File

@ -7,7 +7,7 @@ let
ipfsFlags = toString ([
(optionalString cfg.autoMount "--mount")
(optionalString cfg.autoMigrate "--migrate")
#(optionalString cfg.autoMigrate "--migrate")
(optionalString cfg.enableGC "--enable-gc")
(optionalString (cfg.serviceFdlimit != null) "--manage-fdlimit=false")
(optionalString (cfg.defaultMode == "offline") "--offline")
@ -36,6 +36,7 @@ let
baseService = recursiveUpdate commonEnv {
wants = [ "ipfs-init.service" ];
# NB: migration must be performed prior to pre-start, else we get the failure message!
preStart = ''
ipfs repo fsck # workaround for BUG #4212 (https://github.com/ipfs/go-ipfs/issues/4214)
ipfs --local config Addresses.API ${cfg.apiAddress}
@ -97,11 +98,17 @@ in {
description = "systemd service that is enabled by default";
};
/*
autoMigrate = mkOption {
type = types.bool;
default = false;
description = "Whether IPFS should try to migrate the file system automatically";
description = ''
Whether IPFS should try to migrate the file system automatically.
The daemon will need to be able to download a binary from https://ipfs.io to perform the migration.
'';
};
*/
autoMount = mkOption {
type = types.bool;

View File

@ -0,0 +1,27 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
name = "ipfs-migrator-${version}";
version = "6";
goPackagePath = "github.com/ipfs/fs-repo-migrations";
goDeps = ./deps.nix;
src = fetchFromGitHub {
owner = "ipfs";
repo = "fs-repo-migrations";
rev = "a89e9769b9cac25ad9ca31c7e9a4445c7966d35b";
sha256 = "0x4mbkx7wlqjmkg6852hljq947v9y9k3hjd5yfj7kka1hpvxd7bn";
};
patches = [ ./lru-repo-path-fix.patch ];
meta = with stdenv.lib; {
description = "Migration tool for ipfs repositories";
homepage = https://ipfs.io/;
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ elitak ];
};
}

View File

@ -0,0 +1,56 @@
[
{
goPackagePath = "github.com/dustin/go-humanize";
fetch = {
type = "git";
url = https://github.com/dustin/go-humanize;
rev = "79e699ccd02f240a1f1fbbdcee7e64c1c12e41aa";
sha256 = "0awfqszgjw8qrdw31v74jnvj1jbp7czhd8aq59j57yyj4hy50fzj";
};
}
{
goPackagePath = "github.com/jbenet/goprocess";
fetch = {
type = "git";
url = https://github.com/jbenet/goprocess;
rev = "b497e2f366b8624394fb2e89c10ab607bebdde0b";
sha256 = "1lnvkzki7vnqn5c4m6bigk0k85haicmg27w903kwg30rdvblm82s";
};
}
{
goPackagePath = "github.com/jbenet/go-random";
fetch = {
type = "git";
url = https://github.com/jbenet/go-random;
rev = "384f606e91f542a98e779e652eed88051618f0f7";
sha256 = "0gcshzl9n3apzc0jaxqrjsc038yfrzfyhpdqgbpcnajin83l2msa";
};
}
{
goPackagePath = "github.com/jbenet/go-random-files";
fetch = {
type = "git";
url = https://github.com/jbenet/go-random-files;
rev = "737479700b40b4b50e914e963ce8d9d44603e3c8";
sha256 = "1klpdc4qkrfy31r7qh00fcz42blswzabmcnry9byd5adhszxj9bw";
};
}
{
goPackagePath = "github.com/hashicorp/golang-lru";
fetch = {
type = "git";
url = https://github.com/hashicorp/golang-lru;
rev = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6";
sha256 = "1iq7lbpsz7ks052mpznmkf8s4k43p51z4dik2n9ivrxk666q2wxi";
};
}
{
goPackagePath = "golang.org/x/net";
fetch = {
type = "git";
url = "https://go.googlesource.com/net";
rev = "71a035914f99bb58fe82eac0f1289f10963d876c";
sha256 = "06m16c9vkwc8m2mcxcxa7p8mb26ikc810lgzd5m8k1r6lp3hc8wm";
};
}
]

View File

@ -0,0 +1,13 @@
diff --git a/ipfs-1-to-2/go-datastore/lru/datastore.go b/ipfs-1-to-2/go-datastore/lru/datastore.go
index 7eb18eb..cd8dcb7 100644
--- a/ipfs-1-to-2/go-datastore/lru/datastore.go
+++ b/ipfs-1-to-2/go-datastore/lru/datastore.go
@@ -3,7 +3,7 @@ package lru
import (
"errors"
- lru "github.com/ipfs/fs-repo-migrations/ipfs-1-to-2/golang-lru"
+ lru "github.com/hashicorp/golang-lru"
ds "github.com/ipfs/fs-repo-migrations/ipfs-1-to-2/go-datastore"
dsq "github.com/ipfs/fs-repo-migrations/ipfs-1-to-2/go-datastore/query"

View File

@ -2699,6 +2699,7 @@ with pkgs;
iperf = iperf3;
ipfs = callPackage ../applications/networking/ipfs { };
ipfs-migrator = callPackage ../applications/networking/ipfs-migrator { };
ipmitool = callPackage ../tools/system/ipmitool {
static = false;