From patchwork Fri May 3 22:21:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1095067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wmpg2jLGz9sD4 for ; Sat, 4 May 2019 08:22:35 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="sNxDthcp"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44wmpg1dVvzDqGJ for ; Sat, 4 May 2019 08:22:35 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=199.181.239.188; helo=relay0188.mxlogin.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="sNxDthcp"; dkim-atps=neutral Received: from relay0188.mxlogin.com (relay0188.mxlogin.com [199.181.239.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44wmnq4GGxzDqZ2 for ; Sat, 4 May 2019 08:21:51 +1000 (AEST) Received: from filter001.mxrelay.co (unknown [116.203.155.46]) by relay0188.mxlogin.com (Postfix) with ESMTP id 6B442CC70314; Fri, 3 May 2019 17:21:24 -0500 (CDT) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter001.mxrelay.co (Postfix) with ESMTPS id A0E6910003F; Fri, 3 May 2019 22:21:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=px91YGuNdOKbVMnmfCBqcMeaZHS+srZ3vH2ejV2B1/o=; b=sNxDthcp2svuuX1gFLID4UAMDJ PjhBKvYVNz2SbsheEaKnDYruK5dXNchsV620rsJ418wxNLO9WIXf+5xOBfSqT6NMnx4WLXTj7d0Ob kZdldX0UJp4swahTKJFWxCph953Y8Q//dRPkYeegB0obC38SnH5rtrgLIn2ICXnVGZybtCGuPpRop bhCD9kfhR/nqMSFTjqrLdtk1efPd480cY9PS5H6DFLW93JGmEOeU9iSQfnEeAOGzM9fKatfUveasO RPpWcuM5GysnU5HrfaTRAPKKto3rWX2SvB+GYbLVFV79lu7HuP2XwIm8BjPA2TWXXNjNNf2laIiN3 lYodiDtw==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 4/4] docker-compose: Massively simplify Date: Fri, 3 May 2019 16:21:10 -0600 Message-Id: <20190503222110.562-5-stephen@that.guru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503222110.562-1-stephen@that.guru> References: <20190503222110.562-1-stephen@that.guru> MIME-Version: 1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Now that we can run tox on the localhost, we no longer need to install the variety of Python versions we previously did and can keep this purely for the 'manage.py' use cases. Note that we're also able to remove the 'libmysqlclient-dev' and 'mysql-client' packages thanks to our switch to 'PyMySQL', which is pure Python. Signed-off-by: Stephen Finucane --- tools/docker/Dockerfile | 22 ++-------------------- tools/docker/entrypoint.sh | 4 ++-- tools/docker/trusty-ports.list | 3 --- tools/docker/trusty.list | 3 --- tools/docker/xenial-ports.list | 3 --- tools/docker/xenial.list | 3 --- tox.ini | 15 ++++++++++++++- 7 files changed, 18 insertions(+), 35 deletions(-) delete mode 100644 tools/docker/trusty-ports.list delete mode 100644 tools/docker/trusty.list delete mode 100644 tools/docker/xenial-ports.list delete mode 100644 tools/docker/xenial.list diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 76bb6b2b..5653ec89 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -17,26 +17,10 @@ ENV PYTHONUNBUFFERED 1 # System -# trusty and findutils is for python3.4; xenial is for python3.5 -# TODO(stephenfin): Are curl, unzip required? -COPY tools/docker/*.list /etc/apt/sources.list.d/ - -RUN cd /etc/apt/sources.list.d; \ - echo $(uname -m) > /tmp/arch; \ - if [ $(cat /tmp/arch) != 'x86_64' ] && grep -q -v "i.86" /tmp/arch; then \ - mv trusty-ports.list trusty.list; \ - mv xenial-ports.list xenial.list; \ - else \ - rm *-ports.list; \ - fi - RUN apt-get update -qq && \ apt-get install -y --no-install-recommends --allow-downgrades \ - python-dev python-pip python-setuptools python-wheel \ - python3.5-dev python3-pip python3-setuptools python3-wheel \ - python3.4-dev findutils=4.4.2-7 python3.6-dev \ - libmysqlclient-dev mysql-client curl unzip build-essential \ - git postgresql-client tzdata libpq-dev + python3-dev python3-pip python3-setuptools python3-wheel \ + postgresql-client tzdata # User RUN useradd --uid=$UID --create-home patchwork @@ -51,8 +35,6 @@ RUN rm /etc/localtime; ln -s /usr/share/zoneinfo/$TZ /etc/localtime COPY requirements-*.txt /tmp/ RUN pip3 install virtualenv tox && \ pip3 install -r /tmp/requirements-dev.txt -RUN pip2 install virtualenv tox && \ - pip2 install -r /tmp/requirements-dev.txt # we deliberately leave the requirements files in tmp so we can # ping the user in entrypoint.sh if the change them! diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index 32f7132a..b28de5a0 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -124,8 +124,8 @@ elif [ "$1" == "--test" ] || [ "$1" == "--quick-test" ]; then shift python3 manage.py test $@ elif [ "$1" == "--tox" ] || [ "$1" == "--quick-tox" ]; then - shift - tox $@ + echo "tox is no longer installed here; use e.g. 'tox -e py36-django21-mysql' instead" + exit 0 else # run whatever CMD is set to $@ fi diff --git a/tools/docker/trusty-ports.list b/tools/docker/trusty-ports.list deleted file mode 100644 index ebcf4fa4..00000000 --- a/tools/docker/trusty-ports.list +++ /dev/null @@ -1,3 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ trusty main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main diff --git a/tools/docker/trusty.list b/tools/docker/trusty.list deleted file mode 100644 index 8bb92c09..00000000 --- a/tools/docker/trusty.list +++ /dev/null @@ -1,3 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ trusty main -deb http://archive.ubuntu.com/ubuntu/ trusty-updates main -deb http://security.ubuntu.com/ubuntu trusty-security main diff --git a/tools/docker/xenial-ports.list b/tools/docker/xenial-ports.list deleted file mode 100644 index d84641fa..00000000 --- a/tools/docker/xenial-ports.list +++ /dev/null @@ -1,3 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ xenial main -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main diff --git a/tools/docker/xenial.list b/tools/docker/xenial.list deleted file mode 100644 index a70ff56a..00000000 --- a/tools/docker/xenial.list +++ /dev/null @@ -1,3 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ xenial main -deb http://archive.ubuntu.com/ubuntu/ xenial-updates main -deb http://security.ubuntu.com/ubuntu xenial-security main diff --git a/tox.ini b/tox.ini index 86fb62e1..22291748 100644 --- a/tox.ini +++ b/tox.ini @@ -90,7 +90,20 @@ deps = commands = pylint patchwork --rcfile=pylint.rc [testenv:venv] -commands = {posargs} +deps = + -rrequirements-dev.txt +docker = + postgres:9.6 +setenv = + PW_TEST_DB_TYPE = postgres + PW_TEST_DB_USER = postgres + PW_TEST_DB_PASS = password + PGPASSWORD = password +dockerenv = + POSTGRES_PASSWORD=password +commands = + sleep 5 + {posargs} [testenv:coverage] basepython = python2.7