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

Docker image volume fix and Sharness tests #2064

Merged
merged 7 commits into from Jan 10, 2016
Merged

Conversation

chriscool
Copy link
Contributor

This PR contains @ChristianKniep's fix from PR #1806 (change Dockerfile order to create VOLUME under user ipfs) and add a Sharness test script (t0300) with some docker tests.
@ChristianKniep's fix is fixing issue #1804 (Boot2Docker: VOLUME prevents chown to have effect).

@jbenet jbenet added the status/in-progress In progress label Dec 13, 2015
@chriscool
Copy link
Contributor Author

Circle CI is failing with:

expecting success: 
    docker build --rm "$APP_ROOT_DIR" >actual

Post http:///var/run/docker.sock/v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=&ulimits=null: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
not ok 5 - docker image build succeeds

I am not sure it supports docker or maybe some options are needed to make it run docker.

@chriscool
Copy link
Contributor Author

About CircleCI I found an option in the doc for docker support, so I added a commit to set it.

@chriscool
Copy link
Contributor Author

Travis-CI supports Docker on Linux only for now.
Let's use a prereq to not run Docker tests on OSX.

@chriscool
Copy link
Contributor Author

travis-ci/push has this failure in go tests:

14:00:29.390 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:57236: use of closed network connection swarm_listen.go:129

14:00:29.390 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:48892: use of closed network connection swarm_listen.go:129

14:00:29.391 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:46832: use of closed network connection swarm_listen.go:129

14:00:29.395 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:32841: use of closed network connection swarm_listen.go:129

--- FAIL: TestDialWait (0.02s)

    dial_test.go:103: failed to specify addrs: [/ip6/::/tcp/42276]

14:00:29.418 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:38928: use of closed network connection swarm_listen.go:129

--- FAIL: TestDialBackoffClears (0.05s)

    dial_test.go:103: failed to specify addrs: [/ip6/::/tcp/35358]

14:00:29.483 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:54142: use of closed network connection swarm_listen.go:129

14:00:29.490 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:47706: use of closed network connection swarm_listen.go:129 

@chriscool
Copy link
Contributor Author

I rebased to remove debug output.

@chriscool
Copy link
Contributor Author

We get "Unsupported: Exec is not supported by the lxc driver" with CircleCi.

It looks like "docker exec" doesn't work on CircleCi:

https://circleci.com/docs/docker#docker-exec

@chriscool
Copy link
Contributor Author

I think I will have to do something like this:

exec_docker() {
    if test "$CIRCLECI" = 1
    then
        sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' $1)" -- bash -c "$2"
    else
        docker exec -i "$1" /bin/bash -c "2"
    fi
}

@chriscool
Copy link
Contributor Author

There is this error on travis-ci/push:

expecting success: 

        ipfs add -r --hidden mountdir/planets >actual



ok 12 - 'ipfs add -r --hidden' succeeds

expecting success: 

        cat >expected <<-\EOF &&

            added QmcAREBcjgnUpKfyFmUGnfajA1NQS5ydqRp7WfqZ6JF8Dx planets/.asteroids/ceres.txt

            added QmZ5eaLybJ5GUZBNwy24AA9EEDTDpA4B8qXnuN3cGxu2uF planets/.asteroids/pallas.txt

            added Qmf6rbs5GF85anDuoxpSAdtuZPM9D2Yt3HngzjUVSQ7kDV planets/.asteroids

            added QmaowqjedBkUrMUXgzt9c2ZnAJncM9jpJtkFfgdFstGr5a planets/.charon.txt

            added QmU4zFD5eJtRBsWC63AvpozM9Atiadg9kPVTuTrnCYJiNF planets/.pluto.txt

            added QmZy3khu7qf696i5HtkgL2NotsCZ8wzvNZJ1eUdA5n8KaV planets/mars.txt

            added QmQnv4m3Q5512zgVtpbJ9z85osQrzZzGRn934AGh6iVEXz planets/venus.txt

            added QmetajtFdmzhWYodAsZoVZSiqpeJDAiaw2NwbM3xcWcpDj planets

        EOF

        test_cmp expected actual



> diff -u expected actual

--- expected    2015-12-13 14:14:43.270334999 +0000

+++ actual  2015-12-13 14:14:43.258334999 +0000

@@ -1,8 +1,8 @@

-added QmcAREBcjgnUpKfyFmUGnfajA1NQS5ydqRp7WfqZ6JF8Dx planets/.asteroids/ceres.txt

-added QmZ5eaLybJ5GUZBNwy24AA9EEDTDpA4B8qXnuN3cGxu2uF planets/.asteroids/pallas.txt

-added Qmf6rbs5GF85anDuoxpSAdtuZPM9D2Yt3HngzjUVSQ7kDV planets/.asteroids

+added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH planets/.asteroids/ceres.txt

+added QmTF2HDVTJMXWGUkrtAFfQpYxom5A8Tj7S38SzPfGVCD5P planets/.asteroids/pallas.txt

+added Qmed5hbZhHpbTEmmTGiVStW6oMmZqDorNkMwV4aWWbbWPf planets/.asteroids

 added QmaowqjedBkUrMUXgzt9c2ZnAJncM9jpJtkFfgdFstGr5a planets/.charon.txt

 added QmU4zFD5eJtRBsWC63AvpozM9Atiadg9kPVTuTrnCYJiNF planets/.pluto.txt

 added QmZy3khu7qf696i5HtkgL2NotsCZ8wzvNZJ1eUdA5n8KaV planets/mars.txt

 added QmQnv4m3Q5512zgVtpbJ9z85osQrzZzGRn934AGh6iVEXz planets/venus.txt

-added QmetajtFdmzhWYodAsZoVZSiqpeJDAiaw2NwbM3xcWcpDj planets

+added Qma69eGiYgSFiuzUvM5yPDsXyvmGVgaryQE84qYnehCk2r planets

not ok 13 - 'ipfs add -r --hidden' did include . files

@chriscool
Copy link
Contributor Author

On travis-ci/pr there is this error:

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

The build has been terminated

@jbenet
Copy link
Member

jbenet commented Dec 13, 2015

Travis-CI supports Docker on Linux only for now.
Let's use a prereq to not run Docker tests on OSX.

ok

I think I will have to do something like this:

exec_docker()

wow, bummer. maybe put that in a shell scrpt and call it docker-exec, we can call that everywhere we want to do docker exec.

There is this error on travis-ci/push:

the hashes seem different. content somehow different??

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

ugh yeah that sometimes happens. there's some test that hangs travis-- we should look into them. unrelated i think

@jbenet
Copy link
Member

jbenet commented Dec 13, 2015

the closed network connection stuff is odd. probably some issue with the docker networking

@chriscool
Copy link
Contributor Author

Yeah, with the docker_exec() that has a special case for CircleCI it works on CircleCI!
The other build failures are the usual ones on Travis OSX and in the go tests.

@jbenet
Copy link
Member

jbenet commented Dec 16, 2015

@chriscool i think the go test failure here is not a usual one-- i do not think i have seen it on travis without docker.

@chriscool
Copy link
Contributor Author

The got test errors are:

22:15:58.314 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:48529: use of closed network connection swarm_listen.go:129

22:15:58.319 ERROR     swarm2: swarm listener accept error: peerstream listener failed: accept tcp 127.0.0.1:44342: use of closed network connection swarm_listen.go:129

--- FAIL: TestDialWait (0.02s)

    dial_test.go:103: failed to specify addrs: [/ip6/::/tcp/32781]

--- FAIL: TestDialBackoffClears (0.03s)

    dial_test.go:103: failed to specify addrs: [/ip6/::/tcp/41355]

Yeah, they are perhaps related to the Travis CI environment with docker.

@whyrusleeping do you know what in the Travis CI environment with docker could cause those failures?

@whyrusleeping
Copy link
Member

@chriscool i've got the ipv6 stuff fixed now, but it appears that travis and t0042 don't get along well...

@chriscool
Copy link
Contributor Author

@whyrusleeping I think the Travis tests passed except the usual No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself errors.

@chriscool
Copy link
Contributor Author

And one of those failures is on Linux not OSX!
See: https://travis-ci.org/ipfs/go-ipfs/jobs/101416974

@chriscool
Copy link
Contributor Author

It's the one from continuous-integration/travis-ci/pr.

@whyrusleeping
Copy link
Member

LGTM

ChristianKniep and others added 3 commits January 10, 2016 20:19
License: MIT
Signed-off-by: Christian Kniep <christian@qnib.org>
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
We have to do something special for CircleCI in docker_exec()
because "docker exec" doesn't work on CircleCi:

https://circleci.com/docs/docker#docker-exec

We indeed get "Unsupported: Exec is not supported by the lxc
driver" with CircleCi, when using "docker exec".

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
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

Rebased on current master. Let's have a look at the tests.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
whyrusleeping added a commit that referenced this pull request Jan 10, 2016
Docker image volume fix and Sharness tests
@whyrusleeping whyrusleeping merged commit dc4f5af into master Jan 10, 2016
@whyrusleeping whyrusleeping deleted the ipfs-volume branch January 10, 2016 19:55
@momack2 momack2 added this to In Progress in ipfs/go-ipfs May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
ipfs/go-ipfs
In Progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants