Add docker files for testing the playpen snaps #195

Merged
merged 3 commits into from Aug 10, 2016

Conversation

Projects
None yet
2 participants
Member

elopio commented Jul 25, 2016


   

Member

elopio commented Jul 25, 2016

I think it's better to keep all the resources we need for testing in the same repository.
The docker-lts image is a copy from didrocks' ubuntu/docker-snapcraft. The other one is for testing the build using snapcraft from master.

I still can't make the autobuild job in docker hub. @didrocks could you do it for me or give me more permissions?

Once the autobuild is ready, I will modify the travis file to get the image name as an argument. It will default to use the snapcraft in xenial, but we will be able to trigger another job in response to changes in snapcraft that uses the other docker image.

testing/docker-master/Dockerfile
+# build and install snapcraft from master.
+git clone https://github.com/snapcore/snapcraft
+cd snapcraft
+apt build-dep -y ./
@didrocks

didrocks Jul 26, 2016

Owner

I would probably clean the build-dep in the image after building the package to keep the docker container as close to a vanilla install as possible.

@elopio

elopio Jul 26, 2016

Member

That sounds great, but I don't know how to do it. Is there a way to get the list of packages that will be installed by apt ? I can't just remove all the dependencies, because some of them were already preinstalled in the machine.

@didrocks

didrocks Jul 27, 2016

Owner

I'm unsure how apt build-dep works (if they mark the deps as autoinstalled). If so, you can just run sudo apt autoremove --purge once you installed your local .deb (so last step).

If not, you can revert to the old way of doing this build-dep install:
https://github.com/ubuntu/ubuntu-make/blob/master/Dockerfile#L53
mk-build-deps, then removing the local .deb for build-deps, and finally apt autoclean as well.

Tell me how it goes :)

@elopio

elopio Aug 9, 2016

Member

@didrocks I tried the autoremove --purge, but it doesn't remove packages like python3-fixtures that are only build dependencies.
I added them to the remove statement. It sucks, because it can get out of date, but works for now. Pushed for a new review. Thank you!

Owner

didrocks commented Jul 26, 2016

Excellent Leo!

We did the autobuild with a webhook which is pushing a daily signal to tell to rebuild the package version of docker. For the one from master, I guess, the trigger is from any new commit in the snapcraft tree. I'll have a look if I can do this (I'm unsure if docker is taking subdirectories though for those use case or expect the DockerFile to be in the root of the repo).

Something else: can you please exclude the testing/ directory in ci-run so that the test doesn't try to build a snap?

Member

elopio commented Jul 26, 2016

I think both will rebuild on any change on the playpen, and we can add a trigger from changes in snapcraft master too.
I excluded the testing dir.

Owner

didrocks commented Jul 27, 2016

Ok, this looks good to me, let's see once it's merged how you can create a couple of new docker images from this branch (I'm interested, I didn't know this was possible). I'll let you handle that part and watch closely :)

Owner

didrocks commented Jul 27, 2016

👍

Owner

didrocks commented Aug 10, 2016

:shipit:

Owner

didrocks commented Aug 10, 2016

Sorry, I did miss the followup fixes! Everything looks good (yeah, let's do that for build-deps for now, good enough!).

I'll let you setup the dockerhub project under the common namespace then!

@didrocks didrocks merged commit 561ac81 into Ubuntu:master Aug 10, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@elopio elopio deleted the elopio:docker branch Aug 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment