juju-solutions / review-queue

Juju Review Queue webapp
4 stars 4 forks source link

tests failing because of new charmbox #63

Open kwmonroe opened 7 years ago

kwmonroe commented 7 years ago

Example failure:

http://juju-ci.vapour.ws/job/charm-bundle-test-gce/221/console

+ sudo docker run --rm -u ubuntu -e HOME=/home/ubuntu -e JUJU_HOME=/home/ubuntu/.juju -w /home/ubuntu -v /tmp/tmp.SpieI11sQS:/home/ubuntu/.juju -v /tmp/tmp.5f1NQG31rz/.deployer-store-cache:/home/ubuntu/.juju/.deployer-store-cache -v /tmp/tmp.rInmhKSrLj:/home/ubuntu/charm-repo -v /tmp/tmp.5f1NQG31rz:/tmp/tmp.5f1NQG31rz -v /tmp/tmp.5f1NQG31rz/ssh:/home/ubuntu/.ssh -t jujusolutions/charmbox:latest sh -c 'bzr whoami '\''Tim Van Steenburgh <tvansteenburgh@gmail.com>'\'' && sudo bundletester -F -e charm-testing-gce -t cs:~ibmcharmers/trusty/websphere-liberty-4 -l DEBUG -v -r json -o /tmp/tmp.5f1NQG31rz/results.json '
Welcome to jujubox version 2.0.1-xenial-amd64
]0;ubuntu@62b2d24c6107: ~ubuntu@62b2d24c6107:~$ Build timed out (after 60 minutes). Marking the build as failed.
Build was aborted
Archiving artifacts
[description-setter] Description set: 
Finished: FAILURE

charmbox now uses an ENTRYPOINT instead of a CMD. this means the revq tests cannot docker run ... sh -c <blah>. Instead, docker run needs to override the entrypoint with bash. This is similar to how we fixed build-cloud:

https://github.com/juju-solutions/build-cloud/pull/86/files

mbruzek commented 7 years ago

Here is an example from my jenkins job that runs some commands in jujubox:

docker run --rm -v /var/lib/jenkins/jobs/kubernetes-e2e-gce/workspace/juju:/home/ubuntu/.local/share/juju -v /var/lib/jenkins/jobs/kubernetes-e2e-gce/workspace:/home/ubuntu/workspace --entrypoint /bin/bash jujusolutions/jujubox:latest -c 'sudo chown -R ubuntu:ubuntu /home/ubuntu/.local/share/juju && juju add-model jenkins-kubernetes-e2e-gce-2'

Basically --entrypoint /bin/bash has to be before the name of the container, and -c 'command' has to be after the name of the container if you want to run the command and see the output in the log.

kwmonroe commented 7 years ago

Yup, the pertinent bits are this:

docker run ... jujusolutions/charmbox sh -c '<cmd>'

needs to become this:

docker run ... --entrypoint /bin/bash jujusolutions/charmbox -c '<cmd>'

The "-c " will get passed to the entrypoint, so it effectively has the same result as an "sh -c ". I'm looking the revq app, but so far, don't see where the docker run is coming from...

marcoceppi commented 7 years ago

It's in the Jenkins job, which is not part of the review queue infrastructure, per se.

tvansteenburgh commented 7 years ago

Thanks for the bug report. For reference, this will need to be fixed here: https://github.com/tvansteenburgh/jenkins-charm-bundle-slave/blob/master/build-cloud.sh

Yeah, we should probably move that repo.

kwmonroe commented 7 years ago

@tvansteenburgh thanks for the pointer! PR opened:

https://github.com/tvansteenburgh/jenkins-charm-bundle-slave/pull/1

tvansteenburgh commented 7 years ago

Merged and installed on the jenkins host.

tvansteenburgh commented 7 years ago

The jenkins host and the build-cloud.sh script referenced above need to be updated to use juju2 by default. Right now it's still on juju1, which is why we're getting test errors - the host is on juju1 but the container is using juju2. juju2 is installed on the jenkins machine, it just needs to become the default juju. And there may need to be some fiddling with clouds/controllers/credentials to make sure we have access to the same clouds that we have currently.