-
Notifications
You must be signed in to change notification settings - Fork 6
Initial changes to support go-ipfs #268
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
base: master
Are you sure you want to change the base?
Conversation
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.
v0.4.10 -> v0.4.21
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'.
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:
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. |
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. |
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.
@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: |
Got it. My main concerns are:
That's why I'm thinking this should be more of a filter than anything (or maybe two dashboards and a combined dashboard). |
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: It's possible to overlay all sorts of information and also provide ways to "drill down". |
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.
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 && \ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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' ] |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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
)!
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]}` |
There was a problem hiding this comment.
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..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 }) }) |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'version': 'version of js-ifps', | |
'version': 'version of js-ipfs', |
ping @jimpick |
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. 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. |
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. |
Ready to merge. :-)
(either 'js-ipfs' or 'go-ipfs')
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.