Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plant CI #1

Merged
merged 12 commits into from
Jul 19, 2017
Merged

Plant CI #1

merged 12 commits into from
Jul 19, 2017

Conversation

lucafavatella
Copy link

@mrallen1 It looks to me your fork of basho_bench is the most up-to-date, hence I am proposing PR.

I saw you removed CI, I wonder whether you would be willing to re-add it. This PR proposes basic configuration. (You would also need to enable this repo in your Travis account too.)

While trying to run your fork of basho_bench, I got a seed_s error (OTP 19) hence I decided to plant some CI and it looks like dialyzer&xref have some complaints about rand that might be meaningful (among others).

@lucafavatella
Copy link
Author

I added to CI minimum load test that shall be more a meaningful test.

It gets stuck with:

16:19:05.995 [error] Error in process <0.136.0> with exit value:

{function_clause,[{rand,seed_s,[{43,24,13}],[{file,"rand.erl"},{line,87}]},{rand,seed,1,[{file,"rand.erl"},{line,82}]},{basho_bench_worker,worker_init,1,[{file,"/home/travis/build/lucafavatella/basho_bench/_build/default/lib/basho_bench/src/basho_bench_worker.erl"},{line,220}]}]}

@lucafavatella
Copy link
Author

I added to CI minimum load test that shall be more a meaningful test.

It gets stuck with:

16:19:05.995 [error] Error in process <0.136.0> with exit value:

{function_clause,[{rand,seed_s,[{43,24,13}],[{file,"rand.erl"},{line,87}]},{rand,seed,1,[{file,"rand.erl"},{line,82}]},{basho_bench_worker,worker_init,1,[{file,"/home/travis/build/lucafavatella/basho_bench/_build/default/lib/basho_bench/src/basho_bench_worker.erl"},{line,220}]}]}

I think I got it. Commit 49fd1fd#diff-383e4e6a0839e0756cacc9f41f2c489dR220 fixed compilation - not semantics.

@jadeallenx
Copy link
Owner

jadeallenx commented Jul 18, 2017

No doubt it needs a bit of work, but I haven't spent any time on it since the last part of May, and it's probably time to do that.

Appreciate the PR - I am not opposed to re-enabling travis but I didn't want the old config lying around when I wasn't using it. Hope to have some time to look at this later this week.

@lucafavatella
Copy link
Author

lucafavatella commented Jul 18, 2017

At 8cb2212 dialyzer passes. xref failing still, the smoke load test fails too (eleveldb not in path).

Luca Favatella added 4 commits July 18, 2017 20:08
... following
49fd1fd#diff-383e4e6a0839e0756cacc9f41f2c489dR220
that apparently fixed compilation but not semantics.

The symptom (OTP 19) was:
```
16:19:05.995 [error] Error in process <0.136.0> with exit value:
{function_clause,[{rand,seed_s,[{43,24,13}],[{file,"rand.erl"},{line,87}]},{rand,seed,1,[{file,"rand.erl"},{line,82}]},{basho_bench_worker,worker_init,1,[{file,"/home/travis/build/lucafavatella/basho_bench/_build/default/lib/basho_bench/src/basho_bench_worker.erl"},{line,220}]}]}
```

As `rand` module needs algorithm in order to seed RNG, specify
algorithm. Pick `exsplus`, the algorithm that was default in OTP 19
and is still supported in OTP 20 (even if OTP 20 has better
algorithms).

References OTP 19:
* https://github.com/erlang/otp/blob/OTP-19.0/lib/stdlib/doc/src/rand.xml#L62
* https://github.com/erlang/otp/blob/OTP-19.0/lib/stdlib/src/rand.erl#L205

References OTP 20:
* https://github.com/erlang/otp/blob/OTP-20.0/lib/stdlib/doc/src/rand.xml#L79
* https://github.com/erlang/otp/blob/OTP-20.0/lib/stdlib/src/rand.erl#L409
Fixes xref warning:
```
Warning: basho_bench_valgen:new/2 calls undefined function rand:uniform/2 (Xref)
```

Apparently there is no `random:uniform/2` either, so call to
non-existent function must have been present even before
49fd1fd#diff-383e4e6a0839e0756cacc9f41f2c489dR220

`{uniform_int, MinVal, MaxVal}` is not documented among value
generators in [basho_bench configuration
documentation](https://github.com/basho/basho_docs/blob/78d408bd8b56e8b55f402fb49b6265f0437b6198/content/riak/kv/2.2.3/using/performance/benchmarking.md#value_generator):
assuming it to mean from `MinVal` (included) to `MaxVal` (included).
... and detail dimension of key space in order not to skip useful
message on key space when using key generator `{uniform_int, StartKey,
NumKeys}`.

For key generator:

* `{uniform_int, MaxKey}` keep as 1..`MaxKey` (even if partially
  documented as 0..`MaxKey` - see
  https://github.com/basho/basho_docs/blob/78d408bd8b56e8b55f402fb49b6265f0437b6198/content/riak/kv/2.2.3/using/performance/benchmarking.md#key_generator),
  and keep dimension `MaxKey`;

* `{uniform_int, StartKey, NumKeys}` (undocumented) keep as
  StartKey..(StartKey+NumKeys-1), and specify dimension `NumKeys` (that
  has the benefit of making such that an informative log message is
  not skipped).

From [basho_bench configuration
documentation](https://github.com/basho/basho_docs/blob/78d408bd8b56e8b55f402fb49b6265f0437b6198/content/riak/kv/2.2.3/using/performance/benchmarking.md#key_generator):

> #### key_generator
>
> The generator function to use for creating keys. Generators are defined
> in `basho_bench_keygen.erl`. Available generators include:
>
> ...
>
> * `{uniform_int, MaxKey}` --- selects an integer from uniform
>     distribution of 0..`MaxKey`, i.e. all integers are equally probable.
>
> ...
>
> The default key generator is `{uniform_int, 100000}`.
>
> Examples:
>
> ```erlang
> % Use a randomly selected integer between 1 and 10,000
> {key_generator, {uniform_int, 10000}}.
>
> % Use a randomly selected integer between 1 and 10,000, as binary.
> {key_generator, {int_to_bin, {uniform_int, 10000}}}.
>
> % Use a pareto distributed integer between 1 and 10,000; values < 2000
> % will be returned 80% of the time.
> {key_generator, {pareto_int, 10000}}.
> ```
@lucafavatella
Copy link
Author

I force-pushed a few commits.

The issue now is that id passed to new/1 of driver is like {single_worker,1,1}. It appears that recent commits broke the callback API (new and run) compatibility - see 8d761d7

@mrallen1 Do you agree that it would be desiderable to have in this same repo - even if not in side src/ - a selection of drivers? (I have in mind ets, dets, a dummy one (null?), a file-based one, an http one.) Those would be more likely be updated in sync with code.

Luca Favatella added 2 commits July 18, 2017 22:01
Also add script for running minimum load test locally as CI would
(assumptions: Erlang in PATH, clean repo).
@lucafavatella
Copy link
Author

I am not fixing xref: recent code changes introduces some more dynamic calls (e.g. M:f()).

@lucafavatella
Copy link
Author

Only error I get now is during graph generation:

Rscript --vanilla priv/summary.r -i tests/current

[1] "plyr"

Loading required package: plyr

Installing package(s) into ‘/usr/local/lib/R/site-library’

(as ‘lib’ is unspecified)

Warning in install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN") :

  'lib = "/usr/local/lib/R/site-library"' is not writable

Error in install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN") : 

  unable to install packages

Calls: source -> eval.with.vis -> eval.with.vis -> install.packages

Execution halted

make: *** [results] Error 1

I understand fix is setting R_LIBS - may try tomorrow.

@lucafavatella
Copy link
Author

I understand fix is setting R_LIBS - may try tomorrow.

After setting R_libs I get error:

Rscript --vanilla priv/summary.r -i tests/current

[1] "plyr"

Loading required package: plyr

Installing package(s) into ‘/home/travis/build/lucafavatella/basho_bench/tmp/R_libs’

(as ‘lib’ is unspecified)

Error in library(p, character.only = TRUE) : 

  there is no package called ‘plyr’

Calls: source -> eval.with.vis -> eval.with.vis -> library

In addition: Warning message:

In getDependencies(pkgs, dependencies, available, lib) :

  package ‘plyr’ is not available (for R version 2.14.1)

Execution halted

make: *** [results] Error 1

Luca Favatella added 4 commits July 19, 2017 11:13
Fixes the following error:
```
Rscript --vanilla priv/summary.r -i tests/current
[1] "plyr"
Loading required package: plyr
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN") :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Error in install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN") :
  unable to install packages
Calls: source -> eval.with.vis -> eval.with.vis -> install.packages
Execution halted
make: *** [results] Error 1
```
Prefer trusty to precise. See
https://docs.travis-ci.com/user/reference/trusty/#Routing-to-Trusty

Fixes the following error:
```
Rscript --vanilla priv/summary.r -i tests/current
[1] "plyr"
Loading required package: plyr
Installing package(s) into ‘/home/travis/build/lucafavatella/basho_bench/tmp/R_libs’
(as ‘lib’ is unspecified)
Error in library(p, character.only = TRUE) :
  there is no package called ‘plyr’
Calls: source -> eval.with.vis -> eval.with.vis -> library
In addition: Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘plyr’ is not available (for R version 2.14.1)
Execution halted
make: *** [results] Error 1
```
…of old R

Refs:
* https://docs.travis-ci.com/user/installing-dependencies/#Installing-Packages-on-Standard-Infrastructure
* https://docs.travis-ci.com/user/reference/trusty/#Routing-to-Trusty

Fixes error:
```
Rscript --vanilla priv/summary.r -i tests/current
[1] "plyr"
Loading required package: plyr
Installing package into ‘/home/travis/build/lucafavatella/basho_bench/tmp/R_libs’
(as ‘lib’ is unspecified)
Error in library(p, character.only = TRUE) :
  there is no package called ‘plyr’
Calls: source -> withVisible -> eval -> eval -> library
In addition: Warning message:
package ‘plyr’ is not available (for R version 3.0.2)
Execution halted
make: *** [results] Error 1
```
... as many false positives and unused functions.
@lucafavatella
Copy link
Author

As of 02c9c7d, CI passes (xref allowed failure).

@lucafavatella
Copy link
Author

Graph obtained on Travis CI at 488eeb2
summary
:

@jadeallenx
Copy link
Owner

Looks good, thanks!

@jadeallenx jadeallenx merged commit 9d704c8 into jadeallenx:mra-rebar3 Jul 19, 2017
@jadeallenx
Copy link
Owner

travis is enabled now. I guess I should've done things in reverse order :)

@lucafavatella lucafavatella deleted the ci branch July 20, 2017 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants