Merge pull request #7426 from soltanmm/distribtest

Test Python source distribution installation
pull/7374/head
kpayson64 9 years ago committed by GitHub
commit 06f64c7a7f
  1. 55
      test/distrib/python/run_distrib_test.sh
  2. 2
      tools/dockerfile/distribtest/python_arch_x64/Dockerfile
  3. 2
      tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
  4. 2
      tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
  5. 2
      tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
  6. 2
      tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
  7. 1
      tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
  8. 1
      tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
  9. 1
      tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
  10. 2
      tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
  11. 2
      tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
  12. 2
      tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
  13. 2
      tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
  14. 2
      tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
  15. 2
      tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
  16. 2
      tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
  17. 2
      tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile

@ -33,34 +33,47 @@ set -ex
cd $(dirname $0) cd $(dirname $0)
# Pick up the source dist archive whatever its version is # Pick up the source dist archive whatever its version is
SDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.tar.gz
BDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.whl BDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.whl
TOOLS_SDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio_tools-*.tar.gz
TOOLS_BDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio_tools-*.whl TOOLS_BDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio_tools-*.whl
if [ ! -f ${SDIST_ARCHIVE} ] function make_virtualenv() {
then virtualenv $1
echo "Archive ${SDIST_ARCHIVE} does not exist." $1/bin/python -m pip install --upgrade six pip
exit 1 $1/bin/python -m pip install cython
fi }
PYTHON=python2 function at_least_one_installs() {
PIP=pip2 for file in "$@"; do
which $PYTHON || PYTHON=python if python -m pip install $file; then
which $PIP || PIP=pip return 0
fi
done
return -1
}
# TODO(jtattermusch): this shouldn't be required make_virtualenv bdist_test
# TODO(jtattermusch): run the command twice to workaround docker-on-overlay make_virtualenv sdist_test
# issue https://github.com/docker/docker/issues/12327
# (first attempt will fail when using docker with overlayFS)
${PIP} install --upgrade six pip || ${PIP} install --upgrade six pip
# At least one of the bdist packages has to succeed (whichever one matches the #
# test machine, anyway). # Install our distributions in order of dependencies
for bdist in ${BDIST_ARCHIVES} ${TOOLS_BDIST_ARCHIVES}; do #
($PYTHON -m pip install $bdist) || true
done (source bdist_test/bin/activate && at_least_one_installs ${BDIST_ARCHIVES})
(source bdist_test/bin/activate && at_least_one_installs ${TOOLS_BDIST_ARCHIVES})
(source sdist_test/bin/activate && at_least_one_installs ${SDIST_ARCHIVES})
(source sdist_test/bin/activate && at_least_one_installs ${TOOLS_SDIST_ARCHIVES})
#
# Test our distributions
#
# TODO(jtattermusch): add a .proto file to the distribtest, generate python # TODO(jtattermusch): add a .proto file to the distribtest, generate python
# code from it and then use the generated code from distribtest.py # code from it and then use the generated code from distribtest.py
$PYTHON -m grpc.tools.protoc (source bdist_test/bin/activate && python -m grpc.tools.protoc --help)
(source sdist_test/bin/activate && python -m grpc.tools.protoc --help)
$PYTHON distribtest.py (source bdist_test/bin/activate && python distribtest.py)
(source sdist_test/bin/activate && python distribtest.py)

@ -33,4 +33,4 @@ RUN pacman --noconfirm -Syy
RUN pacman --noconfirm -S openssl RUN pacman --noconfirm -S openssl
RUN pacman --noconfirm -S python2 RUN pacman --noconfirm -S python2
RUN pacman --noconfirm -S python2-pip RUN pacman --noconfirm -S python2-pip
RUN pip install virtualenv

@ -44,3 +44,5 @@ RUN curl https://bootstrap.pypa.io/get-pip.py | python -
# "which" command required by python's run_distrib_test.sh # "which" command required by python's run_distrib_test.sh
RUN yum install -y which RUN yum install -y which
RUN pip install virtualenv

@ -32,4 +32,4 @@ FROM centos:7
RUN yum install -y python RUN yum install -y python
RUN yum install -y epel-release RUN yum install -y epel-release
RUN yum install -y python-pip RUN yum install -y python-pip
RUN pip install virtualenv

@ -35,3 +35,5 @@ RUN yum clean all && yum update -y && yum install -y python python-pip
# Trying twice makes it work fine. # Trying twice makes it work fine.
# https://github.com/docker/docker/issues/10180 # https://github.com/docker/docker/issues/10180
RUN pip install --upgrade six || pip install --upgrade six RUN pip install --upgrade six || pip install --upgrade six
RUN pip install virtualenv

@ -40,3 +40,5 @@ RUN yum clean all && yum update -y && yum install -y python python-pip
# Trying twice makes it work fine. # Trying twice makes it work fine.
# https://github.com/docker/docker/issues/10180 # https://github.com/docker/docker/issues/10180
RUN pip2 install --upgrade six || pip2 install --upgrade six RUN pip2 install --upgrade six || pip2 install --upgrade six
RUN pip2 install virtualenv

@ -30,3 +30,4 @@
FROM fedora:22 FROM fedora:22
RUN yum clean all && yum update -y && yum install -y python python-pip RUN yum clean all && yum update -y && yum install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,4 @@
FROM fedora:23 FROM fedora:23
RUN yum clean all && yum update -y && yum install -y python python-pip RUN yum clean all && yum update -y && yum install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,4 @@
FROM debian:jessie FROM debian:jessie
RUN apt-get update && apt-get install -y python python-pip RUN apt-get update && apt-get install -y python python-pip
RUN pip install virtualenv

@ -31,6 +31,8 @@ FROM 32bit/debian:jessie
RUN apt-get update && apt-get install -y python python-pip RUN apt-get update && apt-get install -y python python-pip
RUN pip install virtualenv
# docker is running on a 64-bit machine, so we need to # docker is running on a 64-bit machine, so we need to
# override "uname -m" to report i686 instead of x86_64, otherwise # override "uname -m" to report i686 instead of x86_64, otherwise
# python will choose a wrong binary package to install. # python will choose a wrong binary package to install.

@ -38,3 +38,5 @@ RUN zypper --non-interactive install which
# Without this, pip won't be able to connect to # Without this, pip won't be able to connect to
# https://pypi.python.org/simple/ # https://pypi.python.org/simple/
RUN zypper --non-interactive install ca-certificates-mozilla RUN zypper --non-interactive install ca-certificates-mozilla
RUN pip install virtualenv

@ -30,3 +30,5 @@
FROM ubuntu:12.04 FROM ubuntu:12.04
RUN apt-get update -y && apt-get install -y python python-pip RUN apt-get update -y && apt-get install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,5 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
RUN apt-get update -y && apt-get install -y python python-pip RUN apt-get update -y && apt-get install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,5 @@
FROM ubuntu:15.04 FROM ubuntu:15.04
RUN apt-get update -y && apt-get install -y python python-pip RUN apt-get update -y && apt-get install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,5 @@
FROM ubuntu:15.10 FROM ubuntu:15.10
RUN apt-get update -y && apt-get install -y python python-pip RUN apt-get update -y && apt-get install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,5 @@
FROM ubuntu:16.04 FROM ubuntu:16.04
RUN apt-get update -y && apt-get install -y python python-pip RUN apt-get update -y && apt-get install -y python python-pip
RUN pip install virtualenv

@ -30,3 +30,5 @@
FROM debian:wheezy FROM debian:wheezy
RUN apt-get update -y && apt-get install -y python python-pip RUN apt-get update -y && apt-get install -y python python-pip
RUN pip install virtualenv

Loading…
Cancel
Save