Merge pull request #1757 from wxWidgets/trim-builds

Trim number of builds
This commit is contained in:
Robin Dunn
2020-07-31 20:49:10 -07:00
committed by GitHub
17 changed files with 99 additions and 77 deletions

View File

@@ -1,14 +1,11 @@
jobs:
- job: Linux_CI
timeoutInMinutes: 90
displayName: 'Linux CI'
pool:
vmImage: 'Ubuntu 16.04'
strategy:
matrix:
Py27:
python: 'python2.7'
make_venv: 'python2.7 -m virtualenv venv'
venv_pkg: 'python-virtualenv'
matrix:
Py36:
python: 'python3.6'
make_venv: 'python3.6 -m venv venv'
@@ -37,14 +34,14 @@ jobs:
sudo apt-get install -y libgtk-3-dev libjpeg-dev libtiff-dev \
libsdl2-dev libgstreamer-plugins-base1.0-dev libnotify-dev \
libsm-dev libwebkit2gtk-4.0-dev libxtst-dev \
libgl1-mesa-dev libglu1-mesa-dev $VENV_PKG
libgl1-mesa-dev libglu1-mesa-dev $VENV_PKG
displayName: 'Install deb package requirements'
- script: |
$PYTHON --version
$PYTHON --version
$MAKE_VENV
source venv/bin/activate
python -m pip install -U pip "setuptools<45" wheel
python -m pip install -U pip "setuptools<45" wheel
python -m pip install -r requirements.txt
displayName: 'Install Python dependencies'

View File

@@ -1,14 +1,11 @@
jobs:
- job: MacOS_CI
timeoutInMinutes: 90
displayName: 'MacOS CI'
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Py27:
python_version: '2.7.16'
python_pkg: 'python-2.7.16-macosx10.9.pkg'
python: 'python2.7'
matrix:
Py36:
python_version: '3.6.8'
python_pkg: 'python-3.6.8-macosx10.9.pkg'
@@ -40,7 +37,7 @@ jobs:
- script: |
curl -O https://bootstrap.pypa.io/get-pip.py
$PYTHON get-pip.py
$PYTHON -m pip install -U "setuptools<45" wheel
$PYTHON -m pip install -U "setuptools<45" wheel
$PYTHON -m pip install -r requirements.txt
displayName: 'Install Python dependencies'

View File

@@ -1,11 +1,12 @@
jobs:
- job: Windows_CI
timeoutInMinutes: 90
displayName: 'Windows CI'
pool:
#vmImage: 'vs2015-win2012r2'
vmImage: 'vs2017-win2016'
strategy:
matrix:
matrix:
Py36_x86:
python.version: '3.6'
python.arch: x86
@@ -41,7 +42,7 @@ jobs:
submodules: recursive
- task: UsePythonVersion@0
inputs:
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.arch)'
@@ -53,7 +54,7 @@ jobs:
- bash: |
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
python -m pip install -U "setuptools<45" wheel
python -m pip install -U "setuptools<45" wheel
python -m pip install -r requirements.txt
displayName: 'Install Python dependencies'

View File

@@ -157,7 +157,7 @@ def makeBuildFactory(wxport, py_ver, build_type='basic'):
steps.ShellCommand(name='build wxPython wheel and upload', command=cmd, env=environ))
if build_type == 'docs':
cmd = [PYTHON, 'build.py', 'wxlib', 'sphinx', 'bdist_docs', '--upload'] + common_opts
cmd = [PYTHON, 'build.py', 'wxlib', 'sphinx', 'bdist_docs', 'docset_py', '--upload'] + common_opts
factory.addStep(
steps.ShellCommand(name='build wxPython documentation and upload', command=cmd, env=environ))
@@ -191,39 +191,28 @@ def makeTriggerFactory():
# Organize the builder names into these lists to make it easier to specify them
# for the schedulers below, as well as for creating the BuilderConfig objects.
regularBuilders = [ 'build-osx-py27',
'build-osx-py36',
regularBuilders = [ 'build-osx-py36',
'build-osx-py37',
'build-osx-py38',
'build-gtk2-py27',
'build-gtk2-py36',
'build-gtk2-py37',
'build-gtk2-py38',
'build-gtk3-py27',
'build-gtk3-py36',
'build-gtk3-py37',
'build-gtk3-py38',
'build-win32-py27',
'build-win32-py36',
'build-win32-py37',
'build-win32-py38',
'build-win64-py27',
'build-win64-py36',
'build-win64-py37',
'build-win64-py38',
]
distBuilders = [ 'dist-osx-py27',
#'dist-osx-py35',
'dist-osx-py36',
distBuilders = [ 'dist-osx-py36',
'dist-osx-py37',
'dist-osx-py38',
'dist-win32-py27',
#'dist-win32-py35',
'dist-win32-py36',
'dist-win32-py37',
'dist-win32-py38',
'dist-win64-py27',
#'dist-win64-py35',
'dist-win64-py36',
'dist-win64-py37',
'dist-win64-py38',

View File

@@ -24,9 +24,11 @@ this writing you can pull images with these names and tags:
wxpython4/build:debian-10
wxpython4/build:fedora-29
wxpython4/build:fedora-30
wxpython4/build:fedora-31
wxpython4/build:ubuntu-14.04
wxpython4/build:ubuntu-16.04
wxpython4/build:ubuntu-18.04
wxpython4/build:ubuntu-20.04
Building Images
@@ -36,7 +38,7 @@ 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
inv build-images
And one or more specific images can be built like this::

View File

@@ -12,7 +12,8 @@ ENV GTK2_OK=yes
# Update and install basic OS packages
RUN \
yum -y install https://centos7.iuscommunity.org/ius-release.rpm; \
yum -y install https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; \
yum -y update; \
yum -y group install development; \
yum -y install sudo nano which; \
@@ -41,7 +42,7 @@ RUN \
# 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
# Clean up the yum caches
yum clean all;
# Set the user and group to use for the rest of the commands
@@ -54,7 +55,6 @@ WORKDIR ${HOME}
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

View File

@@ -41,7 +41,8 @@ RUN \
webkit2gtk3-devel; \
# Install all available Python packages and their dev packages
yum -y install python3 python3-tools python3-devel; \
# CLean up the yum caches
yum -y install python38 python38-devel; \
# Clean up the yum caches
yum clean all;
# Set the user and group to use for the rest of the commands
@@ -54,7 +55,8 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
python3.6 -m venv venvs/Py36;
python3.6 -m venv venvs/Py36; \
python3.8 -m venv venvs/Py38;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -37,11 +37,10 @@ RUN \
libtiff-dev \
libwebkit2gtk-4.0-dev \
libxtst-dev; \
apt-get clean;
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;
@@ -56,8 +55,7 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.7 -m venv venvs/Py37;
python3.7 -m venv venvs/Py37;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -39,11 +39,10 @@ RUN \
libwebkit2gtk-4.0-dev \
libwebkitgtk-dev \
libxtst-dev; \
apt-get clean;
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;
@@ -58,8 +57,7 @@ WORKDIR ${HOME}
RUN \
cd ${HOME}; \
mkdir -p ${HOME}/venvs; \
virtualenv --python=python2.7 venvs/Py27; \
python3.5 -m venv venvs/Py35;
python3.5 -m venv venvs/Py35;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -24,8 +24,8 @@ RUN \
gstreamer1-devel \
gstreamer1-plugins-base-devel \
gtk3-devel \
libjpeg-turbo-devel \
libnotify-devel \
libjpeg-turbo-devel \
libnotify-devel \
libpng-devel \
libSM-devel \
libtiff-devel \
@@ -36,7 +36,7 @@ RUN \
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
# Clean up dnf caches
dnf clean all;
@@ -50,9 +50,8 @@ WORKDIR ${HOME}
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;
python3.7 -m venv venvs/Py37;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -33,10 +33,9 @@ RUN \
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
# Clean up dnf caches
dnf clean all;
@@ -50,9 +49,8 @@ WORKDIR ${HOME}
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;
python3.7 -m venv venvs/Py37;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -35,7 +35,7 @@ RUN \
# Install all available Python packages and their dev packages
dnf -y install python3 python3-tools python3-devel; \
dnf -y install python38; \
# CLean up dnf caches
# Clean up dnf caches
dnf clean all;

View File

@@ -41,13 +41,12 @@ RUN \
libwebkitgtk-3.0-dev \
libwebkitgtk-dev \
libxtst-dev; \
apt-get clean;
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;
@@ -62,9 +61,8 @@ WORKDIR ${HOME}
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;
python3.6 -m venv venvs/Py36;
# Add files from host into the container
COPY scripts ${HOME}/bin

View File

@@ -39,13 +39,12 @@ RUN \
libwebkitgtk-3.0-dev \
libwebkitgtk-dev \
libxtst-dev; \
apt-get clean;
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.8 python3.8-dev libpython3.8-dev python3.8-venv; \
apt-get clean;
@@ -60,7 +59,6 @@ WORKDIR ${HOME}
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; \
python3.8 -m venv venvs/Py38;

View File

@@ -44,12 +44,11 @@ RUN \
libwebkit2gtk-4.0-dev \
libwebkitgtk-dev \
libxtst-dev; \
apt-get clean;
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 install -y python3.8 python3.8-dev libpython3.8-dev python3.8-venv; \
@@ -69,7 +68,6 @@ WORKDIR ${HOME}
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; \
python3.8 -m venv venvs/Py38;

View File

@@ -4,6 +4,7 @@ echo " User: " $(whoami)
echo " ~/bin: " $(ls ~/bin)
echo " ~/venvs:" $(ls ~/venvs)
echo " /dist: " $(ls /dist)
echo " GTK2_OK: " $GTK2_OK
echo ""
if [ -x /usr/bin/lsb_release ]; then

View File

@@ -18,20 +18,27 @@ from invoke import task, run
HERE = os.path.abspath(os.path.dirname(__file__))
# Distros that have been promoted to Emeritus status. They can still be selected
# manually, but will be excluded by default when selecting all images.
OLD = [ 'ubuntu-14.04' ]
@task(
aliases=['build_image', 'bi'],
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.',
'include_old': 'Include the "OLD" distros when selecting all.'
},
iterable=['image'],
)
def build_images(ctx, image, gui=False):
def build_images(ctx, image, gui=False, include_old=False):
"""
Build docker image(s).
"""
if image == []:
image = _get_all_distros(gui)
image = _get_all_distros(gui, include_old)
os.chdir(HERE)
dist=os.path.abspath('../dist')
@@ -43,6 +50,30 @@ def build_images(ctx, image, gui=False):
'-t wxpython4/{type}:{name} .'.format(name=img_name, type=img_type),
pty=True, echo=True)
# test it
test_images(ctx, [img_name], gui)
@task(
aliases=['test_image', 'ti'],
help={
'image': 'Name of a docker image to test. May be specified more than once. Defaults to all.',
'gui': 'Test the gui version of an image instead of just the build image.',
'include_old': 'Include the "OLD" distros when selecting all.'
},
iterable=['image'],
)
def test_images(ctx, image, gui=False, include_old=False):
"""
Build docker image(s).
"""
if image == []:
image = _get_all_distros(gui, include_old)
os.chdir(HERE)
dist=os.path.abspath('../dist')
img_type = 'gui' if gui else 'build'
for img_name in image:
# test it
ctx.run('docker run -it --rm -v {}:/dist '
'wxpython4/{}:{} hello.sh'.format(dist, img_type, img_name),
pty=True, echo=True)
@@ -52,16 +83,17 @@ def build_images(ctx, image, gui=False):
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.',
'include_old': 'Include the "OLD" distros when selecting all.'
},
iterable=['image'],
)
def push(ctx, image, gui=False):
def push(ctx, image, gui=False, include_old=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)
image = _get_all_distros(gui, include_old)
os.chdir(HERE)
img_type = 'gui' if gui else 'build'
@@ -72,17 +104,17 @@ def push(ctx, image, gui=False):
pty=True, echo=True)
@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.',
'venv': 'The name of a Python virtual environment to use for the build, like Py27, Py36, etc. Defaults to all.'
'port': 'One of "gtk2", "gtk3" or "all". Defaults to "gtk3".',
'venv': 'The name of a Python virtual environment to use for the build, like Py27, Py36, etc. Defaults to all.',
'include_old': 'Include the "OLD" distros when selecting all.'
},
iterable=['image'],
)
def build_wxpython(ctx, image, venv='all', port='all'):
def build_wxpython(ctx, image, venv='all', port='gtk3', include_old=False):
"""
Use docker images to build wxPython.
@@ -91,7 +123,7 @@ def build_wxpython(ctx, image, venv='all', port='all'):
release or snapshot build of wxPython.
"""
if image == []:
image = _get_all_distros()
image = _get_all_distros(False, include_old)
os.chdir(HERE)
dist=os.path.abspath('../dist')
@@ -100,6 +132,7 @@ def build_wxpython(ctx, image, venv='all', port='all'):
'wxpython4/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",
@@ -125,8 +158,21 @@ def run(ctx, image_tag, cmd=None, gui=False, port=5901, keep=False):
pty=True, echo=True)
def _get_all_distros(gui=False):
def _get_all_distros(gui=False, include_old=False):
os.chdir(HERE)
wildcard = os.path.join('gui' if gui else 'build', '*-*')
all_matching = glob.glob(wildcard)
return [os.path.basename(item) for item in all_matching]
all_matching = sorted(glob.glob(wildcard))
all_matching = [os.path.basename(item) for item in all_matching]
if not include_old:
all_matching = [name for name in all_matching if name not in OLD]
return all_matching
@task()
def showall(ctx, gui=False, include_old=False):
"""
Just for easy testing of _get_all_distros()
"""
images = _get_all_distros(gui, include_old)
for img in images:
print(img)