Skip to content

Commit

Permalink
Try keeping the node dir in /tmp with separate NODE_DB
Browse files Browse the repository at this point in the history
NODE_DB should actually be set.

IIRC we cannot store the socket file in the directory that gets cached,
without breaking CI, so let's keep the node dir in /tmp.

Try different way of setting NODE_DB

Fixup redundant import
  • Loading branch information
Anviking committed Oct 17, 2020
1 parent 7f6e70a commit 25c7307
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildkite/bench-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ log=restore.log
results=restore-$network.txt
total_time=restore-time.txt

: "${NODE_DB:=$HOME/node-db-$network}"
export NODE_DB=$HOME/node-db-$network

echo "--- Build"

Expand Down
12 changes: 2 additions & 10 deletions lib/core-integration/src/Cardano/Wallet/BenchShared.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ import Options.Applicative
)
import Say
( sayErr )
import System.Directory
( createDirectoryIfMissing )
import System.Environment
( lookupEnv )
import System.FilePath
Expand Down Expand Up @@ -132,16 +130,10 @@ execBenchWithNode networkConfig action = do

withNetworkConfiguration :: RestoreBenchArgs -> (CardanoNodeConfig -> IO a) -> IO a
withNetworkConfiguration args action = do
-- Temporary directory for storing socket and node database
let withNodeDir cb = case argNodeDatabaseDir args of
Nothing -> withSystemTempDirectory "cw-node" cb
Just d -> do
createDirectoryIfMissing True d
cb d

let networkDir = argsNetworkDir args
port <- fromIntegral <$> getRandomPort
withNodeDir $ \dir -> action CardanoNodeConfig
-- Temporary directory for storing socket
withSystemTempDirectory "cw-node" $ \dir -> action CardanoNodeConfig
{ nodeDir = dir
, nodeConfigFile = networkDir </> "configuration.json"
, nodeDatabaseDir = fromMaybe "db" (argNodeDatabaseDir args)
Expand Down

0 comments on commit 25c7307

Please sign in to comment.