Move GC roots to /nix/var/nix/gcroots/hydra

[?]
Dec 14, 2015, 12:31 PM
KKHVM4KAM6I5B4KZPIKCEBWRB3LNYCFD7XIH4NCPGLNSMRCGJC6AC

Dependencies

  • [2] WQXF2T3D hydra-evaluator: Don't require $HYDRA_CONFIG
  • [3] V4R3SIRM hydra-module.nix: Don't use a password
  • [4] PMDWFZHW hydra-module.nix: Fix setting the logo
  • [5] G2RULGMM hydra-module: add config.extraEnv
  • [6] TJK27WSB Open the DB using Hydra::Model::DB->new
  • [7] F5RYSE7T qualify order by column
  • [8] AFTXA575 * $HYDRA_DATA environment variable.
  • [9] LZO3C2KI * Hack around those SQLite timeouts: just retry the transaction.
  • [10] RBGYFVWX use HYDRA_DATA/hydra.conf as default location for hydra.conf
  • [11] A63IHCMX * Register GC roots properly.
  • [12] W3HI52QV use NIX_*_DIR env vars when defined
  • [13] 2T42QGZD * Register builds as GC roots so they don't get deleted.
  • [*] D3MDJONY
  • [*] 4J33F22T hydra-module.nix: Make it possible to add extra config lines
  • [*] 2GK5DOU7 * Downloading closures.
  • [*] AMFMXR52 Provide a command ‘hydra-init’ to initialise/upgrade the database

Change contents

  • edit in hydra-module.nix at line 147
    [5.198]
    [15.2521]
    gcRootsDir = mkOption {
    type = types.path;
    default = "/nix/var/nix/gcroots/hydra";
    description = "Directory that holds Hydra garbage collector roots.";
    };
  • edit in hydra-module.nix at line 198
    [4.173]
    [16.373]
    gc_roots_dir ${cfg.gcRootsDir}
  • edit in hydra-module.nix at line 240
    [3.407]
    [15.3887]
    if [ ! -e ${cfg.gcRootsDir} ]; then
    # Move legacy roots directory.
    if [ -e /nix/var/nix/gcroots/per-user/hydra/hydra-roots ]; then
    mv /nix/var/nix/gcroots/per-user/hydra/hydra-roots ${cfg.gcRootsDir}
    fi
    mkdir -p ${cfg.gcRootsDir}
    fi
    # Move legacy hydra-www roots.
    if [ -e /nix/var/nix/gcroots/per-user/hydra-www/hydra-roots ]; then
    find /nix/var/nix/gcroots/per-user/hydra-www/hydra-roots/ -type f \
    | xargs -r mv -f -t ${cfg.gcRootsDir}/
    rmdir /nix/var/nix/gcroots/per-user/hydra-www/hydra-roots
    fi
    chown hydra.hydra ${cfg.gcRootsDir}
    chmod 2775 ${cfg.gcRootsDir}
  • edit in src/lib/Hydra/Helper/Nix.pm at line 33
    [18.2634]
    [18.2634]
  • edit in src/lib/Hydra/Helper/Nix.pm at line 35
    [18.2635]
    [18.2635]
    my $hydraConfig;
  • edit in src/lib/Hydra/Helper/Nix.pm at line 38
    [2.61]
    [6.138]
    return $hydraConfig if defined $hydraConfig;
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 40
    [6.227][2.62:167]()
    return {} unless -f $conf;
    my %config = new Config::General($conf)->getall;
    return \%config;
    [6.227]
    [6.520]
    if (-f $conf) {
    my %h = new Config::General($conf)->getall;
    $hydraConfig = \%h;
    } else {
    $hydraConfig = {};
    }
    return $hydraConfig;
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 78
    [6.73][6.73:111](),[6.111][6.29:133]()
    die unless defined $ENV{LOGNAME};
    my $dir = ($ENV{NIX_STATE_DIR} || "/nix/var/nix" ) . "/gcroots/per-user/$ENV{LOGNAME}/hydra-roots";
    [6.73]
    [6.780]
    my $config = getHydraConfig();
    my $dir = $config->{gc_roots_dir};
    unless (defined $dir) {
    die unless defined $ENV{LOGNAME};
    $dir = ($ENV{NIX_STATE_DIR} || "/nix/var/nix" ) . "/gcroots/per-user/$ENV{LOGNAME}/hydra-roots";
    }