From 49f7e691822e7c1161a21952977d90e685be83e5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 29 Jun 2019 16:52:19 -0700 Subject: [PATCH 01/30] use --forked instead of --boxed with pytest --- build.py | 2 +- requirements/devel.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 429c4dec..6aa011bb 100755 --- a/build.py +++ b/build.py @@ -1290,7 +1290,7 @@ def cmd_test(options, args, tests=None): # -n is the number of processes to run in parallel # --timeout will kill the test process if it gets stuck jobs = '-n{}'.format(options.pytest_jobs) if options.pytest_jobs else '' - boxed = '--boxed' if not isWindows else '' + boxed = '--forked' if not isWindows else '' sec = options.pytest_timeout timeout = '--timeout={}'.format(sec) if sec and sec != "0" else '' cmd = '"{}" -m pytest {} {} {} {} {} '.format( diff --git a/requirements/devel.txt b/requirements/devel.txt index d558945c..7233f712 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -8,4 +8,5 @@ sphinx requests pytest pytest-xdist +pytest-forked pytest-timeout From af3e2ce5825f16ca961f72e9df3f1bd9e3ba36cd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 13 Apr 2018 15:44:44 -0700 Subject: [PATCH 02/30] start playing with Docker --- docker/ubuntu-18.04/Dockerfile | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docker/ubuntu-18.04/Dockerfile diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile new file mode 100644 index 00000000..2c28710a --- /dev/null +++ b/docker/ubuntu-18.04/Dockerfile @@ -0,0 +1,45 @@ + +# The base image +FROM ubuntu:18.04 + +# Set environment variables +ENV HOME /root + +# Define working directory +WORKDIR $HOME + + +# Install packages and setup environments +RUN \ +## add-apt-repository ppa:deadsnakes/ppa ## Not yet available for bionic + apt update && \ + apt install -y build-essential dpkg-dev && \ + apt install -y libgtk2.0-dev libgtk-3-dev && \ + apt install -y libjpeg-dev libtiff-dev \ + libsdl1.2-dev libgstreamer-plugins-base1.0-dev \ + libnotify-dev freeglut3 freeglut3-dev libsm-dev \ + libwebkitgtk-dev libwebkitgtk-3.0-dev && \ + \ +# Install all available Python packages and their dev packages, and create some virtualenvs + apt install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv && \ + apt install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv && \ + apt install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv && \ + \ + mkdir $HOME/venvs && \ + cd $HOME && \ + virtualenv --python=python2.7 venvs/Py27 && \ + python3.6 -m venv venvs/Py36 && \ + python3.7 -m venv venvs/Py37 && \ + echo "Done with setup" + + +# Add files from host into the container +# ... ??? + + +# Define moiunt-points for shared folders +VOLUME $HOME/dist + +# Define default command +CMD ["bash"] + From cad5411ae336be086e90d011400561d50c4f806f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 26 Jun 2019 19:14:33 -0700 Subject: [PATCH 03/30] Complete Dockerfile and build script for ubuntu-18.04 --- docker/scripts/do-build.sh | 90 ++++++++++++++++++++++++++++++++++ docker/scripts/hello.sh | 2 + docker/ubuntu-18.04/Dockerfile | 88 +++++++++++++++++++++------------ 3 files changed, 148 insertions(+), 32 deletions(-) create mode 100755 docker/scripts/do-build.sh create mode 100755 docker/scripts/hello.sh diff --git a/docker/scripts/do-build.sh b/docker/scripts/do-build.sh new file mode 100755 index 00000000..85e238e7 --- /dev/null +++ b/docker/scripts/do-build.sh @@ -0,0 +1,90 @@ +#!/bin/bash +#-------------------------------------------------------------------------- +# This script is run in the Docker containers performs the actual build of +# Phoenix. It expects to find a source tarball in ../../dist, (which is +# mapped to ~/dist in the container). +#-------------------------------------------------------------------------- +set -o errexit + +# This is the name of the virtual environment to be built. They should all be +# named like Py27, Py35, etc. If "all" is given then all the environments in +# ~/venvs will be used for a build. +PYENV=$1 +if [ "$PYENV" == "" ]; then + PYENV=all +fi + +# Either "gtk2", "gtk3" or "all" +PORT=$2 +if [ "$PORT" == "" ]; then + PORT=all +fi + +TARBALL=$(ls ~/dist/wxPython-*.tar.gz) +if [ "$TARBALL" == "" ]; then + echo "ERROR: Source tarball not found." + exit 1 +fi + + +# This function is called to do each build. +# It is given the Python virtualenv to be used, a tag (gtk2 or gtk3) to be +# used to help name the target folder, and an optional flag (--gtk3) to be +# passed on the build.py command line. +function do_build { + VENV=$1 + TAG=$2 + FLAG=$3 + + rm -rf ~/wxPython-* + + # setup + echo "**** do_build $VENV $TAG $FLAG ****" + echo "Using Python from VENV $VENV" + ORIG_PATH=$PATH + export PATH=$VENV/bin:$PATH + echo PYTHON: $(which python) + echo $(python -c "import sys; print(sys.version)") + + echo "Unpacking source archive..." + tar xzf $TARBALL + + # move into the source tree + cd ~/wxPython-* + + # update packages + pip install -U pip + pip install -U -r requirements.txt + + # Build wxWidgets, Phoenix and a Wheel + # Since we're using a source tarball we don't need to do all the code + # generation parts, all files should already be present + python build.py $FLAG build_wx build_py bdist_wheel + + # copy the results back to the host's shared dist folder + WXPYVER=$(python -c "import buildtools; buildtools.printVersion()") + DEST=~/dist/linux/$TAG/$DIST_NAME + mkdir -p $DEST + mv dist/*.whl $DEST + + # clean up + cd ~ + rm -rf ~/wxPython-* + export PATH=$ORIG_PATH +} + + +# Do a build for each Python virtual environment in ~/venvs +for VENV in ~/venvs/*; do + if [ $PYENV = all -o $PYENV = $(basename $VENV) ]; then + # build a package for GTK2? + if [ $PORT = all -o $PORT = gtk2 ]; then + do_build $VENV gtk2 --gtk2 + fi + # build a package for GTK3? + if [ $PORT = all -o $PORT = gtk3 ]; then + do_build $VENV gtk3 --gtk3 + fi + fi +done + diff --git a/docker/scripts/hello.sh b/docker/scripts/hello.sh new file mode 100755 index 00000000..9f1ed4c9 --- /dev/null +++ b/docker/scripts/hello.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo Hello World diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index 2c28710a..d662bb3e 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -3,43 +3,67 @@ FROM ubuntu:18.04 # Set environment variables -ENV HOME /root +ENV DIST_NAME=ubuntu-18.04 +ENV USE_DEADSNAKES=no +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH -# Define working directory -WORKDIR $HOME - - -# Install packages and setup environments +# Update and install basic OS packages RUN \ -## add-apt-repository ppa:deadsnakes/ppa ## Not yet available for bionic - apt update && \ - apt install -y build-essential dpkg-dev && \ - apt install -y libgtk2.0-dev libgtk-3-dev && \ - apt install -y libjpeg-dev libtiff-dev \ - libsdl1.2-dev libgstreamer-plugins-base1.0-dev \ - libnotify-dev freeglut3 freeglut3-dev libsm-dev \ - libwebkitgtk-dev libwebkitgtk-3.0-dev && \ - \ -# Install all available Python packages and their dev packages, and create some virtualenvs - apt install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv && \ - apt install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv && \ - apt install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv && \ - \ - mkdir $HOME/venvs && \ - cd $HOME && \ - virtualenv --python=python2.7 venvs/Py27 && \ - python3.6 -m venv venvs/Py36 && \ - python3.7 -m venv venvs/Py37 && \ - echo "Done with setup" + adduser --disabled-password --gecos "" ${USER}; \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y \ + apt-utils \ + build-essential \ + software-properties-common; \ +# Install development packages needed for building wxPython + apt-get install -y \ + freeglut3 \ + freeglut3-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libgstreamer-plugins-base1.0-dev \ + libgtk-3-dev \ + libgtk2.0-dev \ + libjpeg-dev \ + libnotify-dev \ + libsdl2-dev \ + libsm-dev \ + libtiff-dev \ + libwebkit2gtk-4.0-dev \ + libwebkitgtk-dev \ + libxtst-dev; \ + apt-get clean; +# Install all available Python packages and their dev packages +RUN \ + if [ ${USE_DEADSNAKES} = yes ]; then add-apt-repository ppa:deadsnakes/ppa; apt-get update; fi; \ + apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \ + apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv; \ + apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \ + apt-get clean; + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + mkdir -p ${HOME}/dist; \ + virtualenv --python=python2.7 venvs/Py27; \ + python3.6 -m venv venvs/Py36; \ + python3.7 -m venv venvs/Py37; # Add files from host into the container -# ... ??? - - -# Define moiunt-points for shared folders -VOLUME $HOME/dist +COPY scripts ${HOME}/bin # Define default command -CMD ["bash"] +CMD ["/bin/bash", "-l"] From a867674859cb1f0ce90f6ee90d8e05de9b4f389e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 09:42:10 -0700 Subject: [PATCH 04/30] Move the dist folder to the root --- docker/scripts/do-build.sh | 16 +++++++++++----- docker/scripts/hello.sh | 6 +++++- docker/ubuntu-18.04/Dockerfile | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docker/scripts/do-build.sh b/docker/scripts/do-build.sh index 85e238e7..5cf23c2a 100755 --- a/docker/scripts/do-build.sh +++ b/docker/scripts/do-build.sh @@ -1,8 +1,14 @@ #!/bin/bash #-------------------------------------------------------------------------- -# This script is run in the Docker containers performs the actual build of -# Phoenix. It expects to find a source tarball in ../../dist, (which is -# mapped to ~/dist in the container). +# This script is run inside the Docker containers to perform the actual build +# of Phoenix. It expects to find a source tarball in a host folder (such as +# $PHOENIX_DIR/dist) which is mapped to `/dist` in the container. This can be +# accomplished by passing an arg like this to docker when running the build: +# +# docker -v $PWD/../dist:/dist ... +# +# The results of the build will be copied to a `linux` subfolder in the same +# location. #-------------------------------------------------------------------------- set -o errexit @@ -20,7 +26,7 @@ if [ "$PORT" == "" ]; then PORT=all fi -TARBALL=$(ls ~/dist/wxPython-*.tar.gz) +TARBALL=$(ls /dist/wxPython-*.tar.gz) if [ "$TARBALL" == "" ]; then echo "ERROR: Source tarball not found." exit 1 @@ -63,7 +69,7 @@ function do_build { # copy the results back to the host's shared dist folder WXPYVER=$(python -c "import buildtools; buildtools.printVersion()") - DEST=~/dist/linux/$TAG/$DIST_NAME + DEST=/dist/linux/$TAG/$DIST_NAME mkdir -p $DEST mv dist/*.whl $DEST diff --git a/docker/scripts/hello.sh b/docker/scripts/hello.sh index 9f1ed4c9..5989faac 100755 --- a/docker/scripts/hello.sh +++ b/docker/scripts/hello.sh @@ -1,2 +1,6 @@ #!/bin/bash -echo Hello World +echo "Hello World, from wxPython's build container on $DIST_NAME" +echo " User: " $(whoami) +echo " ~/bin: " $(ls ~/bin) +echo " ~/venvs:" $(ls ~/venvs) +echo " /dist: " $(ls /dist) diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index d662bb3e..9d658c3d 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -1,4 +1,3 @@ - # The base image FROM ubuntu:18.04 @@ -12,7 +11,9 @@ ENV PATH=$HOME/bin:$PATH # Update and install basic OS packages RUN \ + mkdir -p /dist; \ adduser --disabled-password --gecos "" ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ apt-get update; \ apt-get upgrade -y; \ apt-get install -y \ @@ -56,7 +57,6 @@ WORKDIR ${HOME} RUN \ cd ${HOME}; \ mkdir -p ${HOME}/venvs; \ - mkdir -p ${HOME}/dist; \ virtualenv --python=python2.7 venvs/Py27; \ python3.6 -m venv venvs/Py36; \ python3.7 -m venv venvs/Py37; From e553bdca3a65032f7d386bf9b14e92ef5256d28b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 09:47:28 -0700 Subject: [PATCH 05/30] Add Dockerfiles for 14.04 and 16.04 --- docker/ubuntu-14.04/Dockerfile | 72 ++++++++++++++++++++++++++++++++++ docker/ubuntu-16.04/Dockerfile | 70 +++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 docker/ubuntu-14.04/Dockerfile create mode 100644 docker/ubuntu-16.04/Dockerfile diff --git a/docker/ubuntu-14.04/Dockerfile b/docker/ubuntu-14.04/Dockerfile new file mode 100644 index 00000000..e3d970cf --- /dev/null +++ b/docker/ubuntu-14.04/Dockerfile @@ -0,0 +1,72 @@ +# The base image +FROM ubuntu:14.04 + +# Set environment variables +ENV DIST_NAME=ubuntu-14.04 +ENV USE_DEADSNAKES=yes +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH + +# Update and install basic OS packages +RUN \ + mkdir -p /dist; \ + adduser --disabled-password --gecos "" ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y \ + apt-utils \ + build-essential \ + software-properties-common; \ +# Install development packages needed for building wxPython + apt-get install -y \ + freeglut3 \ + freeglut3-dev \ + libegl1-mesa-dev \ + libgl1-mesa-dev \ + libgles2-mesa-dev \ + libglu1-mesa-dev \ + libgstreamer-plugins-base1.0-dev \ + libgtk-3-dev \ + libgtk2.0-dev \ + libjpeg-dev \ + libnotify-dev \ + libsdl2-dev \ + libsm-dev \ + libtiff-dev \ + libwebkitgtk-3.0-dev \ + libwebkitgtk-dev \ + libxtst-dev; \ + apt-get clean; + + +# Install all available Python packages and their dev packages +RUN \ + if [ ${USE_DEADSNAKES} = yes ]; then add-apt-repository ppa:deadsnakes/ppa; apt-get update; fi; \ + apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \ + apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv; \ + apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv; \ + apt-get clean; + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + virtualenv --python=python2.7 venvs/Py27; \ + python3.5 -m venv venvs/Py35; \ + python3.6 -m venv venvs/Py36; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + diff --git a/docker/ubuntu-16.04/Dockerfile b/docker/ubuntu-16.04/Dockerfile new file mode 100644 index 00000000..ddc91e4b --- /dev/null +++ b/docker/ubuntu-16.04/Dockerfile @@ -0,0 +1,70 @@ +# The base image +FROM ubuntu:16.04 + +# Set environment variables +ENV DIST_NAME=ubuntu-16.04 +ENV USE_DEADSNAKES=yes +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH + +# Update and install basic OS packages +RUN \ + mkdir -p /dist; \ + adduser --disabled-password --gecos "" ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y \ + apt-utils \ + build-essential \ + software-properties-common; \ +# Install development packages needed for building wxPython + apt-get install -y \ + freeglut3 \ + freeglut3-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libgstreamer-plugins-base1.0-dev \ + libgtk-3-dev \ + libgtk2.0-dev \ + libjpeg-dev \ + libnotify-dev \ + libsdl2-dev \ + libsm-dev \ + libtiff-dev \ + libwebkitgtk-3.0-dev \ + libwebkitgtk-dev \ + libxtst-dev; \ + apt-get clean; + + +# Install all available Python packages and their dev packages +RUN \ + if [ ${USE_DEADSNAKES} = yes ]; then add-apt-repository ppa:deadsnakes/ppa; apt-get update; fi; \ + apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \ + apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv; \ + apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \ + apt-get clean; + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + virtualenv --python=python2.7 venvs/Py27; \ + python3.6 -m venv venvs/Py36; \ + python3.7 -m venv venvs/Py37; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + From 1d7e08ff09ec87365e27463ad2001175a7cb3e13 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 15:30:03 -0700 Subject: [PATCH 06/30] install nano, just in case an editor is needed --- docker/ubuntu-14.04/Dockerfile | 5 +++-- docker/ubuntu-16.04/Dockerfile | 5 +++-- docker/ubuntu-18.04/Dockerfile | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docker/ubuntu-14.04/Dockerfile b/docker/ubuntu-14.04/Dockerfile index e3d970cf..c92aeaf4 100644 --- a/docker/ubuntu-14.04/Dockerfile +++ b/docker/ubuntu-14.04/Dockerfile @@ -1,4 +1,4 @@ -# The base image +# The base image (v14.04 = "trusty") FROM ubuntu:14.04 # Set environment variables @@ -19,7 +19,8 @@ RUN \ apt-get install -y \ apt-utils \ build-essential \ - software-properties-common; \ + software-properties-common \ + nano; \ # Install development packages needed for building wxPython apt-get install -y \ freeglut3 \ diff --git a/docker/ubuntu-16.04/Dockerfile b/docker/ubuntu-16.04/Dockerfile index ddc91e4b..08b81037 100644 --- a/docker/ubuntu-16.04/Dockerfile +++ b/docker/ubuntu-16.04/Dockerfile @@ -1,4 +1,4 @@ -# The base image +# The base image (v16.04 = "xenial") FROM ubuntu:16.04 # Set environment variables @@ -19,7 +19,8 @@ RUN \ apt-get install -y \ apt-utils \ build-essential \ - software-properties-common; \ + software-properties-common \ + nano; \ # Install development packages needed for building wxPython apt-get install -y \ freeglut3 \ diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index 9d658c3d..9bd3a29a 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -1,4 +1,4 @@ -# The base image +# The base image (v18.04 = "bionic") FROM ubuntu:18.04 # Set environment variables @@ -19,7 +19,8 @@ RUN \ apt-get install -y \ apt-utils \ build-essential \ - software-properties-common; \ + software-properties-common \ + nano; \ # Install development packages needed for building wxPython apt-get install -y \ freeglut3 \ From 4a0436ae7ce91531a65ff0bafaec9c0b5c076588 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 16:02:12 -0700 Subject: [PATCH 07/30] Add flag to specify if GTK builds are supported --- docker/scripts/do-build.sh | 11 ++++++++++- docker/scripts/hello.sh | 5 +++++ docker/ubuntu-14.04/Dockerfile | 1 + docker/ubuntu-16.04/Dockerfile | 1 + docker/ubuntu-18.04/Dockerfile | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docker/scripts/do-build.sh b/docker/scripts/do-build.sh index 5cf23c2a..72c013ee 100755 --- a/docker/scripts/do-build.sh +++ b/docker/scripts/do-build.sh @@ -32,6 +32,11 @@ if [ "$TARBALL" == "" ]; then exit 1 fi +if [ $PYENV != all -a ! -d ~/venv/$PYENV ]; then + echo "ERROR: The $PYENV environment not found in the $DIST_NAME image." + exit 1 +fi + # This function is called to do each build. # It is given the Python virtualenv to be used, a tag (gtk2 or gtk3) to be @@ -42,6 +47,11 @@ function do_build { TAG=$2 FLAG=$3 + if [ $TAG = gtk2 -a $GTK2_OK = no ]; then + echo "The $DIST_NAME image does not support building for GTK2." + return + fi + rm -rf ~/wxPython-* # setup @@ -68,7 +78,6 @@ function do_build { python build.py $FLAG build_wx build_py bdist_wheel # copy the results back to the host's shared dist folder - WXPYVER=$(python -c "import buildtools; buildtools.printVersion()") DEST=/dist/linux/$TAG/$DIST_NAME mkdir -p $DEST mv dist/*.whl $DEST diff --git a/docker/scripts/hello.sh b/docker/scripts/hello.sh index 5989faac..3060b2fa 100755 --- a/docker/scripts/hello.sh +++ b/docker/scripts/hello.sh @@ -4,3 +4,8 @@ echo " User: " $(whoami) echo " ~/bin: " $(ls ~/bin) echo " ~/venvs:" $(ls ~/venvs) echo " /dist: " $(ls /dist) +echo "" + +if [ -x /usr/bin/lsb_release ]; then + /usr/bin/lsb_release -a +fi diff --git a/docker/ubuntu-14.04/Dockerfile b/docker/ubuntu-14.04/Dockerfile index c92aeaf4..40ecb919 100644 --- a/docker/ubuntu-14.04/Dockerfile +++ b/docker/ubuntu-14.04/Dockerfile @@ -8,6 +8,7 @@ ENV USER=wxpy ENV HOME=/home/$USER ENV PYTHONUNBUFFERED=1 ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=yes # Update and install basic OS packages RUN \ diff --git a/docker/ubuntu-16.04/Dockerfile b/docker/ubuntu-16.04/Dockerfile index 08b81037..0c263b5f 100644 --- a/docker/ubuntu-16.04/Dockerfile +++ b/docker/ubuntu-16.04/Dockerfile @@ -8,6 +8,7 @@ ENV USER=wxpy ENV HOME=/home/$USER ENV PYTHONUNBUFFERED=1 ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=yes # Update and install basic OS packages RUN \ diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index 9bd3a29a..54fcc6a7 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -8,6 +8,7 @@ ENV USER=wxpy ENV HOME=/home/$USER ENV PYTHONUNBUFFERED=1 ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=yes # Update and install basic OS packages RUN \ From e81ff423b1afc22817f48261943e2d10829b732d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 16:02:32 -0700 Subject: [PATCH 08/30] Add Debian 9 and 10 images --- docker/debian-10/Dockerfile | 67 +++++++++++++++++++++++++++++++++++ docker/debian-9/Dockerfile | 69 +++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 docker/debian-10/Dockerfile create mode 100644 docker/debian-9/Dockerfile diff --git a/docker/debian-10/Dockerfile b/docker/debian-10/Dockerfile new file mode 100644 index 00000000..3e5fe74a --- /dev/null +++ b/docker/debian-10/Dockerfile @@ -0,0 +1,67 @@ +# The base image (v10 == "buster") +FROM debian:buster + +# Set environment variables +ENV DIST_NAME=debian-10 +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=no + +# Update and install basic OS packages +RUN \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y \ + apt-utils \ + build-essential \ + software-properties-common \ + sudo nano; \ +# Set up a user, and etc. + mkdir -p /dist; \ + adduser --disabled-password --gecos "" ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ +# Install development packages needed for building wxPython + apt-get install -y \ + freeglut3 \ + freeglut3-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libgstreamer-plugins-base1.0-dev \ + libgtk-3-dev \ + libjpeg-dev \ + libnotify-dev \ + libsdl2-dev \ + libsm-dev \ + libtiff-dev \ + libwebkit2gtk-4.0-dev \ + libxtst-dev; \ + apt-get clean; + +# Install all available Python packages and their dev packages +RUN \ + apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \ + apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \ + apt-get clean; + + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + virtualenv --python=python2.7 venvs/Py27; \ + python3.7 -m venv venvs/Py37; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + diff --git a/docker/debian-9/Dockerfile b/docker/debian-9/Dockerfile new file mode 100644 index 00000000..67b49117 --- /dev/null +++ b/docker/debian-9/Dockerfile @@ -0,0 +1,69 @@ +# The base image (v9 == "stretch") +FROM debian:stretch + +# Set environment variables +ENV DIST_NAME=debian-9 +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=yes + +# Update and install basic OS packages +RUN \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y \ + apt-utils \ + build-essential \ + software-properties-common \ + sudo nano; \ +# Set up a user, and etc. + mkdir -p /dist; \ + adduser --disabled-password --gecos "" ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ +# Install development packages needed for building wxPython + apt-get install -y \ + freeglut3 \ + freeglut3-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libgstreamer-plugins-base1.0-dev \ + libgtk-3-dev \ + libgtk2.0-dev \ + libjpeg-dev \ + libnotify-dev \ + libsdl2-dev \ + libsm-dev \ + libtiff-dev \ + libwebkit2gtk-4.0-dev \ + libwebkitgtk-dev \ + libxtst-dev; \ + apt-get clean; + +# Install all available Python packages and their dev packages +RUN \ + apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv; \ + apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv; \ + apt-get clean; + + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + virtualenv --python=python2.7 venvs/Py27; \ + python3.5 -m venv venvs/Py35; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + From 471c297f9d06899ffbe2cb9014fc8ef2508e4507 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 20:29:11 -0700 Subject: [PATCH 09/30] More small tweaks and fixes. --- docker/debian-10/Dockerfile | 2 +- docker/debian-9/Dockerfile | 2 +- docker/scripts/do-build.sh | 2 +- docker/scripts/hello.sh | 5 +++++ docker/ubuntu-14.04/Dockerfile | 4 ++-- docker/ubuntu-16.04/Dockerfile | 4 ++-- docker/ubuntu-18.04/Dockerfile | 4 ++-- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docker/debian-10/Dockerfile b/docker/debian-10/Dockerfile index 3e5fe74a..77700048 100644 --- a/docker/debian-10/Dockerfile +++ b/docker/debian-10/Dockerfile @@ -21,7 +21,7 @@ RUN \ # Set up a user, and etc. mkdir -p /dist; \ adduser --disabled-password --gecos "" ${USER}; \ - echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ # Install development packages needed for building wxPython apt-get install -y \ freeglut3 \ diff --git a/docker/debian-9/Dockerfile b/docker/debian-9/Dockerfile index 67b49117..b3b575c9 100644 --- a/docker/debian-9/Dockerfile +++ b/docker/debian-9/Dockerfile @@ -21,7 +21,7 @@ RUN \ # Set up a user, and etc. mkdir -p /dist; \ adduser --disabled-password --gecos "" ${USER}; \ - echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ # Install development packages needed for building wxPython apt-get install -y \ freeglut3 \ diff --git a/docker/scripts/do-build.sh b/docker/scripts/do-build.sh index 72c013ee..1a286b29 100755 --- a/docker/scripts/do-build.sh +++ b/docker/scripts/do-build.sh @@ -32,7 +32,7 @@ if [ "$TARBALL" == "" ]; then exit 1 fi -if [ $PYENV != all -a ! -d ~/venv/$PYENV ]; then +if [ $PYENV != all -a ! -d ~/venvs/$PYENV ]; then echo "ERROR: The $PYENV environment not found in the $DIST_NAME image." exit 1 fi diff --git a/docker/scripts/hello.sh b/docker/scripts/hello.sh index 3060b2fa..8330c7ab 100755 --- a/docker/scripts/hello.sh +++ b/docker/scripts/hello.sh @@ -9,3 +9,8 @@ echo "" if [ -x /usr/bin/lsb_release ]; then /usr/bin/lsb_release -a fi +if [ -e /etc/redhat-release ]; then + cat /etc/redhat-release +fi + +echo "" diff --git a/docker/ubuntu-14.04/Dockerfile b/docker/ubuntu-14.04/Dockerfile index 40ecb919..2556a26a 100644 --- a/docker/ubuntu-14.04/Dockerfile +++ b/docker/ubuntu-14.04/Dockerfile @@ -1,4 +1,4 @@ -# The base image (v14.04 = "trusty") +# The base image (v14.04 == "trusty") FROM ubuntu:14.04 # Set environment variables @@ -14,7 +14,7 @@ ENV GTK2_OK=yes RUN \ mkdir -p /dist; \ adduser --disabled-password --gecos "" ${USER}; \ - echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ apt-get update; \ apt-get upgrade -y; \ apt-get install -y \ diff --git a/docker/ubuntu-16.04/Dockerfile b/docker/ubuntu-16.04/Dockerfile index 0c263b5f..3b7c7224 100644 --- a/docker/ubuntu-16.04/Dockerfile +++ b/docker/ubuntu-16.04/Dockerfile @@ -1,4 +1,4 @@ -# The base image (v16.04 = "xenial") +# The base image (v16.04 == "xenial") FROM ubuntu:16.04 # Set environment variables @@ -14,7 +14,7 @@ ENV GTK2_OK=yes RUN \ mkdir -p /dist; \ adduser --disabled-password --gecos "" ${USER}; \ - echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ apt-get update; \ apt-get upgrade -y; \ apt-get install -y \ diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index 54fcc6a7..15fe8dcc 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -1,4 +1,4 @@ -# The base image (v18.04 = "bionic") +# The base image (v18.04 == "bionic") FROM ubuntu:18.04 # Set environment variables @@ -14,7 +14,7 @@ ENV GTK2_OK=yes RUN \ mkdir -p /dist; \ adduser --disabled-password --gecos "" ${USER}; \ - echo "${USER} ALL=(ALL) NOPASSWD:ALL\n" >> /etc/sudoers; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ apt-get update; \ apt-get upgrade -y; \ apt-get install -y \ From ce64baf0fd82d5df6d4c0d09b1fcd0e383c18034 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 20:30:25 -0700 Subject: [PATCH 10/30] Add Fedora-29 --- docker/fedora-29/Dockerfile | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 docker/fedora-29/Dockerfile diff --git a/docker/fedora-29/Dockerfile b/docker/fedora-29/Dockerfile new file mode 100644 index 00000000..94b49f7b --- /dev/null +++ b/docker/fedora-29/Dockerfile @@ -0,0 +1,62 @@ +# The base image +FROM fedora:29 + +# Set environment variables +ENV DIST_NAME=fedora-29 +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=no + +# Update and install basic OS packages +RUN \ + dnf -y update; \ + dnf -y group install "Development Tools"; \ + dnf -y install gcc-c++ sudo nano; \ +# Set up a user, and etc. + mkdir -p /dist; \ + adduser -m ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ +# Install development packages needed for building wxPython + dnf install -y \ + gtk3-devel \ + webkit2gtk3-devel \ + libjpeg-turbo-devel \ + libpng-devel \ + libtiff-devel \ + SDL-devel \ + gstreamer-devel \ + gstreamer-plugins-base-devel \ + freeglut-devel \ + libnotify-devel \ + libSM-devel \ + libXtst-devel; \ +# Install all available Python packages and their dev packages + dnf -y install python2 python2-tools python2-devel python2-virtualenv; \ + dnf -y install python3 python3-tools python3-devel; \ + dnf -y install python36; \ +# CLean up dnf caches + dnf clean all; + + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + python2.7 -m virtualenv --python=python2.7 venvs/Py27; \ + python3.6 -m venv venvs/Py36; \ + python3.7 -m venv venvs/Py37; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + From b2e76458f76fa24c8fd926e61da49d3965c7bc26 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 23:05:52 -0700 Subject: [PATCH 11/30] Sort package names --- docker/fedora-29/Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/fedora-29/Dockerfile b/docker/fedora-29/Dockerfile index 94b49f7b..95705630 100644 --- a/docker/fedora-29/Dockerfile +++ b/docker/fedora-29/Dockerfile @@ -20,18 +20,18 @@ RUN \ echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ # Install development packages needed for building wxPython dnf install -y \ - gtk3-devel \ - webkit2gtk3-devel \ - libjpeg-turbo-devel \ - libpng-devel \ - libtiff-devel \ - SDL-devel \ - gstreamer-devel \ - gstreamer-plugins-base-devel \ freeglut-devel \ + gstreamer1-devel \ + gstreamer1-plugins-base-devel \ + gtk3-devel \ + libjpeg-turbo-devel \ libnotify-devel \ + libpng-devel \ libSM-devel \ - libXtst-devel; \ + libtiff-devel \ + libXtst-devel \ + SDL-devel \ + webkit2gtk3-devel; \ # Install all available Python packages and their dev packages dnf -y install python2 python2-tools python2-devel python2-virtualenv; \ dnf -y install python3 python3-tools python3-devel; \ From 66ba2c0c6ce62a51173a2a7f7407caf0df8b40f5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Jun 2019 23:07:06 -0700 Subject: [PATCH 12/30] Add fedora-30 --- docker/fedora-30/Dockerfile | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 docker/fedora-30/Dockerfile diff --git a/docker/fedora-30/Dockerfile b/docker/fedora-30/Dockerfile new file mode 100644 index 00000000..a47d20b0 --- /dev/null +++ b/docker/fedora-30/Dockerfile @@ -0,0 +1,62 @@ +# The base image +FROM fedora:30 + +# Set environment variables +ENV DIST_NAME=fedora-30 +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=no + +# Update and install basic OS packages +RUN \ + dnf -y update; \ + dnf -y group install "Development Tools"; \ + dnf -y install gcc-c++ sudo nano; \ +# Set up a user, and etc. + mkdir -p /dist; \ + adduser -m ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ +# Install development packages needed for building wxPython + dnf install -y \ + freeglut-devel \ + gstreamer1-devel \ + gstreamer1-plugins-base-devel \ + gtk3-devel \ + libjpeg-turbo-devel \ + libnotify-devel \ + libpng-devel \ + libSM-devel \ + libtiff-devel \ + libXtst-devel \ + SDL-devel \ + webkit2gtk3-devel; \ +# Install all available Python packages and their dev packages + dnf -y install python2 python2-tools python2-devel python2-virtualenv; \ + dnf -y install python3 python3-tools python3-devel; \ + dnf -y install python36; \ +# CLean up dnf caches + dnf clean all; + + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + python2.7 -m virtualenv --python=python2.7 venvs/Py27; \ + python3.6 -m venv venvs/Py36; \ + python3.7 -m venv venvs/Py37; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + From a19b2d99d1bc060dc3cd941ccee8858674cd4fb6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 29 Jun 2019 21:16:53 -0700 Subject: [PATCH 13/30] Add centos-7 --- docker/centos-7/Dockerfile | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 docker/centos-7/Dockerfile diff --git a/docker/centos-7/Dockerfile b/docker/centos-7/Dockerfile new file mode 100644 index 00000000..8ba759fa --- /dev/null +++ b/docker/centos-7/Dockerfile @@ -0,0 +1,65 @@ +# The base image +FROM centos:7 + +# Set environment variables +ENV DIST_NAME=centos-7 +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:$PATH +ENV GTK2_OK=yes + + +# Update and install basic OS packages +RUN \ + yum -y install https://centos7.iuscommunity.org/ius-release.rpm; \ + yum -y update; \ + yum -y group install development; \ + yum -y install sudo nano which; \ +# Set up a user, and etc. + mkdir -p /dist; \ + adduser -m ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ +# Install development packages needed for building wxPython + yum -y install \ + freeglut-devel \ + gstreamer1-devel \ + gstreamer1-plugins-base-devel \ + gtk2-devel \ + gtk3-devel \ + libjpeg-turbo-devel \ + libnotify \ + libnotify-devel \ + libpng-devel \ + libSM-devel \ + libtiff-devel \ + libXtst-devel \ + SDL-devel \ + webkitgtk-devel \ + webkitgtk3-devel \ + webkitgtk4-devel; \ +# Install all available Python packages and their dev packages + yum -y install python python-tools python-devel python-virtualenv; \ + yum -y install python36u python36u-tools python36u-devel; \ +# CLean up the yum caches + yum clean all; + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + python2.7 -m virtualenv --python=python2.7 venvs/Py27; \ + python3.6 -m venv venvs/Py36; + +# Add files from host into the container +COPY scripts ${HOME}/bin + +# Define default command +CMD ["/bin/bash", "-l"] + From cccbfa12797f4933c6a27520f8feafd9b2b9b88e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 1 Jul 2019 19:36:03 -0700 Subject: [PATCH 14/30] Add script to build docker images and build wxpython using them --- docker/tasks.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docker/tasks.py diff --git a/docker/tasks.py b/docker/tasks.py new file mode 100644 index 00000000..89374a01 --- /dev/null +++ b/docker/tasks.py @@ -0,0 +1,82 @@ +#!/usr/bin/python +#---------------------------------------------------------------------- +# Name: tasks.py +# Purpose: Invoke-based set of commands for dealing with wxPython's +# Docker files, images and performing wxPython builds. +# +# Author: Robin Dunn +# +# Created: 1-July-2019 +# Copyright: (c) 2019 by Total Control Software +# License: wxWindows License +#---------------------------------------------------------------------- + +import os +import glob +from invoke import task, run + + +HERE = os.path.abspath(os.path.dirname(__file__)) + + +@task( + help={'upload':'Upload the resulting images to docker hub', + 'image':'Name of a docker image to build. May be specified more than once. Defaults to all.', + }, + iterable=['image'], +) +def build_images(ctx, image, upload=False ): + """ + Build the docker images. + """ + if image == []: + image = _get_all_distros() + + os.chdir(HERE) + dist=os.path.abspath('../dist') + for img_name in image: + # build it + ctx.run('docker build --no-cache ' + '-f {name}/Dockerfile ' + '-t wxpython/build:{name} .'.format(name=img_name), + pty=True, echo=True) + # test it + ctx.run('docker run -it --rm -v {}:/dist ' + 'wxpython/build:{} hello.sh'.format(dist, img_name), + pty=True, echo=True) + + if upload: + print('Do image upload here...') + + +@task( + help={ + 'image':'Name of a docker image to use for building. May be specified more than once. Defaults to all.', + 'port': 'One of gtk2, gtk3 or all. Defaults to all.', + 'venv': 'The name of a Python virtual environment to use for the build, like Py27, Py36, etc. Defaults to all.' + }, + iterable=['image'], +) +def build_wxpython(ctx, image, venv='all', port='all', upload=False, release=False): + """ + Use docker images to build wxPython. + + This command requires that there is a wxPython source archive in the ../dist + folder, such as one produced by `python build.py sdist` or one from a + release or snapshot build of wxPython. + """ + if image == []: + image = _get_all_distros() + + os.chdir(HERE) + dist=os.path.abspath('../dist') + for img_name in image: + ctx.run('docker run -it --rm -v {}:/dist ' + 'wxpython/build:{} do-build.sh {} {}'.format(dist, img_name, venv, port), + pty=True, echo=True) + + +def _get_all_distros(): + os.chdir(HERE) + all_matching = glob.glob("*-*") + return all_matching From da4b2bc8eb784180fbed3aa08a2556011b1780f9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Jul 2019 18:17:54 -0700 Subject: [PATCH 15/30] Set the timezone and a bit of reorg --- docker/ubuntu-18.04/Dockerfile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index 15fe8dcc..e373de53 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -12,16 +12,21 @@ ENV GTK2_OK=yes # Update and install basic OS packages RUN \ - mkdir -p /dist; \ - adduser --disabled-password --gecos "" ${USER}; \ - echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ apt-get update; \ apt-get upgrade -y; \ apt-get install -y \ apt-utils \ build-essential \ software-properties-common \ - nano; \ + sudo nano; \ +# Set up a user, and sudo + mkdir -p /dist; \ + adduser --disabled-password --gecos "" ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ +# Set a timezone + DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata; \ + ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime; \ + dpkg-reconfigure -f noninteractive tzdata; \ # Install development packages needed for building wxPython apt-get install -y \ freeglut3 \ @@ -49,6 +54,10 @@ RUN \ apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \ apt-get clean; +# Add files from host into the container +COPY scripts ${HOME}/bin +RUN chown -R ${USER}:${USER} ${HOME}/bin + # Set the user and group to use for the rest of the commands USER ${USER}:${USER} @@ -63,9 +72,6 @@ RUN \ python3.6 -m venv venvs/Py36; \ python3.7 -m venv venvs/Py37; -# Add files from host into the container -COPY scripts ${HOME}/bin - # Define default command CMD ["/bin/bash", "-l"] From de95ecbc87dcb871e7726fb074f59d58cfdbe02a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Jul 2019 18:19:30 -0700 Subject: [PATCH 16/30] Move build docker files to build subdir --- docker/{ => build}/centos-7/Dockerfile | 0 docker/{ => build}/debian-10/Dockerfile | 0 docker/{ => build}/debian-9/Dockerfile | 0 docker/{ => build}/fedora-29/Dockerfile | 0 docker/{ => build}/fedora-30/Dockerfile | 0 docker/{ => build}/ubuntu-14.04/Dockerfile | 0 docker/{ => build}/ubuntu-16.04/Dockerfile | 0 docker/{ => build}/ubuntu-18.04/Dockerfile | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename docker/{ => build}/centos-7/Dockerfile (100%) rename docker/{ => build}/debian-10/Dockerfile (100%) rename docker/{ => build}/debian-9/Dockerfile (100%) rename docker/{ => build}/fedora-29/Dockerfile (100%) rename docker/{ => build}/fedora-30/Dockerfile (100%) rename docker/{ => build}/ubuntu-14.04/Dockerfile (100%) rename docker/{ => build}/ubuntu-16.04/Dockerfile (100%) rename docker/{ => build}/ubuntu-18.04/Dockerfile (100%) diff --git a/docker/centos-7/Dockerfile b/docker/build/centos-7/Dockerfile similarity index 100% rename from docker/centos-7/Dockerfile rename to docker/build/centos-7/Dockerfile diff --git a/docker/debian-10/Dockerfile b/docker/build/debian-10/Dockerfile similarity index 100% rename from docker/debian-10/Dockerfile rename to docker/build/debian-10/Dockerfile diff --git a/docker/debian-9/Dockerfile b/docker/build/debian-9/Dockerfile similarity index 100% rename from docker/debian-9/Dockerfile rename to docker/build/debian-9/Dockerfile diff --git a/docker/fedora-29/Dockerfile b/docker/build/fedora-29/Dockerfile similarity index 100% rename from docker/fedora-29/Dockerfile rename to docker/build/fedora-29/Dockerfile diff --git a/docker/fedora-30/Dockerfile b/docker/build/fedora-30/Dockerfile similarity index 100% rename from docker/fedora-30/Dockerfile rename to docker/build/fedora-30/Dockerfile diff --git a/docker/ubuntu-14.04/Dockerfile b/docker/build/ubuntu-14.04/Dockerfile similarity index 100% rename from docker/ubuntu-14.04/Dockerfile rename to docker/build/ubuntu-14.04/Dockerfile diff --git a/docker/ubuntu-16.04/Dockerfile b/docker/build/ubuntu-16.04/Dockerfile similarity index 100% rename from docker/ubuntu-16.04/Dockerfile rename to docker/build/ubuntu-16.04/Dockerfile diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/build/ubuntu-18.04/Dockerfile similarity index 100% rename from docker/ubuntu-18.04/Dockerfile rename to docker/build/ubuntu-18.04/Dockerfile From c21cb5f6d2ea294d481954295d706ad07a8f4d9c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Jul 2019 18:20:51 -0700 Subject: [PATCH 17/30] Add 'gui' docker files, which include running X11 via a VNC server --- docker/gui/fedora-30/Dockerfile | 23 +++++++++++++++++++++++ docker/gui/ubuntu-18.04/Dockerfile | 26 ++++++++++++++++++++++++++ docker/scripts/start-vncserver.sh | 3 +++ 3 files changed, 52 insertions(+) create mode 100644 docker/gui/fedora-30/Dockerfile create mode 100644 docker/gui/ubuntu-18.04/Dockerfile create mode 100755 docker/scripts/start-vncserver.sh diff --git a/docker/gui/fedora-30/Dockerfile b/docker/gui/fedora-30/Dockerfile new file mode 100644 index 00000000..158cdc07 --- /dev/null +++ b/docker/gui/fedora-30/Dockerfile @@ -0,0 +1,23 @@ +FROM wxpython/build:fedora-30 + +RUN sudo dnf -y install tigervnc-server xterm +RUN mkdir ~/.vnc + +# RUN sudo dnf -y install fluxbox +# RUN echo "fluxbox &"> ~/.vnc/xstartup + +# RUN sudo dnf -y install @xfce-desktop-environment +# RUN echo "startxfce4 &"> ~/.vnc/xstartup + +# RUN sudo dnf -y install --allowerasing @mate-desktop-environment +# RUN echo "mate-session &"> ~/.vnc/xstartup + +RUN sudo dnf -y install @lxde-desktop-environment +RUN echo "startlxde &"> ~/.vnc/xstartup + + +RUN chmod u+x ~/.vnc/xstartup +RUN echo "password" | vncpasswd -f >> ~/.vnc/passwd +RUN chmod 600 ~/.vnc/passwd + +CMD ["start-vncserver.sh"] diff --git a/docker/gui/ubuntu-18.04/Dockerfile b/docker/gui/ubuntu-18.04/Dockerfile new file mode 100644 index 00000000..ce0299b0 --- /dev/null +++ b/docker/gui/ubuntu-18.04/Dockerfile @@ -0,0 +1,26 @@ +FROM wxpython/build:ubuntu-18.04 + +USER root:root +RUN apt-get install -y \ + libx11-6 libxcb1 libxau6 xterm \ + tightvncserver \ + xvfb dbus-x11 x11-utils \ + xfonts-base xfonts-75dpi xfonts-100dpi \ +# Choose one of these: +# lxde + lubuntu-desktop +# ubuntu-mate-desktop + +USER ${USER}:${USER} +RUN touch ~/.Xauthority; \ + mkdir ~/.vnc; \ + echo "password" | vncpasswd -f >> ~/.vnc/passwd; \ + chmod 600 ~/.vnc/passwd; \ +# And a coresponding one of these: +# echo "exec /usr/bin/startlxde" > ~/.vnc/xstartup; + echo "exec lxsession -e LXDE -s Lubuntu" > ~/.vnc/xstartup; +# echo "exec mate-session" > ~/.vnc/xstartup; + +RUN chmod +x ~/.vnc/xstartup; + +CMD ["start-vncserver.sh"] diff --git a/docker/scripts/start-vncserver.sh b/docker/scripts/start-vncserver.sh new file mode 100755 index 00000000..c682dbd4 --- /dev/null +++ b/docker/scripts/start-vncserver.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo "starting VNC server ..." +vncserver :1 -geometry 1600x1050 -depth 24 && tail -F ~/.vnc/*.log From 767f278e4a86ec845a637d5d92d129253099cd77 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Jul 2019 18:22:06 -0700 Subject: [PATCH 18/30] Add option to build the gui flavor of an image --- docker/tasks.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docker/tasks.py b/docker/tasks.py index 89374a01..1cbc3138 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python #---------------------------------------------------------------------- # Name: tasks.py # Purpose: Invoke-based set of commands for dealing with wxPython's @@ -20,36 +20,40 @@ HERE = os.path.abspath(os.path.dirname(__file__)) @task( - help={'upload':'Upload the resulting images to docker hub', - 'image':'Name of a docker image to build. May be specified more than once. Defaults to all.', + aliases=['build_image', 'bi'], + help={'upload':'(TODO) Upload the resulting images to docker hub', + 'image': 'Name of a docker image to build. May be specified more than once. Defaults to all.', + 'gui': 'Build the gui version of an image instead of just the build image.', }, iterable=['image'], ) -def build_images(ctx, image, upload=False ): +def build_images(ctx, image, upload=False, gui=False): """ - Build the docker images. + Build docker image(s). """ if image == []: image = _get_all_distros() os.chdir(HERE) dist=os.path.abspath('../dist') + img_type = 'gui' if gui else 'build' for img_name in image: # build it ctx.run('docker build --no-cache ' - '-f {name}/Dockerfile ' - '-t wxpython/build:{name} .'.format(name=img_name), + '-f {type}/{name}/Dockerfile ' + '-t wxpython/{type}:{name} .'.format(name=img_name, type=img_type), pty=True, echo=True) # test it ctx.run('docker run -it --rm -v {}:/dist ' - 'wxpython/build:{} hello.sh'.format(dist, img_name), + 'wxpython/{}:{} hello.sh'.format(dist, img_type, img_name), pty=True, echo=True) if upload: - print('Do image upload here...') + print('TODO: Do image upload here...') @task( + aliases=['build_wxp', 'bwxp'], help={ 'image':'Name of a docker image to use for building. May be specified more than once. Defaults to all.', 'port': 'One of gtk2, gtk3 or all. Defaults to all.', From 8a69264893de8f05aa9d91d3280a88856bdeed7d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Jul 2019 18:22:29 -0700 Subject: [PATCH 19/30] Add task to run an image --- docker/tasks.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docker/tasks.py b/docker/tasks.py index 1cbc3138..e1dd98cc 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -79,6 +79,30 @@ def build_wxpython(ctx, image, venv='all', port='all', upload=False, release=Fal 'wxpython/build:{} do-build.sh {} {}'.format(dist, img_name, venv, port), pty=True, echo=True) +@task( + help={ + 'image_tag':"The tag of the image to be run", + 'cmd': "If given will run this command instead of the image's default command.", + 'gui': "If given will run the 'gui' image insead of the 'build' image.", + 'port': "Host port to use for the VNC connection.", + 'keep': "Keep the container when it exits. Otherwise it will be auto-removed." + }, + positional=['image_tag'], +) +def run(ctx, image_tag, cmd=None, gui=False, port=5901, keep=False): + """ + Run a wxpython docker image. + """ + os.chdir(HERE) + dist=os.path.abspath('../dist') + imgtype = 'gui' if gui else 'build' + cmd = '' if cmd is None else cmd + rm = '' if keep else '--rm' + ctx.run( + 'docker run -it {} -v {}:/dist -p {}:5901 wxpython/{}:{} {}'.format( + rm, dist, port, imgtype, image_tag, cmd), + pty=True, echo=True) + def _get_all_distros(): os.chdir(HERE) From 81db218d4f199e71687b8e5c7b4dd0332e5550c3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2019 15:33:00 -0700 Subject: [PATCH 20/30] Remove the screensaver packages --- docker/gui/fedora-30/Dockerfile | 10 ++++++---- docker/gui/ubuntu-18.04/Dockerfile | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docker/gui/fedora-30/Dockerfile b/docker/gui/fedora-30/Dockerfile index 158cdc07..c49cc383 100644 --- a/docker/gui/fedora-30/Dockerfile +++ b/docker/gui/fedora-30/Dockerfile @@ -9,15 +9,17 @@ RUN mkdir ~/.vnc # RUN sudo dnf -y install @xfce-desktop-environment # RUN echo "startxfce4 &"> ~/.vnc/xstartup -# RUN sudo dnf -y install --allowerasing @mate-desktop-environment -# RUN echo "mate-session &"> ~/.vnc/xstartup +RUN sudo dnf -y install --allowerasing @mate-desktop-environment +RUN echo "mate-session &"> ~/.vnc/xstartup -RUN sudo dnf -y install @lxde-desktop-environment -RUN echo "startlxde &"> ~/.vnc/xstartup +# RUN sudo dnf -y install @lxde-desktop-environment +# RUN echo "startlxde &"> ~/.vnc/xstartup +RUN sudo dnf -y remove *screensaver* RUN chmod u+x ~/.vnc/xstartup RUN echo "password" | vncpasswd -f >> ~/.vnc/passwd RUN chmod 600 ~/.vnc/passwd +RUN touch ~/.Xauthority CMD ["start-vncserver.sh"] diff --git a/docker/gui/ubuntu-18.04/Dockerfile b/docker/gui/ubuntu-18.04/Dockerfile index ce0299b0..787c2917 100644 --- a/docker/gui/ubuntu-18.04/Dockerfile +++ b/docker/gui/ubuntu-18.04/Dockerfile @@ -11,6 +11,8 @@ RUN apt-get install -y \ lubuntu-desktop # ubuntu-mate-desktop +RUN apt-get remove -y "*screensaver*" + USER ${USER}:${USER} RUN touch ~/.Xauthority; \ mkdir ~/.vnc; \ From ce6e71a42f800dff3ddcffab847b3f37372a97a4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2019 15:36:23 -0700 Subject: [PATCH 21/30] The org name is actually 'wxpython4' --- docker/tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/tasks.py b/docker/tasks.py index e1dd98cc..77fbaad8 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -41,11 +41,11 @@ def build_images(ctx, image, upload=False, gui=False): # build it ctx.run('docker build --no-cache ' '-f {type}/{name}/Dockerfile ' - '-t wxpython/{type}:{name} .'.format(name=img_name, type=img_type), + '-t wxpython4/{type}:{name} .'.format(name=img_name, type=img_type), pty=True, echo=True) # test it ctx.run('docker run -it --rm -v {}:/dist ' - 'wxpython/{}:{} hello.sh'.format(dist, img_type, img_name), + 'wxpython4/{}:{} hello.sh'.format(dist, img_type, img_name), pty=True, echo=True) if upload: @@ -76,7 +76,7 @@ def build_wxpython(ctx, image, venv='all', port='all', upload=False, release=Fal dist=os.path.abspath('../dist') for img_name in image: ctx.run('docker run -it --rm -v {}:/dist ' - 'wxpython/build:{} do-build.sh {} {}'.format(dist, img_name, venv, port), + 'wxpython4/build:{} do-build.sh {} {}'.format(dist, img_name, venv, port), pty=True, echo=True) @task( @@ -99,7 +99,7 @@ def run(ctx, image_tag, cmd=None, gui=False, port=5901, keep=False): cmd = '' if cmd is None else cmd rm = '' if keep else '--rm' ctx.run( - 'docker run -it {} -v {}:/dist -p {}:5901 wxpython/{}:{} {}'.format( + 'docker run -it {} -v {}:/dist -p {}:5901 wxpython4/{}:{} {}'.format( rm, dist, port, imgtype, image_tag, cmd), pty=True, echo=True) From b9480a6391387498c7b041f07e98f92269362d94 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2019 15:37:08 -0700 Subject: [PATCH 22/30] Fix fetching the distro names from the subfolders --- docker/tasks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/tasks.py b/docker/tasks.py index 77fbaad8..8fd84331 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -104,7 +104,8 @@ def run(ctx, image_tag, cmd=None, gui=False, port=5901, keep=False): pty=True, echo=True) -def _get_all_distros(): +def _get_all_distros(gui): os.chdir(HERE) - all_matching = glob.glob("*-*") - return all_matching + wildcard = os.path.join('gui' if gui else 'build', '*-*') + all_matching = glob.glob(wildcard) + return [os.path.basename(item) for item in all_matching] From 5445daf0fd14ce6554be9de6175a959f998748dd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2019 15:38:00 -0700 Subject: [PATCH 23/30] Add a task for pushing the images to docker hub --- docker/tasks.py | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/docker/tasks.py b/docker/tasks.py index 8fd84331..a5562914 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -18,21 +18,20 @@ from invoke import task, run HERE = os.path.abspath(os.path.dirname(__file__)) - @task( aliases=['build_image', 'bi'], - help={'upload':'(TODO) Upload the resulting images to docker hub', - 'image': 'Name of a docker image to build. May be specified more than once. Defaults to all.', - 'gui': 'Build the gui version of an image instead of just the build image.', - }, + help={ + 'image': 'Name of a docker image to build. May be specified more than once. Defaults to all.', + 'gui': 'Build the gui version of an image instead of just the build image.', + }, iterable=['image'], ) -def build_images(ctx, image, upload=False, gui=False): +def build_images(ctx, image, gui=False): """ Build docker image(s). """ if image == []: - image = _get_all_distros() + image = _get_all_distros(gui) os.chdir(HERE) dist=os.path.abspath('../dist') @@ -48,8 +47,30 @@ def build_images(ctx, image, upload=False, gui=False): 'wxpython4/{}:{} hello.sh'.format(dist, img_type, img_name), pty=True, echo=True) - if upload: - print('TODO: Do image upload here...') + +@task( + help={ + 'image': 'Name of a docker image to push. May be specified more than once. Defaults to all.', + 'gui': 'Push the gui version of an image instead of just the build image.', + }, + iterable=['image'], +) +def push(ctx, image, gui=False): + """ + Push one or more images to docker hub. User should have already run + a `docker login` command. + """ + if image == []: + image = _get_all_distros(gui) + + os.chdir(HERE) + img_type = 'gui' if gui else 'build' + for img_name in image: + # build it + ctx.run( + 'docker push wxpython4/{type}:{name}'.format(name=img_name, type=img_type), + pty=True, echo=True) + @task( From 0d4ee1d8c4f3f75b32a9277f57e17c076ebcb0b0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2019 15:43:33 -0700 Subject: [PATCH 24/30] wxpython --> wxpython4 --- docker/gui/fedora-30/Dockerfile | 2 +- docker/gui/ubuntu-18.04/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/gui/fedora-30/Dockerfile b/docker/gui/fedora-30/Dockerfile index c49cc383..08d92e97 100644 --- a/docker/gui/fedora-30/Dockerfile +++ b/docker/gui/fedora-30/Dockerfile @@ -1,4 +1,4 @@ -FROM wxpython/build:fedora-30 +FROM wxpython4/build:fedora-30 RUN sudo dnf -y install tigervnc-server xterm RUN mkdir ~/.vnc diff --git a/docker/gui/ubuntu-18.04/Dockerfile b/docker/gui/ubuntu-18.04/Dockerfile index 787c2917..f9729a6e 100644 --- a/docker/gui/ubuntu-18.04/Dockerfile +++ b/docker/gui/ubuntu-18.04/Dockerfile @@ -1,4 +1,4 @@ -FROM wxpython/build:ubuntu-18.04 +FROM wxpython4/build:ubuntu-18.04 USER root:root RUN apt-get install -y \ From 9400615bc879f5bbbdf563d0409fd9df88fbdee7 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2019 15:49:04 -0700 Subject: [PATCH 25/30] Clean up package caches and such --- docker/gui/fedora-30/Dockerfile | 1 + docker/gui/ubuntu-18.04/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/docker/gui/fedora-30/Dockerfile b/docker/gui/fedora-30/Dockerfile index 08d92e97..31612a13 100644 --- a/docker/gui/fedora-30/Dockerfile +++ b/docker/gui/fedora-30/Dockerfile @@ -16,6 +16,7 @@ RUN echo "mate-session &"> ~/.vnc/xstartup # RUN echo "startlxde &"> ~/.vnc/xstartup RUN sudo dnf -y remove *screensaver* +RUN sudo dnf clean all RUN chmod u+x ~/.vnc/xstartup RUN echo "password" | vncpasswd -f >> ~/.vnc/passwd diff --git a/docker/gui/ubuntu-18.04/Dockerfile b/docker/gui/ubuntu-18.04/Dockerfile index f9729a6e..86bad24d 100644 --- a/docker/gui/ubuntu-18.04/Dockerfile +++ b/docker/gui/ubuntu-18.04/Dockerfile @@ -12,6 +12,7 @@ RUN apt-get install -y \ # ubuntu-mate-desktop RUN apt-get remove -y "*screensaver*" +RUN apt-get clean USER ${USER}:${USER} RUN touch ~/.Xauthority; \ From 2bdef86c7b384202925c8c41ab49f1f6c4d20043 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Jul 2019 11:22:31 -0700 Subject: [PATCH 26/30] remove unused parameters --- docker/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/tasks.py b/docker/tasks.py index a5562914..66088dd5 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -82,7 +82,7 @@ def push(ctx, image, gui=False): }, iterable=['image'], ) -def build_wxpython(ctx, image, venv='all', port='all', upload=False, release=False): +def build_wxpython(ctx, image, venv='all', port='all'): """ Use docker images to build wxPython. From 83fa9e3b2e36e2971e71bcc649384f3ec80a3084 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Jul 2019 11:23:27 -0700 Subject: [PATCH 27/30] remove cmd_build_vagrant, add cmd_build_docker --- build.py | 52 ++++++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/build.py b/build.py index 6aa011bb..a554ede9 100755 --- a/build.py +++ b/build.py @@ -447,7 +447,7 @@ def makeOptionParser(): ("jom", (False, "Use jom instead of nmake for the wxMSW build")), ("pytest_timeout", ("0", "Timeout, in seconds, for stopping stuck test cases. (Currently not working as expected, so disabled by default.)")), ("pytest_jobs", ("", "Number of parallel processes py.test should run")), - ("vagrant_vms", ("all", "Comma separated list of VM names to use for the build_vagrant command. Defaults to \"all\"")), + ("docker_img", ("all", "Comma separated list of image tags to use for the build_docker command. Defaults to \"all\"")), ("dump_waf_log", (False, "If the waf build tool fails then using this option will cause waf's configure log to be printed")), ("regenerate_sysconfig", (False, "Waf uses Python's sysconfig and related tools to configure the build. In some cases that info can be incorrect, so this option regenerates it. Must have write access to Python's lib folder.")), ] @@ -1613,37 +1613,25 @@ def cmd_build_py(options, args): print("") -def cmd_build_vagrant(options, args): - # Does a build and bdist_wheel for each of the Vagrant based VMs defined - # in {phoenixDir}/vagrant. Requires Vagrant and VirtualBox to be installed - # and ready for use. Also requires a source tarball to be present in - # {phoenixDir}/dist, such as what is produced with cmd_sdist. - cmdTimer = CommandTimer('bdist_vagrant') +def cmd_build_docker(options, args): + # Uses docker images defined by the Dockerfiles under ./docker/build for + # building wxPython wheels for a few versions of Linux. + # + # Requirements: Docker + # Internet connection for downloading docker images, if needed + # One wxPython source archive in ./dist (created with cmd_sdist) + cmdTimer = CommandTimer('bdist_docker') cfg = Config(noWxConfig=True) - if not options.vagrant_vms or options.vagrant_vms == 'all': - VMs = [ 'centos-7 all all', - 'debian-8 all all', - 'debian-9 all all', - 'fedora-26 all all', - 'fedora-27 all gtk3', # no webkitgtk for gtk2 - 'fedora-28 all gtk3', # no webkitgtk for gtk2 - 'ubuntu-14.04 all all', - 'ubuntu-16.04 all all', - 'ubuntu-18.04 all all', - ] - elif options.vagrant_vms == 'none': - VMs = [] # to skip building anything and just upload - else: - VMs = options.vagrant_vms.split(',') + cmd = ['inv', 'build-wxpython'] + if options.docker_img != 'all': + for img in options.docker_img.split(','): + cmd.append('-i') + cmd.append(img) - for vmName in VMs: - vmDir = opj(phoenixDir(), 'vagrant', vmName.split()[0]) - pwd = pushDir(vmDir) - msg('Starting Vagrant VM in {}'.format(vmDir)) - runcmd('vagrant up') - runcmd('vagrant ssh -c "scripts/build.sh %s"' % vmName) - runcmd('vagrant halt') - del pwd + # 'none' can be used to skip building and go straight to uploading + if options.docker_img != 'none': + pwd = pushDir('docker') + runcmd(cmd, echoCmd=True) if options.upload: for tag in ['gtk2', 'gtk3']: @@ -1859,8 +1847,8 @@ def cmd_clean(options, args): cmd_clean_py(options, args) -def cmd_clean_vagrant(options, args): - cmdTimer = CommandTimer('clean_vagrant') +def cmd_clean_docker(options, args): + cmdTimer = CommandTimer('clean_docker') assert os.getcwd() == phoenixDir() d = opj(phoenixDir(), 'dist', 'linux') From 6b70527fc117f1c3dfc55e05515bbc37ccb2eebf Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Jul 2019 12:18:00 -0700 Subject: [PATCH 28/30] Add README for the docker folder --- docker/README.rst | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docker/README.rst diff --git a/docker/README.rst b/docker/README.rst new file mode 100644 index 00000000..71341832 --- /dev/null +++ b/docker/README.rst @@ -0,0 +1,77 @@ +Building wxPython4 with Docker +============================== + +Introduction +------------ + +Docker is a relatively lightweight system for deploying containers with a +specified set of software running within them. A Docker container is less than a +virtual machine, but more than a chroot, and will typically be much more +performant than a VM, (sub-second startup time, less resource hungry, etc.) +Typically they would be used for deploying "containerized applications", but a +docker image can easily be created with all that's needed for building software +too. + +The file and folders in this subtree provide the Dockerfiles and scripts needed +to build the Docker images, as well as for using those images to build wxPython +wheels for various Linux distributions. A current set of images are available on +Docker Hub at https://hub.docker.com/r/wxpython4/build. There is an image there +tagged with the same names as those in the ./build folder. For example, as of +this writing you can pull images with these names and tags: + + wxpython4/build:centos-7 + wxpython4/build:debian-9 + wxpython4/build:debian-10 + wxpython4/build:fedora-29 + wxpython4/build:fedora-30 + wxpython4/build:ubuntu-14.04 + wxpython4/build:ubuntu-16.04 + wxpython4/build:ubuntu-18.04 + + +Building Images +--------------- + +Since images are available on DockerHub there shouldn't be much need for +building them yourself, but just in case, here is how to do it. All images +can be built with a simple command like this:: + + inv build-images + +And one or more specific images can be built like this:: + + inv build-images -i debian-10 -i ubuntu-18.04 + +The ``inv`` command comes from the ``invoke`` package, which can be downloaded +and installed from PyPI. It loads a set of tasks from the ``tasks.py`` file in +this folder, and provides a command line interface for running those tasks. + + +Building wxPython +----------------- + +To perform a build there must be one (and only one) wxPython source tarball +located in the ``../dist`` folder. This source archive can either be generated +with the ``build.py dox etg sip sdist`` command, or it can be downloaded from a +wxPython release on PyPI, or it can come from the wxPython snapshots server for +prerelease versions of the software. + +With that source archive in place then a build for a specific distro can be done +like this (see the paragraph about ``invoke`` above):: + + inv build-wxpython -i ubuntu-18.04 + +That will do build for all Pythons that are set up in the image, and both gtk2 +and gtk3 if the image supports gtk2 (some don't.) To narrow the build down to +just one Python and one port, a command like this can be used:: + + inv build-wxpython -i ubuntu-18.04 -p gtk3 -v Py37 + +And a bare ``inv build-wxpython`` will cause a build to be done for all distros, +all supported Pythons, and all supported ports. This will take a little while to +accomplish. Go binge-watch something on Netflix while you're waiting... + +When the build(s) are finished the results will be placed in the +``../dist/linux`` folder, using the same folder structure for distros and ports +as is used on https://extras.wxpython.org/wxPython4/extras/linux/ + From dd46b58611acdc5b40b6bb010ee4ce2f87bda4e3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Jul 2019 12:19:23 -0700 Subject: [PATCH 29/30] Remove the vagrant tree --- vagrant/README.rst | 67 ------------------- vagrant/centos-7/Vagrantfile | 28 -------- vagrant/centos-7/bootstrap.sh | 34 ---------- vagrant/debian-8/Vagrantfile | 28 -------- vagrant/debian-8/bootstrap.sh | 29 --------- vagrant/debian-9/Vagrantfile | 28 -------- vagrant/debian-9/bootstrap.sh | 27 -------- vagrant/fedora-26/Vagrantfile | 28 -------- vagrant/fedora-26/bootstrap.sh | 31 --------- vagrant/fedora-27/Vagrantfile | 28 -------- vagrant/fedora-27/bootstrap.sh | 31 --------- vagrant/fedora-28/Vagrantfile | 28 -------- vagrant/fedora-28/bootstrap.sh | 32 ---------- vagrant/scripts/build.sh | 103 ------------------------------ vagrant/ubuntu-14.04/Vagrantfile | 28 -------- vagrant/ubuntu-14.04/bootstrap.sh | 32 ---------- vagrant/ubuntu-16.04/Vagrantfile | 28 -------- vagrant/ubuntu-16.04/bootstrap.sh | 35 ---------- vagrant/ubuntu-18.04/Vagrantfile | 28 -------- vagrant/ubuntu-18.04/bootstrap.sh | 31 --------- 20 files changed, 704 deletions(-) delete mode 100644 vagrant/README.rst delete mode 100644 vagrant/centos-7/Vagrantfile delete mode 100644 vagrant/centos-7/bootstrap.sh delete mode 100644 vagrant/debian-8/Vagrantfile delete mode 100644 vagrant/debian-8/bootstrap.sh delete mode 100644 vagrant/debian-9/Vagrantfile delete mode 100644 vagrant/debian-9/bootstrap.sh delete mode 100644 vagrant/fedora-26/Vagrantfile delete mode 100644 vagrant/fedora-26/bootstrap.sh delete mode 100644 vagrant/fedora-27/Vagrantfile delete mode 100644 vagrant/fedora-27/bootstrap.sh delete mode 100644 vagrant/fedora-28/Vagrantfile delete mode 100644 vagrant/fedora-28/bootstrap.sh delete mode 100755 vagrant/scripts/build.sh delete mode 100644 vagrant/ubuntu-14.04/Vagrantfile delete mode 100644 vagrant/ubuntu-14.04/bootstrap.sh delete mode 100644 vagrant/ubuntu-16.04/Vagrantfile delete mode 100644 vagrant/ubuntu-16.04/bootstrap.sh delete mode 100644 vagrant/ubuntu-18.04/Vagrantfile delete mode 100644 vagrant/ubuntu-18.04/bootstrap.sh diff --git a/vagrant/README.rst b/vagrant/README.rst deleted file mode 100644 index 516cc921..00000000 --- a/vagrant/README.rst +++ /dev/null @@ -1,67 +0,0 @@ -wxPython 4 builds on various Linux distros with Vagrant -======================================================= - -Vagrant (https://www.vagrantup.com/) is a tool that enables creating and using -automated, relatively lightweight virtual environments. Vagrant and the -Vagrant community provide several base images that are essentially simplistic -bare-bones installs of various operating systems, that can be thought of as a -bare canvas ready for provisioning with the needs of whatever applications -they will be used for. The hosting platform can be Windows, Mac OSX, or Linux. - -For wxPython, this means that we can automate the creation and provisioning of -virtual Linux machines with all the packages installed that are needed for -building wxPython 4. The each of the numbered subfolders located here contains -the Vagrant configuration and a bootstrap script for all of the Linux distros -that we currently support. As long as there is an existing vagrant "box" -available then adding support for new configurations is fairly simple. - - -Setup ------ - -The following steps should be followed to set up a computer to be a Vagrant -host: - - 1. Install VirtualBox: https://www.virtualbox.org/wiki/Downloads - - 2. Install vagrant: https://www.vagrantup.com/downloads.html - - 3. Install the vagrant-vbguest plugin to keep the VirtualBox Guest Additions - package installed and up to date. See: https://github.com/dotless-de/vagrant-vbguest - and run:: - - vagrant plugin install vagrant-vbguest - - -Building --------- - -The Vagrant VMs are provisioned to contain everything they need to build -Phoenix packages, except for two things: the source code and a build script to -do all the work. To make this a little simpler, the VMs are also configured to -share the ``{PhoenixRoot}/dist`` folder, and the -``{PhoenixRoot}/vagrant/scripts`` folder so they can access those two things -as well. - -To perform a build there must be a Phoenix source tarball located in the -``{PhoenixRoot}/dist`` folder, which can either be generated with the -``build.py dox etg sip sdist`` command, or one of the source tarballs from a -release or the snapshots server can be used. With that file in place then a -build for a specific distro can be done with just a few vagrant commands, for -example:: - - cd vagrant/ubuntu-18.04 - vagrant up - vagrant ssh -c "scripts/build.sh ubuntu-18.04" - vagrant halt - -Please note that currently this will do up to 8 complete builds, one for each -supported version of Python on that distro, for both gtk2 and gtk3. Additional -parameters can be passed to the ``build.sh`` script to narrow the build down to -a specific Python version or port. See ``scripts/build.sh`` for details. - -The wheel file(s) generated by the build will be placed in subfolders of -``{PhoenixRoot}/dist/linux``. - - - diff --git a/vagrant/centos-7/Vagrantfile b/vagrant/centos-7/Vagrantfile deleted file mode 100644 index a0f37f10..00000000 --- a/vagrant/centos-7/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "centos/7" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/centos-7/bootstrap.sh b/vagrant/centos-7/bootstrap.sh deleted file mode 100644 index 7c1a61ba..00000000 --- a/vagrant/centos-7/bootstrap.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -yum -y install yum-utils -yum -y install https://centos7.iuscommunity.org/ius-release.rpm -yum -y update - - -# Install necessary development tools, libs, etc. -yum -y group install development - -yum -y install gtk2 gtk2-devel gtk3 gtk3-devel \ - webkitgtk webkitgtk-devel webkitgtk3 webkitgtk3-devel \ - libjpeg-turbo-devel libpng-devel libtiff-devel \ - SDL SDL-devel gstreamer gstreamer-devel gstreamer-plugins-base-devel \ - freeglut freeglut-devel libnotify libnotify-devel libSM-devel \ - libXtst-devel - - -# Install all available Python packages and their dev packages -yum -y install python python-tools python-devel python-virtualenv -yum -y install python34u python34u-tools python34u-devel -yum -y install python35u python35u-tools python35u-devel -yum -y install python36u python36u-tools python36u-devel - - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. Set them to the vagrant user so the venvs can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -pyvenv-3.4 venvs/Py34 -pyvenv-3.5 venvs/Py35 -python3.6 -m venv venvs/Py36 -chown -R vagrant:vagrant venvs diff --git a/vagrant/debian-8/Vagrantfile b/vagrant/debian-8/Vagrantfile deleted file mode 100644 index 9f7bba57..00000000 --- a/vagrant/debian-8/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "debian/jessie64" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/debian-8/bootstrap.sh b/vagrant/debian-8/bootstrap.sh deleted file mode 100644 index 7470ebd1..00000000 --- a/vagrant/debian-8/bootstrap.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -apt-get update - -# Install necessary development tools, libs, etc. -apt-get install -y build-essential dpkg-dev - -apt-get install -y libgtk2.0-dev libgtk-3-dev -apt-get install -y libjpeg-dev libtiff-dev \ - libsdl1.2-dev libgstreamer-plugins-base0.10-dev \ - libnotify-dev freeglut3 freeglut3-dev libsm-dev \ - libwebkitgtk-dev libwebkitgtk-3.0-dev \ - libxtst-dev - - -# Install all available Python packages and their dev packages -apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv -apt-get install -y python3.4 python3.4-dev libpython3.4-dev python3.4-venv -#apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -pyvenv-3.4 venvs/Py34 -#pyvenv-3.5 venvs/Py35 -chown -R vagrant:vagrant venvs - diff --git a/vagrant/debian-9/Vagrantfile b/vagrant/debian-9/Vagrantfile deleted file mode 100644 index 9f4fa01e..00000000 --- a/vagrant/debian-9/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "debian/stretch64" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/debian-9/bootstrap.sh b/vagrant/debian-9/bootstrap.sh deleted file mode 100644 index e0c9e63e..00000000 --- a/vagrant/debian-9/bootstrap.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -apt-get update - -# Install necessary development tools, libs, etc. -apt-get install -y build-essential dpkg-dev - -apt-get install -y libgtk2.0-dev libgtk-3-dev -apt-get install -y libjpeg-dev libtiff-dev \ - libsdl1.2-dev libgstreamer-plugins-base1.0-dev \ - libnotify-dev freeglut3 freeglut3-dev libsm-dev \ - libwebkitgtk-dev libwebkitgtk-3.0-dev\ - libxtst-dev - - -# Install all available Python packages and their dev packages -apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv -apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -pyvenv-3.5 venvs/Py35 -chown -R vagrant:vagrant venvs - diff --git a/vagrant/fedora-26/Vagrantfile b/vagrant/fedora-26/Vagrantfile deleted file mode 100644 index 8c88abba..00000000 --- a/vagrant/fedora-26/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "fedora/26-cloud-base" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/fedora-26/bootstrap.sh b/vagrant/fedora-26/bootstrap.sh deleted file mode 100644 index 4e32876e..00000000 --- a/vagrant/fedora-26/bootstrap.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -dnf -y update -dnf -y install yum-utils - - -# Install necessary development tools, libs, etc. -dnf -y group install "Development Tools" -dnf -y install gcc-c++ - -dnf -y install gtk2 gtk2-devel gtk3 gtk3-devel \ - webkitgtk webkitgtk-devel webkitgtk3 webkitgtk3-devel \ - libjpeg-turbo-devel libpng-devel libtiff-devel \ - SDL SDL-devel gstreamer gstreamer-devel gstreamer-plugins-base-devel \ - freeglut freeglut-devel libnotify libnotify-devel libSM-devel \ - libXtst-devel - - -# Install all available Python packages and their dev packages -dnf -y install python python-tools python-devel python2-virtualenv -dnf -y install python3 python3-tools python3-devel -dnf -y install python35 - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. Set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -python3.5 -m venv venvs/Py35 -python3.6 -m venv venvs/Py36 -chown -R vagrant:vagrant venvs diff --git a/vagrant/fedora-27/Vagrantfile b/vagrant/fedora-27/Vagrantfile deleted file mode 100644 index de32e1da..00000000 --- a/vagrant/fedora-27/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "fedora/27-cloud-base" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/fedora-27/bootstrap.sh b/vagrant/fedora-27/bootstrap.sh deleted file mode 100644 index 0567c50c..00000000 --- a/vagrant/fedora-27/bootstrap.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -dnf -y update -dnf -y install yum-utils - - -# Install necessary development tools, libs, etc. -dnf -y group install "Development Tools" -dnf -y install gcc-c++ - -dnf -y install gtk2 gtk2-devel gtk3 gtk3-devel \ - webkitgtk4 webkitgtk4-devel \ - libjpeg-turbo-devel libpng-devel libtiff-devel \ - SDL SDL-devel gstreamer gstreamer-devel gstreamer-plugins-base-devel \ - freeglut freeglut-devel libnotify libnotify-devel libSM-devel \ - libXtst-devel - - -# Install all available Python packages and their dev packages -dnf -y install python python-tools python-devel python2-virtualenv -dnf -y install python3 python3-tools python3-devel -dnf -y install python35 - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. Set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -python3.5 -m venv venvs/Py35 -python3.6 -m venv venvs/Py36 -chown -R vagrant:vagrant venvs diff --git a/vagrant/fedora-28/Vagrantfile b/vagrant/fedora-28/Vagrantfile deleted file mode 100644 index 5cd4a40c..00000000 --- a/vagrant/fedora-28/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "fedora/28-cloud-base" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/fedora-28/bootstrap.sh b/vagrant/fedora-28/bootstrap.sh deleted file mode 100644 index ccb1aa5b..00000000 --- a/vagrant/fedora-28/bootstrap.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -dnf -y update -dnf -y install yum-utils - - -# Install necessary development tools, libs, etc. -dnf -y group install "Development Tools" -dnf -y install gcc-c++ - -dnf -y install gtk2 gtk2-devel gtk3 gtk3-devel \ - webkitgtk4 webkitgtk4-devel \ - libjpeg-turbo-devel libpng-devel libtiff-devel \ - SDL SDL-devel gstreamer gstreamer-devel gstreamer-plugins-base-devel \ - freeglut freeglut-devel libnotify libnotify-devel libSM-devel \ - libXtst-devel - - -# Install all available Python packages and their dev packages -dnf -y install python python-tools python-devel python2-virtualenv -dnf -y install python3 python3-tools python3-devel -dnf -y install python37 - - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. Set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -python3.6 -m venv venvs/Py36 -python3.7 -m venv venvs/Py37 -chown -R vagrant:vagrant venvs diff --git a/vagrant/scripts/build.sh b/vagrant/scripts/build.sh deleted file mode 100755 index ea9ae9ff..00000000 --- a/vagrant/scripts/build.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -#-------------------------------------------------------------------------- -# This script is run in the Vagrant VMs and performs the actual build of -# Phoenix. It expects to find a source tarball in ../../dist, (which is -# mapped to ~/dist in the VM) and to be given a name on the command-line to -# be used to distinguish this build from the other linux builds. -#-------------------------------------------------------------------------- - -set -o errexit - -NAME=$1 -if [ "$NAME" == "" ]; then - echo "ERROR: Build name must be given on the command line." - exit 1 -fi - -# This is the name of the virtual environment to be built. They should all be -# named like Py27, Py35, etc. If "all" is given then all the environments in -# ~/venvs will be used for a build. -PYENV=$2 -if [ "$PYENV" == "" ]; then - PYENV=all -fi - -# Either "gtk2", "gtk3" or "all" -PORT=$3 -if [ "$PORT" == "" ]; then - PORT=all -fi - - -TARBALL=$(ls ~/dist/wxPython-*.tar.gz) -if [ "$TARBALL" == "" ]; then - echo "ERROR: Source tarball not found." - exit 1 -fi - - - -# This function is called to do each build. -# It is given the virtual environment to be used, a tag (gtk2 or gtk3) to be -# used to help name the target folder, and an optional flag (--gtk3) to be -# passed on the build.py command line. -function do_build { - VENV=$1 - TAG=$2 - FLAG=$3 - - rm -rf ~/wxPython-* - - # setup - echo "**** do_build $VENV $TAG $FLAG ****" - echo "Using Python from VENV $VENV" - ORIG_PATH=$PATH - export PATH=$VENV/bin:$PATH - echo PYTHON: $(which python) - echo $(python -c "import sys; print(sys.version)") - - echo "Unpacking source archive..." - tar xzf $TARBALL - - # move into the source tree - cd ~/wxPython-* - - # update packages - pip install -U pip - pip install -U -r requirements.txt - - # Build wxWidgets, Phoenix and a Wheel - # Since we're using a source tarball we don't need to do all the code - # generation parts, all files should already be present - python build.py $FLAG build_wx build_py bdist_wheel - - # copy the results back to the host's shared dist folder - WXPYVER=$(python -c "import buildtools; buildtools.printVersion()") - DEST=~/dist/linux/$TAG/$NAME - mkdir -p $DEST - mv dist/*.whl $DEST - - # clean up - cd ~ - rm -rf ~/wxPython-* - export PATH=$ORIG_PATH -} - - - -# Do a build for each Python virtual environment in ~/venvs -for VENV in ~/venvs/*; do - - if [ $PYENV = all -o $PYENV = $(basename $VENV) ]; then - # build a package for GTK2? - if [ $PORT = all -o $PORT = gtk2 ]; then - do_build $VENV gtk2 --gtk2 - fi - - # build a package for GTK3? - if [ $PORT = all -o $PORT = gtk3 ]; then - do_build $VENV gtk3 --gtk3 - fi - fi -done - diff --git a/vagrant/ubuntu-14.04/Vagrantfile b/vagrant/ubuntu-14.04/Vagrantfile deleted file mode 100644 index b3c9229a..00000000 --- a/vagrant/ubuntu-14.04/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "ubuntu/trusty64" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/ubuntu-14.04/bootstrap.sh b/vagrant/ubuntu-14.04/bootstrap.sh deleted file mode 100644 index 8bcaf99b..00000000 --- a/vagrant/ubuntu-14.04/bootstrap.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -add-apt-repository ppa:deadsnakes/ppa -apt-get update - -# Install necessary development tools, libs, etc. -apt-get install -y build-essential dpkg-dev - -apt-get install -y libgtk2.0-dev libgtk-3-dev -apt-get install -y libjpeg-dev libtiff-dev \ - libsdl1.2-dev libgstreamer-plugins-base0.10-dev \ - libnotify-dev freeglut3 freeglut3-dev libsm-dev \ - libwebkitgtk-dev libwebkitgtk-3.0-dev libwebkit2gtk-3.0-dev \ - libxtst-dev - - -# Install all available Python packages and their dev packages -apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv -apt-get install -y python3.4 python3.4-dev libpython3.4-dev python3.4-venv -apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv -apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -python3.4 -m venv venvs/Py34 -python3.5 -m venv venvs/Py35 -python3.6 -m venv venvs/Py36 -chown -R vagrant:vagrant venvs - diff --git a/vagrant/ubuntu-16.04/Vagrantfile b/vagrant/ubuntu-16.04/Vagrantfile deleted file mode 100644 index 34e48293..00000000 --- a/vagrant/ubuntu-16.04/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "ubuntu/xenial64" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/ubuntu-16.04/bootstrap.sh b/vagrant/ubuntu-16.04/bootstrap.sh deleted file mode 100644 index b07c1b25..00000000 --- a/vagrant/ubuntu-16.04/bootstrap.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -add-apt-repository ppa:deadsnakes/ppa -apt-get update - -# Install necessary development tools, libs, etc. -apt-get install -y build-essential dpkg-dev -apt-get install -y aptitude mc - -apt-get install -y libgtk2.0-dev libgtk-3-dev -apt-get install -y libjpeg-dev libtiff-dev \ - libsdl1.2-dev libgstreamer-plugins-base0.10-dev \ - libgstreamer-plugins-base1.0-dev \ - libnotify-dev freeglut3 freeglut3-dev libsm-dev \ - libwebkitgtk-dev libwebkitgtk-3.0-dev libwebkit2gtk-4.0-dev \ - libxtst-dev - - -# Install all available Python packages and their dev packages -apt-get install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv -apt-get install -y python3.5 python3.5-dev libpython3.5-dev python3.5-venv -apt-get install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv -apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -pyvenv-3.5 venvs/Py35 -python3.6 -m venv venvs/Py36 -python3.7 -m venv venvs/Py37 - -chown -R vagrant:vagrant venvs - diff --git a/vagrant/ubuntu-18.04/Vagrantfile b/vagrant/ubuntu-18.04/Vagrantfile deleted file mode 100644 index 0c23062f..00000000 --- a/vagrant/ubuntu-18.04/Vagrantfile +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - # Set which Vagrant "box" (base image) to use, and tell it how to set up the - # VM, packages to install, etc. - config.vm.box = "ubuntu/bionic64" - config.vm.provision :shell, path: "bootstrap.sh" - - # Additional parameters for the VM - config.vm.provider "virtualbox" do |vb| - vb.memory = 4096 - vb.cpus = 4 - end - - # Share the Phoenix/dist folder so the VM can get the source tarball and has - # a place to put the build results. - config.vm.synced_folder "../../dist", "/home/vagrant/dist" - - # And share a folder with the build script - config.vm.synced_folder "../scripts", "/home/vagrant/scripts" - - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting this machine - config.vbguest.auto_update = false - -end diff --git a/vagrant/ubuntu-18.04/bootstrap.sh b/vagrant/ubuntu-18.04/bootstrap.sh deleted file mode 100644 index bb6bbcd0..00000000 --- a/vagrant/ubuntu-18.04/bootstrap.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Set up and update package repos -add-apt-repository ppa:deadsnakes/ppa -apt update - -# Install necessary development tools, libs, etc. -apt install -y build-essential dpkg-dev -apt install -y aptitude mc - -apt install -y libgtk2.0-dev libgtk-3-dev -apt install -y libjpeg-dev libtiff-dev \ - libsdl1.2-dev libgstreamer-plugins-base1.0-dev \ - libnotify-dev freeglut3 freeglut3-dev libsm-dev \ - libwebkitgtk-dev libwebkitgtk-3.0-dev - - -# Install all available Python packages and their dev packages -apt install -y python2.7 python2.7-dev libpython2.7-dev python-virtualenv -apt install -y python3.6 python3.6-dev libpython3.6-dev python3.6-venv -apt install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv - -# Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. -mkdir venvs -virtualenv --python=python2.7 venvs/Py27 -python3.6 -m venv venvs/Py36 -python3.7 -m venv venvs/Py37 - -chown -R vagrant:vagrant venvs - From f7700c8cb66fc80762874b472ce0a35a9581c326 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Jul 2019 12:25:41 -0700 Subject: [PATCH 30/30] Add a note to the changelog about the switch to Docker --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 633c7327..e897db8f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -58,7 +58,10 @@ Other changes in this release: wxPython for compatibility, but with a zero value. You can just stop using it in your code with no change in behavior. (#1278) +* Replaced the Vagrant VMs used for building wxPython for various Linux distros + with Docker images. + 4.0.6 "Applesauce"