Skip to content

Conversation

jimpick
Copy link

@jimpick jimpick commented Jul 31, 2019

Ready to merge. :-)

  • Separate js-ipfs and go-ipfs Grafana dashboards
  • New required param "project" in REST API POST to add a test
    (either 'js-ipfs' or 'go-ipfs')
  • Temporary hack to reduce tests to a single test to speed up
    testing (localTransfer_tcp_mplex_secio)

"project" setting is not passed through yet. Will probably need
modifications to ansible scripts and some new code to rebuild
go-ipfs to match requested sha hash. Test may need modifications,
and upload to InfluxDB will need to set the right metadata.

jimpick and others added 6 commits July 30, 2019 21:50
Work-in-progress ... do not merge yet

* Separate js-ipfs and go-ipfs Grafana dashboards
* New required param "project" in REST API POST to add a test
  (either 'js-ipfs' or 'go-ipfs')
* Temporary hack to reduce tests to a single test to speed up
  testing (localTransfer_tcp_mplex_secio)

"project" setting is not passed through yet. Will probably need
modifications to ansible scripts and some new code to rebuild
go-ipfs to match requested sha hash. Test may need modifications,
and upload to InfluxDB will need to set the right metadata.
I was having trouble getting go-ipfs to connect to js-ipfs in the tests ... the libp2p config wasn't passing in the secio object in the right place.
The script was failing when it tried to delete the non-existent
symlink, and subsequent runs would not recreate it.
Also fixes unit tests in 'runner'.
@jimpick
Copy link
Author

jimpick commented Aug 1, 2019

I fixed up the tests that were using go-ipfs. I think it needs a switch that tells it which set of tests to run:

  • js-ipfs from a sha hash + stable go-ipfs release + relevant tests -> results go to 'js' dashboard
  • go-ipfs from a sha hash + stable js-ipfs + relevant tests -> results go to 'go' dashboard

We could run an arbitrary js-ipfs hash vs. an arbitrary go-ipfs hash, but we'd have to figure out the dashboard situation, if we stick all the results on a single dashboard, it might be a bit of a mishmash.

There's only one test currently that involves go-ipfs by itself (local-add.go.js). The other two tests are interop between js-ipfs and go-ipfs (extract-go2.js and extract-js2.go.js). It doesn't appear that any of these tests were currently active.

The only reason I can think of for running local-add.go.js during the js-ipfs test would be to have a comparative number. In that case, it should probably be displayed on the 'js' dashboard alongside the other tests run at the same time.

I'm pretty close to having the switch where we can build a custom go version, and run the 3 tests that we have against it.

@Stebalien
Copy link
Member

Separate js-ipfs and go-ipfs Grafana dashboards

Why are we splitting these into two dashboards and not just labeling the test runs? We should be able to run the current js-ipfs benchmarks against go-ipfs.

jimpick added 7 commits August 1, 2019 17:19
Was causing chicken-and-egg bootstrapping problem.
My ssh key was in a different location, remove hardcoded "elexy".
When creating tests, each test can be specified to be a default
for a list of different targets.

Also, throw an error if the provision step fails.
To make it easier to debug.
Tests now get a 'meta' object so we can add more fields in the future.
@jimpick
Copy link
Author

jimpick commented Aug 2, 2019

@Stebalien It will probably make more sense when I demo it. With Grafana, typically you have lots of dashboards corresponding to different views on the data - I'm just tagging the data so you can tell what came from where.

I'm just starting to learn how to use InfluxDB + Grafana ... here are some screenshots from my dev setup - I've barely started to explore the possibilities:

Screenshot 2019-08-02 11 20 51

Screenshot 2019-08-02 11 20 17

@Stebalien
Copy link
Member

Got it. My main concerns are:

  1. The benchmarks themselves will often run against both go and js.
  2. I'd like to be able to compare go and JS.

That's why I'm thinking this should be more of a filter than anything (or maybe two dashboards and a combined dashboard).

@jimpick
Copy link
Author

jimpick commented Aug 2, 2019

I think that's pretty easy to do, I just need to figure out how to build the query. :-)

Here's another dashboard with separate graphs for each test, with different lines for each file size - I think it's a bit easier to grok:

Screenshot 2019-08-02 12 12 28

It's possible to overlay all sorts of information and also provide ways to "drill down".

jimpick added 2 commits August 2, 2019 22:13
We now build both js-ipfs and go-ipfs from github master each time.

The support for specific 'commit' tests are currently broken, as
the scripts will attempt to checkout the same commit on both js-ipfs
as well as go-ipfs ... we'll need to switch on the target as well
as pick a default for the other.

I've hardcoded some paths for the go-ipfs binary we build ... that
should be fixed.

I added an ansible role to install an up-to-date version of go.

There are multiple versions of go and ipfs on the system, so it's
a bit hazardous as the wrong version might be used by accident.
For some reason, 'make install' didn't build the binary as expected.
@jimpick
Copy link
Author

jimpick commented Aug 3, 2019

It now seems to be successfully building a "fresh" js-ipfs and go-ipfs for each run off of master. I need to fixup manually selecting a sha for a job. There is more work to do to make sure the sha for both js-ipfs and go-ipfs gets through to InfluxDB.

I experimented with using "Annotations" with Grafana to show git hashes on the graph. I will need to add some code to maintain that table in the database.

rm -Rf go-ipfs && \
chmod +x /usr/local/bin/ipfs_{{go_ipfs_version}} && \
rm /usr/local/bin/ipfs && \
rm -Rf /usr/local/bin/ipfs && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this is needed now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rm fails if /usr/local/bin/ipfs is not there already, which it won't be on a non-bootstrapped system. It should probably just be rm -f ... the recursive option is not needed since it's a single file.

name: 'localTransfer_tcp_mplex',
file: 'local-transfer.js -t tcp -m mplex'
file: 'local-transfer.js -t tcp -m mplex',
defaultFor: [ 'js-minion' ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this would be better named targets?

},
target: {
type: 'string',
description: 'currently js-minion or go-minion',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can we have a better description? It is already out of date (can be js-minion-lite)!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that needs a better description.

I'm not 100% satisfied with the name of the option - i called it "target" because i didn't have a better idea at the moment - it's not really a test suite, since both js and go might share tests, and js-minion-lite is a subset of the js-minion tests. "Target" is used by gcc to refer to a combination of cpu + operating system when cross-compiling, but this is a bit different, since it's referring to the implementation.

config.log.info(jsOut)
// let goOut = await remote.run(`${config.benchmarks.remotePath}getGoIpfs.sh ${config.ipfs.path} ${commit || ''}`)
let goOut = await remote.run(`${config.benchmarks.remotePath}getGoIpfs.sh ${config.ipfs.path}`)
config.log.info(goOut)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading this correctly the passed commit is ignored now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I need to take a second pass and figure out a better solution for this.

I didn't like that 'commit' doesn't specify whether or not it's referring to go-ipfs or js-ipfs. Right now, I'm just building both from master every time.

Testing master against master for the one js <-> go interop test might be the right thing to do. It might make more sense to test js-ipfs master vs. a stable release of go-ipfs (latest one?) and go-ipfs vs. a stable release of js-ipfs.

I don't think the 'commit' "manual override" feature is actively being used, but I think it might be good to be able to pass in a separate commit for js-ipfs and go-ipfs at the same time for maximum flexibility.

try {
await mkDir(`${targetDir}/${test.name}`, { recursive: true })
let arrResult = await runCommand(test.benchmark, test.name)
let arrResult = await runCommand(test.benchmark + ` --target=${params.target}`, test.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let arrResult = await runCommand(test.benchmark + ` --target=${params.target}`, test.name)
let arrResult = await runCommand(test.benchmark + (params.target ? ` --target=${params.target}` : '', test.name)

name = protocal === 'ws' ? `${name}Ws` : name
const id = protocal === 'ws' ? 2 : 0
let command = `export IPFS_PATH=${conf.tmpPath}/ipfs0 && ipfs swarm connect ${peerId.addresses[id]}`
let command = `export IPFS_PATH=${conf.tmpPath}/ipfs0 && /home/ubuntu/ipfs/go-ipfs/cmd/ipfs/ipfs swarm connect ${peerId.addresses[id]}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here!

git clone https://github.com/ipfs/go-ipfs.git 2>&1
cd go-ipfs
else
echo "> Git repo for js-ipfs found, updating..."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "> Git repo for js-ipfs found, updating..."
echo "> Git repo for go-ipfs found, updating..."

git config --global advice.detachedHead false
git checkout $COMMIT 2>&1
fi
echo "run make build for go-ipfs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "run make build for go-ipfs"
echo "> running make build for go-ipfs"

await initRepo(peerDir)
await fsWriteFile(`${peerDir}/config`, JSON.stringify(peerConf))
let peer = spawn('ipfs', ['daemon'], { env: Object.assign(process.env, { IPFS_PATH: peerDir }) })
let peer = spawn('/home/ubuntu/ipfs/go-ipfs/cmd/ipfs/ipfs', ['daemon'], { env: Object.assign(process.env, { IPFS_PATH: peerDir }) })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be global or configuration passed that has this path!

'project': 'js-ipfs',
'commit': 'TBD',
'version': 'version of js-ipfs'
'version': 'version of js-ifps',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'version': 'version of js-ifps',
'version': 'version of js-ipfs',

@alanshaw
Copy link
Member

alanshaw commented Sep 6, 2019

ping @jimpick

@jimpick
Copy link
Author

jimpick commented Sep 7, 2019

Sorry for the delay responding ... I just added a gmail filter so hopefully i don't overlook these things from now on. I'll respond to the line-by-line comments now.

I was planning to do another pass on this, but I believe @raulk wants the go-ipfs tests in https://github.com/ipfs/testground instead, so I hadn't invested the extra time.

testground/testground#25

I don't think there would be any harm in deploying these changes, but they were just a first step ... they don't make much sense unless we also write more go test cases.

@jimpick
Copy link
Author

jimpick commented Sep 7, 2019

I'll also add that I also made a bunch of grafana dashboards where I re-organized the graphs to present the data in multiple dashboards in a more useable layout. I also did some experimentation in adding annotation data so that Grafana can display when the github commits occurred so it's easier to reason about the graphs you are looking at.

Those new dashboards and annotations are probably useful even if we don't run the go-ipfs tests on the ipfs/benchmarks minion. I can dump the dashboards out as JSON, but it's probably easier to discuss if I actually put them up somewhere publicly accessible. Right now, they only exist in the Grafana instance on my development desktop.

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.

4 participants