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

Use gx for iptb #2545

Merged
merged 7 commits into from
May 3, 2016
Merged

Use gx for iptb #2545

merged 7 commits into from
May 3, 2016

Conversation

chriscool
Copy link
Contributor

This is to fix issue #2525 by using gx to manage the iptb dependency.

@chriscool
Copy link
Contributor Author

I followed the instructions on the gx README (https://github.com/whyrusleeping/gx/blob/master/README.md) and it works on my machine, but it looks like it fails elsewhere because it cannot find the package QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ:

ERROR: from shell.Get():  unexpected EOF

retrying fetch QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ after a second...

ipfs-shell: warning! unhandled response encoding: text/htmlERROR: from shell.Get():  get: unknown ipfs-shell error encoding: "text/html" - "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.9.3</center>\r\n</body>\r\n</html>\r\n"

@chriscool
Copy link
Contributor Author

I can see something on my machine:

> ipfs ls QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ
QmRK98cso22c13zpr92n4QSYtrWeqHQXV1RrxvB2wzt7KA 10822786 iptb/

and on the public gateway too: https://gateway.ipfs.io/ipfs/QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ

@chriscool
Copy link
Contributor Author

There are still some problems with getting the package.

@whyrusleeping
Copy link
Member

@chriscool it looks like the gx package can be fetched properly, now the makefile in test/sharness is having trouble finding where the code is to build it.

@chriscool
Copy link
Contributor Author

chriscool commented Apr 15, 2016

@whyrusleeping maybe that's true for the CircleCi build, but for the Travis builds, one of them worked and in another one the error is:

ERROR: from shell.Get():  unexpected EOF
retrying fetch QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ after a second...
ipfs-shell: warning! unhandled response encoding: text/htmlERROR: from shell.Get():  get: unknown ipfs-shell error encoding: "text/html" - "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.9.3</center>\r\n</body>\r\n</html>\r\n"
retrying fetch QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ after a second...
ipfs-shell: warning! unhandled response encoding: text/htmlERROR: from shell.Get():  get: unknown ipfs-shell error encoding: "text/html" - "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.9.3</center>\r\n</body>\r\n</html>\r\n"
ERROR: [7 / 7 ] parallel fetch: failed to fetch package: QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ: get: unknown ipfs-shell error encoding: "text/html" - "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.9.3</center>\r\n</body>\r\n</html>\r\n"
ERROR: install deps: failed to fetch dependencies
make: *** [deps] Error 1

@chriscool
Copy link
Contributor Author

Also yeah it looks like when sharness tests are run alone on a CI machine, we will need to run gx install.

@chriscool
Copy link
Contributor Author

So I added a commit that uses the root Makefile to check that everything is ok and maybe install missing packages using gx if not.

@chriscool
Copy link
Contributor Author

On the CircleCi failure we have:

  - go-ipfs depends on iptb (QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ)
installing package: iptb-0.0.0
successfully found all deps for iptb
installation of iptb complete!

so it looks like gx installs iptb correctly.

But then we have:

*** installing bin/iptb ***
go build  -o bin/iptb ../../../../../src/github.com/whyrusleeping/iptb
can't load package: package github.com/whyrusleeping/iptb: cannot find package "github.com/whyrusleeping/iptb" in any of:
    /usr/local/go/src/github.com/whyrusleeping/iptb (from $GOROOT)
    /home/ubuntu/.go_workspace/src/github.com/whyrusleeping/iptb (from $GOPATH)
make[2]: *** [bin/iptb] Error 1
make[1]: *** [bin/iptb] Error 2
make: *** [test_sharness_expensive] Error 2

so we cannot find iptb.

Where was it installed in the first place?

@whyrusleeping
Copy link
Member

now that we are using gx, the import path of iptb is no longer github.com/whyrusleeping/iptb its the gx path, so we will need to: go build gx/ipfs/QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ/iptb

@chriscool
Copy link
Contributor Author

chriscool commented Apr 23, 2016

@whyrusleeping is there a command (maybe gx view something) to get "QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ" so that the hash is not hardcoded?

@whyrusleeping
Copy link
Member

@chriscool i think the best way to do that right now is to do something like gx deps | grep iptb | awk '{ print $2 }'

I need to add something to gx deps to make that query easier

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Now that iptb has been added as a gx dependency, we can replace
existing dependencies with the one from gx.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
We need to make sure that go, gx, gx-go are properly installed.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
@chriscool
Copy link
Contributor Author

I haven't yet started to use gx deps find, but at least I rebased everything and made things work on my laptop.

@chriscool
Copy link
Contributor Author

chriscool commented Apr 30, 2016

@whyrusleeping in e79e1d3, you changed the following line in test/Makfile:

-MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
+MULTIHASH_SRC = ../../../../gx/ipfs/QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku/go-multihash

but it looks like go-multihash is not in package.json. Did you forgot to add it there or is it normal?

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
@chriscool
Copy link
Contributor Author

Ok, the last 2 commits should hopefully fix the 2 problems I talk about above, that are the multihash not in package.json and using gx deps find for gx dependencies.

@chriscool
Copy link
Contributor Author

There is now this CircleCI error:

*** installing bin/iptb ***
go build  -o bin/iptb ../../../../gx/ipfs/QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ/iptb
../../../../gx/ipfs/QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ/iptb/util/util.go:22:2: cannot find package "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" in any of:
    /usr/local/go/src/github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr (from $GOROOT)
    /home/ubuntu/.go_workspace/src/github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr (from $GOPATH)
make[2]: *** [bin/iptb] Error 1
make[2]: Leaving directory `/home/ubuntu/.go_workspace/src/github.com/ipfs/go-ipfs/test'
make[1]: *** [bin/iptb] Error 2
make[1]: Leaving directory `/home/ubuntu/.go_workspace/src/github.com/ipfs/go-ipfs/test/sharness'
make: *** [test_sharness_expensive] Error 2 

@chriscool
Copy link
Contributor Author

TravisCI errors are still "No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself."

@chriscool
Copy link
Contributor Author

chriscool commented May 1, 2016

Teamcity error is:

[06:51:34][Step 1/3] [10 / 12] fetched dep: go-libp2p
[06:51:34][Step 1/3] [11 / 12] fetched dep: goprocess
[07:21:34][Step 1/3] ERROR: from shell.Get():  get: unknown ipfs-shell error encoding: "text/html" - "<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx/1.9.3</center>\r\n</body>\r\n</html>\r\n"
[07:21:34][Step 1/3] retrying fetch QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ after a second...
[07:51:35][Step 1/3] ERROR: from shell.Get():  get: unknown ipfs-shell error encoding: "text/html" - "<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx/1.9.3</center>\r\n</body>\r\n</html>\r\n"
[07:51:35][Step 1/3] retrying fetch QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ after a second...
[08:21:40][Step 1/3] ERROR: from shell.Get():  unexpected EOF
[08:21:40][Step 1/3] ERROR: [12 / 12 ] parallel fetch: failed to fetch package: QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ: unexpected EOF
[08:21:40][Step 1/3] ERROR: install deps: failed to fetch dependencies
[08:21:40][Step 1/3] Makefile:34: recipe for target 'deps' failed
[08:21:40][Step 1/3] ipfs-shell: warning! unhandled response encoding: text/htmlipfs-shell: warning! unhandled response encoding: text/htmlmake: *** [deps] Error 1
[08:21:40][Step 1/3] Process exited with code 2
[08:21:40][Step 1/3] Step build (Command Line) failed

It looks like a timeout.

@chriscool
Copy link
Contributor Author

@lgierth could you take a look at the timeouts?
@whyrusleeping do you have an idea about how the CircleCI error could be fixed?

@whyrusleeping
Copy link
Member

@chriscool the timeouts again just look like you created a new package and it took a while for the gateways to get it. Restarting the tests seems to be working as expected

@whyrusleeping
Copy link
Member

@chriscool try using Qmbi7xdiz4fJRxTjzanYHJhvpCPRK6yyVrgZmV7ZfvnMiV for iptb. Its a latest version without the godeps multiaddr problem

@chriscool
Copy link
Contributor Author

@whyrusleeping thanks I will take a look soon.

@whyrusleeping
Copy link
Member

@chriscool if you push this as a branch in this repo I could hack on it a bit too

@chriscool
Copy link
Contributor Author

@whyrusleeping I get the following error on my machine when using Qmbi7xdiz4fJRxTjzanYHJhvpCPRK6yyVrgZmV7ZfvnMiV:

*** installing bin/iptb ***
go build  -o bin/iptb ../../../../gx/ipfs/Qmbi7xdiz4fJRxTjzanYHJhvpCPRK6yyVrgZmV7ZfvnMiV/iptb
# gx/ipfs/Qmbi7xdiz4fJRxTjzanYHJhvpCPRK6yyVrgZmV7ZfvnMiV/iptb/util
../../../../gx/ipfs/Qmbi7xdiz4fJRxTjzanYHJhvpCPRK6yyVrgZmV7ZfvnMiV/iptb/util/util.go:408: cannot use maddr (type "github.com/jbenet/go-multiaddr".Multiaddr) as type "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr in argument to manet.DialArgs:
        "github.com/jbenet/go-multiaddr".Multiaddr does not implement "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr (wrong type for Decapsulate method)
                have Decapsulate("github.com/jbenet/go-multiaddr".Multiaddr) "github.com/jbenet/go-multiaddr".Multiaddr
                want Decapsulate("github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr) "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr
../../../../gx/ipfs/Qmbi7xdiz4fJRxTjzanYHJhvpCPRK6yyVrgZmV7ZfvnMiV/iptb/util/util.go:460: cannot use maddr (type "github.com/jbenet/go-multiaddr".Multiaddr) as type "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr in argument to manet.DialArgs:
        "github.com/jbenet/go-multiaddr".Multiaddr does not implement "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr (wrong type for Decapsulate method)
                have Decapsulate("github.com/jbenet/go-multiaddr".Multiaddr) "github.com/jbenet/go-multiaddr".Multiaddr
                want Decapsulate("github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr) "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr".Multiaddr
make: *** [bin/iptb] Erreur 2

@chriscool
Copy link
Contributor Author

@whyrusleeping Sorry about using a branch in my repo for this. I pushed the branch into this repo: https://github.com/ipfs/go-ipfs/commits/use-gx-for-iptb but I don't think it's possible to replace the branch in my repo with the branch in this repo in the PR.

@chriscool
Copy link
Contributor Author

Do you want me to open another PR instead?

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
@whyrusleeping
Copy link
Member

@chriscool thats okay, I think i've got it now: 1770badbb31e

Pull that commit over and give it a shot.

@whyrusleeping
Copy link
Member

(or just copy the hash over, i realize pulling that commit it might be more effort than just changing one line)

@chriscool
Copy link
Contributor Author

Ok I pulled from the chriscool-use-gx-for-iptb branch and got your commit. It works here indeed, thanks!

@chriscool
Copy link
Contributor Author

The TravisCI build is still full of "No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself." errors.

@whyrusleeping
Copy link
Member

the gateways keep running into a yamux bug... i'm working on fixing it now but it makes some of them unresponsive until we reboot them.

@chriscool
Copy link
Contributor Author

CircleCI has this interesting error:

expecting success: 
  ipfsi 3 dht query banana >actual &&
  ipfsi 3 dht query apple >>actual &&
  ipfsi 3 dht query pear >>actual &&
  PEERS=$(wc -l actual | cut -d ' ' -f 1) &&
  [ -s actual ] ||
    test_fsh cat actual

> cat actual

not ok 14 - query
#   
#     ipfsi 3 dht query banana >actual &&
#     ipfsi 3 dht query apple >>actual &&
#     ipfsi 3 dht query pear >>actual &&
#     PEERS=$(wc -l actual | cut -d ' ' -f 1) &&
#     [ -s actual ] ||
#       test_fsh cat actual
#   

expecting success: 
  iptb stop

DEPRECATED Action signature.  Must be `cli.ActionFunc`.  This is an error in the application.  Please contact the distributor of this application if this is not you.  See https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature

@whyrusleeping
Copy link
Member

thats: #2620

And the the DEPRECATED thing is an upstream change in codegangsta/cli (the commands library i use for gx and gx-go). Nothing real to worry about there

@chriscool
Copy link
Contributor Author

Ok thanks. By the way Teamcity has this error:

[20:22:12][Step 3/3] fatal: Program gx is not installed!
[20:22:12][Step 3/3] => Upgrade or install gx using your package manager or run `make gx_upgrade`
[20:22:12][Step 3/3] make[2]: *** [gx_check] Error 1
[20:22:12][Step 3/3] make[1]: *** [global-deps] Error 2

@chriscool
Copy link
Contributor Author

Now there is only one TravisCI build failing, great!

The failure is the usual "No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself."

@whyrusleeping whyrusleeping merged commit f1df72b into ipfs:master May 3, 2016
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