change default rt dir from /tmp to ~/rt/riak

This commit is contained in:
Dave Parfitt 2013-01-23 11:43:19 -05:00
parent 5b60832dea
commit 7ebba3b480
5 changed files with 64 additions and 63 deletions

View File

@ -8,12 +8,12 @@ in Erlang, and can interact with the cluster using distributed Erlang.
### How does it work?
`riak_test` runs tests in a sandbox, typically `/tmp/rt`. The sanbox
`riak_test` runs tests in a sandbox, typically `$HOME/rt/riak`. The sanbox
uses `git` to reset back to a clean state after tests are run. The
contents of `/tmp/rt` might look something like this:
contents of `$HOME/rt/riak` might look something like this:
```
$ ls /tmp/rt
$ ls $HOME/rt/riak
current riak-1.0.3 riak-1.1.4 riak-1.2.0
```
@ -25,19 +25,19 @@ You'll create another directory that will contain full builds
of different version of Riak for your platform. Typically this directory
has been `~/test-releases` but it can be called anything and be anywhere
that you'd like. The `dev/` directory from each of these
releases will be copied into the sandbox (`/tmp/rt`).
releases will be copied into the sandbox (`$HOME/rt/riak`).
There are helper scripts in `bin/` which will
help you get both `~/test-releases` and `/tmp/rt` all set up. A full
help you get both `~/test-releases` and `$HOME/rt/riak` all set up. A full
tutorial for using them exists further down in this README.
There is one folder in `/tmp/rt` that does not come from
There is one folder in `$HOME/rt/riak` that does not come from
`~/test-releases`: `current`. The `current` folder can refer
to any version of Riak, but is typically used for something
like the `master` branch, a feature branch, or a release candidate.
The `/tmp/rt/current` dev release gets populated from a devrel of Riak
The `$HOME/rt/riak/current` dev release gets populated from a devrel of Riak
that can come from anywhere, but is usually your 'normal' git checkout
of Riak. The `bin/rtdev-current.sh` can be run from within that folder
to copy `dev/` into `/tmp/rt/current`.
to copy `dev/` into `$HOME/rt/riak/current`.
Once you have everything set up (again, instructions for this are below),
you'll want to run and write tests. This repository also holds code for
@ -60,10 +60,10 @@ in the other scripts, including installing the current "master" branch from
Github into "current". The releases will be built in your current working
directory, so create an empty one in a place you'd like to store these
builds for posterity, so that you don't have to rebuild them if your
installation path (`/tmp/rt` by the way this script installs it) gets into
a bad state, or deleted as tmpfs things tend to get during reboot.
installation path (`$HOME/rt/riak` by the way this script installs it) gets into
a bad state.
If you do want to restore your `/tmp/rt` folder to factory condition, see
If you do want to restore your `$HOME/rt/riak` folder to factory condition, see
`rtdev-setup-releases.sh` and if you want to change the current riak under
test, see `rtdev-current.sh`.
@ -73,7 +73,7 @@ The first one that we want to look at is `rtdev-build-releases.sh`. If
left unchanged, this script is going to do the following:
1. Download the source for the past three major Riak versions (e.g.
1.0.3, 1.1.4, and 1.2.0)
1.0.3, 1.1.4, and 1.2.1)
1. Build the proper version of Erlang that release was built with,
using kerl (which it will also download)
1. Build those releases of Riak.
@ -85,6 +85,7 @@ installation:
```bash
R14B04=${R14B04:-$HOME/erlang-R14B04}
R15B03=${R15B03:-$HOME/erlang-R15B03}
```
**Kerlveat**: If you want kerl to build erlangs with serious 64-bit
@ -112,7 +113,7 @@ proceeding on to the next script**
The `rtdev-setup-releases.sh` will get the releases you just built
into a local git repository. Currently, running this script from the
same directory that you just built all of your releases into.
Currently this script initializes this repository into `/tmp/rt` but
Currently this script initializes this repository into `$HOME/rt/riak` but
it's probably worth making that configurable in the near term.
### rtdev-current.sh
@ -138,11 +139,11 @@ to tell riak_test about them. The method of choice is to create a
{rt_deps, ["$PATH_TO_YOUR_RIAK_SOURCE/deps"]},
{rt_retry_delay, 500},
{rt_harness, rtdev},
{rtdev_path, [{root, "/tmp/rt"},
{current, "/tmp/rt/current"},
{"1.2.0", "/tmp/rt/riak-1.2.0"},
{"1.1.4", "/tmp/rt/riak-1.1.4"},
{"1.0.3", "/tmp/rt/riak-1.0.3"}]}
{rtdev_path, [{root, "$HOME/rt/riak"},
{current, "$HOME/rt/riak/current"},
{"1.2.0", "$HOME/rt/riak/riak-1.2.1"},
{"1.1.4", "$HOME/rt/riak/riak-1.1.4"},
{"1.0.3", "$HOME/rt/riak/riak-1.0.3"}]}
]}.
```

View File

@ -18,7 +18,7 @@ echo "================== riak_test Omnibus Installer =================="
echo
echo "This is an omnibus script that builds all the necessary versions "
echo "of Erlang and Riak (including the latest from Github) for running"
echo "riak_test and installs them into /tmp/rt. "
echo "riak_test and installs them into $HOME/rt/riak. "
echo
echo -n "Are you sure you want to continue? [Y|n] "
read continue

View File

@ -57,33 +57,33 @@ Running the test in devrel mode gives the following output:
<pre class="erlang">
```
08:56:50.474 [info] Resetting nodes to fresh state
08:56:50.474 [debug] Running: git --git-dir="/tmp/rt/.git" --work-tree="/tmp/rt/" reset HEAD --hard
08:56:52.522 [debug] Running: git --git-dir="/tmp/rt/.git" --work-tree="/tmp/rt/" clean -fd
08:56:50.474 [debug] Running: git --git-dir="~/rt/riak/.git" --work-tree="~/rt/riak/" reset HEAD --hard
08:56:52.522 [debug] Running: git --git-dir="~/rt/riak/.git" --work-tree="~/rt/riak/" clean -fd
08:56:52.718 [notice] Running Test verify_build_cluster
08:56:52.719 [info] rt:set_backend(riak_kv_bitcask_backend)
08:56:52.719 [info] rtdev:set_backend(riak_kv_bitcask_backend)
08:56:52.719 [info] rtdev:update_app_config(all, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.720 [info] rtdev:update_app_config_file(/tmp/rt/current/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.726 [info] rtdev:update_app_config_file(/tmp/rt/current/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.731 [info] rtdev:update_app_config_file(/tmp/rt/current/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.737 [info] rtdev:update_app_config_file(/tmp/rt/current/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.743 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.2.0/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.749 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.2.0/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.755 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.2.0/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.760 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.2.0/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.766 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.1.4/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.772 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.1.4/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.780 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.1.4/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.787 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.1.4/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.794 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.0.3/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.800 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.0.3/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.805 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.0.3/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.811 [info] rtdev:update_app_config_file(/tmp/rt/riak-1.0.3/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.720 [info] rtdev:update_app_config_file(~/rt/riak/current/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.726 [info] rtdev:update_app_config_file(~/rt/riak/current/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.731 [info] rtdev:update_app_config_file(~/rt/riak/current/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.737 [info] rtdev:update_app_config_file(~/rt/riak/current/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.743 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.2.0/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.749 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.2.0/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.755 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.2.0/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.760 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.2.0/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.766 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.1.4/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.772 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.1.4/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.780 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.1.4/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.787 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.1.4/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.794 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.0.3/dev/dev1/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.800 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.0.3/dev/dev2/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.805 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.0.3/dev/dev3/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.811 [info] rtdev:update_app_config_file(~/rt/riak/riak-1.0.3/dev/dev4/etc/app.config, [{riak_kv,[{storage_backend,riak_kv_bitcask_backend}]}])
08:56:52.850 [info] Deploying 3 nodes
08:56:52.850 [info] Riak path: "/tmp/rt"
08:56:52.887 [info] Running: /tmp/rt/current/dev/dev1/bin/riak start
08:56:52.887 [info] Running: /tmp/rt/current/dev/dev2/bin/riak start
08:56:52.887 [info] Running: /tmp/rt/current/dev/dev3/bin/riak start
08:56:52.850 [info] Riak path: "~/rt/riak"
08:56:52.887 [info] Running: ~/rt/riak/current/dev/dev1/bin/riak start
08:56:52.887 [info] Running: ~/rt/riak/current/dev/dev2/bin/riak start
08:56:52.887 [info] Running: ~/rt/riak/current/dev/dev3/bin/riak start
08:56:58.528 [debug] Supervisor inet_gethost_native_sup started undefined at pid <0.142.0>
08:56:58.528 [debug] Supervisor kernel_safe_sup started inet_gethost_native:start_link() at pid <0.141.0>
08:56:58.570 [info] Deployed nodes: ['dev1@127.0.0.1','dev2@127.0.0.1','dev3@127.0.0.1']
@ -154,7 +154,7 @@ Erlang term based config files. The references `rtdev.config' file above:
{rt_harness, rtdev}.
%% Path to generated devrel of Riak that is git-versioned
{rtdev_path, "/tmp/rt"}.
{rtdev_path, "~/rt/riak"}.
'''
And to conclude, a slightly longer test that uses most of the built-in
@ -227,12 +227,12 @@ directory and ensure the `rtdev_path' setting in `rtdev.config' is accurate.
To generate the versioned devrel, modify the following as necessary:
```
riak$ make devrel
riak$ mkdir /tmp/rt
riak$ cp -r dev /tmp/rt/dev
riak$ cd /tmp/rt/dev
/tmp/rt/dev$ git init
/tmp/rt/dev$ git add .
/tmp/rt/dev$ git commit -m "initial"
riak$ mkdir ~/rt/riak
riak$ cp -r dev ~/rt/riak/dev
riak$ cd ~/rt/riak/dev
~/rt/riak/dev$ git init
~/rt/riak/dev$ git add .
~/rt/riak/dev$ git commit -m "initial"
'''
You can then launch tests from within the riak_test directory:

View File

@ -5,15 +5,15 @@
{rt_max_wait_time, 180000},
{rt_retry_delay, 500},
{rt_harness, rtdev},
{rtdev_path, [{root, "/tmp/rt"},
{current, "/tmp/rt/current"},
{"1.2.0", "/tmp/rt/riak-1.2.0"},
{previous, "/tmp/rt/riak-1.2.0"},
{"1.1.4", "/tmp/rt/riak-1.1.4"},
{legacy, "/tmp/rt/riak-1.1.4"},
{"1.0.3", "/tmp/rt/riak-1.0.3"}]},
{basho_bench, "/Users/joe/dev/basho/basho_bench"},
{spam_dir, "/Users/joe/dev/basho/riak_test/search-corpus/spam.0"},
{rtdev_path, [{root, "/Users/dparfitt/rt"},
{current, "/Users/dparfitt/rt/riak/current"},
{"1.2.1", "/Users/dparfitt/rt/riak/riak-1.2.1"},
{previous, "/Users/dparfitt/rt/riak/riak-1.2.1"},
{"1.1.4", "/Users/dparfitt/rt/riak/riak-1.1.4"},
{legacy, "/Users/dparfitt/rt/riak/riak-1.1.4"},
{"1.0.3", "/Users/dparfitt/rt/riak/riak-1.0.3"}]},
{basho_bench, "/Users/dparfitt/basho/basho_bench"},
{spam_dir, "/Users/dparfitt/basho/riak_test/search-corpus/spam.0"},
{platform, "osx-64"},
{rt_deps, []}
]}.

View File

@ -10,15 +10,15 @@
]},
{env, [
{platform, undefined},
{rt_scratch_dir, "/tmp/riak_test_scratch"},
{rt_scratch_dir, "~/rt/riak/riak_test_scratch"},
{rt_max_wait_time, 180000},
{rt_retry_delay, 500},
{rt_harness, rtdev},
{rtdev_path, [{root, "/tmp/rt"},
{current, "/tmp/rt/current"},
{"1.2.0", "/tmp/rt/riak-1.2.0"},
{"1.1.4", "/tmp/rt/riak-1.1.4"},
{"1.0.3", "/tmp/rt/riak-1.0.3"}]},
{rtdev_path, [{root, "~/rt/riak/"},
{current, "~/rt/riak/current"},
{"1.2.0", "~/rt/riak/riak-1.2.0"},
{"1.1.4", "~/rt/riak/riak-1.1.4"},
{"1.0.3", "~/rt/riak/riak-1.0.3"}]},
{java, [{fat_be_url, "http://s3.amazonaws.com/builds.basho.com/riak-java-client/CURRENT/riak-client-1.0.7-SNAPSHOT-jar-with-dependencies-and-tests.jar"},
{tests_url, "http://s3.amazonaws.com/builds.basho.com/riak-java-client/CURRENT/riak-client-1.0.7-SNAPSHOT-tests.jar"}
]}