aboutsummaryrefslogtreecommitdiff
path: root/tools/docker
Commit message (Collapse)AuthorAge
* Add parallel testingStephen Finucane2020-11-29
| | | | | | | | | | | | | | | | | | | | This saves us a good deal of time, even allowing for process startup and general overhead. Before: real 6m39.103s user 1m9.561s sys 0m2.705s After: real 4m5.267s user 1m24.527s sys 0m3.828s This requires N databases, where N is the N of processors on the host. We need to update the docker configuration for this. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Ignore postgres data fileStephen Finucane2020-04-26
| | | | Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Remove Python 2.7, 3.5Stephen Finucane2020-04-08
| | | | | | We no longer need these dependencies. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Revert "pyenv: also install requirements for python2"Stephen Finucane2020-04-08
| | | | | | | This reverts commit 5b904f91c4cab1ff3f8460c9d4ed920a990c8db3. It is no longer necessary now that we're dropping Python 2.7 support. Signed-off-by: Stephen Finucane <stephen@that.guru>
* pyenv: also install requirements for python2Daniel Axtens2020-02-27
| | | | | | | | | | The first time you do a migration with python3, you get a whole lot of seemingly null changes. This is a bit annoying so I use py2 to generate the changes. To do that, first fix the pyenv transition so requirements are still installed for python2. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* docker: update dependency for current buildPranav Annam2020-02-17
| | | | | | | | | | | | | | | | | | | The dependency libssl1.0-dev in the Dockerfile makes docker build fail: The following packages have unmet dependencies: libmysqlclient-dev : Depends: libssl-dev (>= 1.1.1-1ubuntu2.1~18.04.5~) but it is not going to be installed E: Unable to correct problems, you have held broken packages. There seems to be a conflict with different versions of libssl and libmysqlclient that did not exist previously with Ubuntu 18.04. Just use the current libssl-dev from Ubuntu 18.04 to fix the build. Signed-off-by: Pranav Annam <pranavannam@gmail.com> [rephrased commit message] Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* Python 3.8 supportAndrew Donnellan2019-10-24
| | | | | | | Enable Python 3.8 in our tests and list it as a supported version. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Require GID alsoStephen Finucane2019-10-17
| | | | | | | If you don't do this, created files end up with a group of 'gcc' or whatever group has an ID of 1000. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Rely on cachingStephen Finucane2019-10-17
| | | | | | | | It seems less likely that tox and tox-pyenv will change than our requirements. Split up the 'RUN' steps so we don't have to reinstall the former every time the latter change. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Use pyenv for Python versionsStephen Finucane2019-09-08
| | | | | | | | This is slightly slower to initially configure but requires less hacking to get the same environment and should be a lot more maintainable (just a simple modification to change the Python version). Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Simplify MySQL resetStephen Finucane2019-09-08
| | | | | | Just use the hardcoded configuration. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Drop support for Python 3.4, add Python 3.7Stephen Finucane2019-09-08
| | | | | | | It's no longer supported upstream and the *second* last Ubuntu LTS release provides something newer. Time to move on. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: *Actually* don't require rebuilding if unnecessaryStephen Finucane2019-08-21
| | | | | | | | | | | Because we were using 'set -e', we were erroring out as soon as something - a diff in this case - failed. Temporarily disable it for this one check. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 0b5b4e8c ("docker: Don't require rebuilding if unnecessary") Cc: Daniel Axtens <dja@axtens.net> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Use Ubuntu ports repositories on non-x86 architecturesRussell Currey2019-05-03
| | | | | | | | | | | | | | | | | This should allow Patchwork to run "out of the box" in Docker on any architecture with a) an Ubuntu port and b) support in the Postgres multiarch Docker image, which includes at least arm64 and ppc64le. It's a little gross hacking the Dockerfile like this, but I'm not sure there's a more elegant way to do it. Unfortunately it doesn't seem like there's any way to do conditional COPY, and anything in RUN is plain /bin/sh, so that's why it looks like it does. Tested on ppc64le and on x86_64. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Install libpq-dev to fix psycopg2-binary buildRussell Currey2019-05-03
| | | | | | | | | | | | | | | | | | psycopg2-binary fails if pg_config isn't installed, which is provided by libpq-dev. This seems strange to me since psycopg2-binary suggests that you use psycopg2-binary instead (of itself) if you don't want to build psycopg2 so you wouldn't need pg_config, which is very confusing. It's possible that psycopg2-binary only needs to compile itself on non-x86 platforms, since I hit this on ppc64le. Anyway, it works when this is added. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Use heredocs where possibleStephen Finucane2018-08-30
| | | | | | | | | | This was suggested in a recent review [1]. Make it happen. [1] http://patchwork.ozlabs.org/patch/933979/#1941584 Signed-off-by: Stephen Finucane <stephen@that.guru> Suggested-by: Petr Vorel <petr.vorel@gmail.com> Reviewed-by: Petr Vorel <pvorel@suse.cz>
* docker: Don't require rebuilding if unnecessaryStephen Finucane2018-08-26
| | | | | | | | | | | | | | | Now that we're pinning versions, we're going to see more frequent dependency version changes. Requiring a rebuild after every one of these is tiresome so don't force it and instead display a helpful message merely suggesting that a rebuild may be necessary. Signed-off-by: Stephen Finucane <stephen@that.guru> Cc: Daniel Axtens <dja@axtens.net> Acked-by: Daniel Axtens <dja@axtens.net> [dja: we're not currently pinning versions because I dropped that patch as it broke postgres. But this can stay - sfin has been asking for it for ages.] Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Bump to bionicStephen Finucane2018-04-26
| | | | | | | As noted in commit 94dd1d411, we can and should start using Bionic once it's out. This is now the case. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker-compose: Switch to 3.0 syntaxStephen Finucane2018-04-26
| | | | | | | | | | | Ubuntu 18.04 (Bionic Beaver) providers 'docker-compose' 1.17.1 [1] at release which supports the 3.0 syntax [2]. Using this allows some users (me) to resolve a long standing issue caused by a UID that's not 1000. [1] https://packages.ubuntu.com/bionic/docker-compose [2] https://docs.docker.com/compose/compose-file/ Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Remove bash aliasesStephen Finucane2018-04-26
| | | | | | | | These seem to be a hangover from the Vagrant days. I don't personally use them anymore and I'm not sure anyone else does. I think they can go. Signed-off-by: Stephen Finucane <stephen@that.guru> Cc: Daniel Axtens <dja@axtens.net>
* tests: Remove Selenium testsStephen Finucane2018-04-26
| | | | | | | | | | | | | | | | These were added quite some time ago in order to allow some level of UI testing. However, I've personally never used them, they're not used by the CI, and no one has shown any desire in extending them in their time here. It is time to bid these tests adieu. Removing these allows us to remove a whole load of wiring that existed just to enable these. Some of this, like the '--quick-tox' option for the Dockerfile, is retained so we don't need to use different commands for various versions of Patchwork, but the majority is just stripped out. Signed-off-by: Stephen Finucane <stephen@that.guru> Cc: Daniel Axtens <dja@axtens.net>
* docker: Replace tabs with spacesStephen Finucane2018-04-26
| | | | | | Maintain your chill, people. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: set timezone to Australia/CanberraDaniel Axtens2018-04-05
| | | | | | | | | | | The tzinfo package isn't installed in docker, which makes the default timezone UTC. This is unfortunate: the Django TZ in settings/base.py is Australia/Canberra, and having a non-UTC TZ is good for exposing faulty assumptions about what is and isn't UTC. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* docker: add Python3.6 to imageDaniel Axtens2018-01-26
| | | | | | | | | | | | | | | | | | | This is needed to support py3.6-django111 in tox - otherwise tox fails. Python3.6 is not in Xenial, so this - irritatingly - requires pulling in either a PPA, or the package from Artful. PPAs are icky, so pull it in from Artful. We can either add an Artful repo (like we do for Trusty to pull in python3.4), or move the image to Artful and add in the Xenial repo to get python3.5. It's more efficient to move the entire image to Artful and pull in 3.5 from Xenial - otherwise most packages get downloaded from Artful anyway. It does mean we're going to need to move again to Bionic in a few months, but we'll just have to deal. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Support testing with PostgreSQLDaniel Axtens2017-10-28
| | | | | | | | | | | | | | | | This allows us to easily test against PostgreSQL using the same tooling we normally use. This is helpful in (for example) shaking out the test failures that were observed on ozlabs.org To use it: docker-compose -f docker-compose-pg.yml <usual argument> (You may find in necessary to do a 'docker-compose down' first, depending on what state the system is in and what command you're running.) Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Simplify docker-compose MySQL setupDaniel Axtens2017-10-28
| | | | | | | | This moves the config from a separate Dockerfile to something integrated into the docker-compose.yml file. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* docker: pass additional args to manage.py testSean Farley2017-07-12
| | | | | Signed-off-by: Sean Farley <sean@farley.io> Reviewed-by: Stephen Finucane <stephen@that.guru>
* docker: increase database connection timeoutAndrew Donnellan2017-05-26
| | | | | | | | | | | | | | | When starting the Docker environment, if the web container can't see the database immediately, it waits 5 seconds, tries again, then waits 15 seconds more to account for first-time start-ups where it takes a bit longer for the database to be initialised. Some of us, unfortunately, have slow computers with slow mechanical hard drives which take just a bit longer. Increase the second timeout from 15 seconds to 60 seconds, testing every 5 seconds. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* templates: Add Patchwork versionStephen Finucane2017-03-01
| | | | | | | | | | | | This is managed using a combination of hardcoded string, for installations from tarball, and 'git describe', for installations from a Git repo. This includes installing Git in the Docker environment, to enable this in the development environment. Signed-off-by: Stephen Finucane <stephen@that.guru> Acked-by: Daniel Axtens <dja@axtens.net>
* docker: Install dependencies for Python 2 alsoStephen Finucane2016-09-20
| | | | | | | | | | Aspects of both Patchwork and Django, such as the 'makemigrations' management command, function differently under Python 3. It should be possible to run these commands under Python 2. Install dependencies in the Python 2 environment to make this a possibility. Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Acked-by: Daniel Axtens <dja@axtens.net>
* docker: Install Python 3.4Daniel Axtens2016-09-01
| | | | | | | | | | | | | | | | Currently, we tox test against Python 3.4. Python 3.4 is included with Ubuntu 14.04, which is supported for several years to come, so we want to keep supporting it. However, Python 3.4 isn't included with Ubuntu 16.04, which is what the Docker image is based on. We could downgrade the container to 14.04, but then we'd struggle to get Python 3.5 into the container. Python 3.5 is the most recent in the Python 3 series, so we should also be supporting it. Add the apt sources for Trusty and pull in Python 3.4 from there. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
* docs: Document SELinux issuesStephen Finucane2016-09-01
| | | | | | | | Initial Docker setup caused me some heartache on Fedora. Briefly document the issues encountered to help other users. Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Reviewed-by: Daniel Axtens <dja@axtens.net>
* docker: Move 'docker' directory to 'tools'Stephen Finucane2016-09-01
...like the Vagrant scripts (which have been renamed also). Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Acked-by: Daniel Axtens <dja@axtens.net>