diff --git a/Dockerfile b/Dockerfile index 4e56b02..f83c49a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,14 +7,13 @@ ARG WHEELS=loci/requirements:master-ubuntu ARG PROJECT_REPO=https://opendev.org/openstack/${PROJECT} ARG PROJECT_REF=master ARG PROJECT_RELEASE=master -ARG DISTRO -ARG PROFILES +ARG DISTRO="" +ARG PROFILES="" ARG PIP_PACKAGES="" ARG PIP_ARGS="" ARG PIP_WHEEL_ARGS=$PIP_ARGS ARG DIST_PACKAGES="" ARG PLUGIN=no -ARG PYTHON3=indeed ARG EXTRA_BINDEP="" ARG EXTRA_PYDEP="" ARG REGISTRY_PROTOCOL="detect" diff --git a/bindep.txt b/bindep.txt index fc4b650..c5bf9e7 100644 --- a/bindep.txt +++ b/bindep.txt @@ -34,7 +34,7 @@ kvm [platform:rpm (infra libvirt)] lapack-devel [platform:rpm requirements] libapache2-mod-auth-mellon [platform:dpkg (keystone apache mellon)] libapache2-mod-auth-openidc [platform:dpkg (keystone apache openidc)] -libapache2-mod-wsgi-py3 [platform:dpkg (apache python3)] +libapache2-mod-wsgi-py3 [platform:dpkg apache] libblas-dev [platform:dpkg requirements] liberasurecode-dev [platform:dpkg requirements] liberasurecode-devel [platform:rpm requirements] @@ -54,6 +54,8 @@ libosinfo [platform:rpm nova] libosinfo-bin [platform:dpkg nova] libpcre3-dev [platform:dpkg requirements] libpq-dev [platform:dpkg requirements] +# libpythonx.y installation logic is moved to scripts to be able to dynamically +# determine minor version from default python installed in a system. librdkafka-dev [platform:dpkg requirements] libreswan [platform:rpm (neutron vpn)] libsasl2-dev [platform:dpkg requirements] @@ -99,11 +101,12 @@ pkg-config [platform:dpkg requirements] pkgconfig [platform:rpm requirements] postgresql-devel [platform:rpm requirements] postgresql-server-devel [platform:suse requirements] -python3-dev [platform:dpkg (requirements python3)] -python3-devel [platform:rpm (requirements python3)] -python3-mysqldb [platform:dpkg (monasca api python3)] -python3-rados [platform:dpkg (glance ceph python3) (cinder ceph python3) (manila ceph python3) (nova ceph python3)] -python3-rbd [platform:dpkg platform:rpm (glance ceph python3) (cinder ceph python3) (manila ceph python3) (nova ceph python3)] +python-mysql [platform:rpm (monasca api)] +python3-dev [platform:dpkg requirements] +python3-devel [platform:rpm requirements] +python3-mysqldb [platform:dpkg (monasca api)] +python3-rados [platform:dpkg (glance ceph) (cinder ceph) (manila ceph) (nova ceph)] +python3-rbd [(glance ceph) (cinder ceph) (manila ceph) (nova ceph)] qemu [platform:dpkg (infra libvirt)] qemu-img [platform:rpm (nova qemu) (ironic qemu) (cinder qemu) (glance qemu)] qemu-utils [platform:dpkg (nova qemu) (ironic qemu) (cinder qemu) (glance qemu)] diff --git a/playbooks/vars.yaml b/playbooks/vars.yaml index e8a779d..8791d77 100644 --- a/playbooks/vars.yaml +++ b/playbooks/vars.yaml @@ -80,4 +80,3 @@ distros: FROM: base:ubuntu_bionic PROJECT_REF: "stable/ussuri" PROJECT_RELEASE: "ussuri" - PYTHON3: yes diff --git a/scripts/install.sh b/scripts/install.sh index 335c700..aae0d90 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -5,23 +5,14 @@ set -ex distro=$(awk -F= '/^ID=/ {gsub(/\"/, "", $2); print $2}' /etc/*release) export distro=${DISTRO:=$distro} -if [[ "${PYTHON3}" == "no" ]]; then - dpkg_python_packages=("python" "virtualenv") - rpm_python_packages=("python" "python-virtualenv") - python3="" - python_version=2 -else - dpkg_python_packages=("python3" "python3-virtualenv") - rpm_python_packages=("python3") - python3="python3" - python_version=3 -fi +dpkg_python_packages=("python3" "python3-virtualenv") +rpm_python_packages=("python3") case ${distro} in ubuntu) export LC_CTYPE=C.UTF-8 apt-get update - if [[ ! -z "$(apt-cache search ^${python3}-distutils$)" ]]; then + if [[ ! -z "$(apt-cache search ^python3-distutils$)" ]]; then dpkg_python_packages+=("python3-distutils") fi apt-get upgrade -y @@ -34,8 +25,7 @@ case ${distro} in sudo \ ${dpkg_python_packages[@]} apt-get install -y --no-install-recommends \ - libpython${python_version}.$(python${python_version} -c 'import sys;\ - print(sys.version_info.minor);') + libpython3.$(python3 -c 'import sys; print(sys.version_info.minor);') ;; centos) export LC_CTYPE=en_US.UTF-8 @@ -78,7 +68,7 @@ if [[ "${PLUGIN}" == "no" ]]; then $(dirname $0)/setup_pip.sh $(dirname $0)/pip_install.sh bindep for file in /opt/loci/pydep*; do - PYDEP_PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROJECT_RELEASE} ${PROFILES} ${python3} || :)) + PYDEP_PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROJECT_RELEASE} ${PROFILES} || :)) done $(dirname $0)/pip_install.sh ${PYDEP_PACKAGES[@]} fi diff --git a/scripts/install_packages.sh b/scripts/install_packages.sh index 5f470d4..23d17c4 100755 --- a/scripts/install_packages.sh +++ b/scripts/install_packages.sh @@ -2,12 +2,8 @@ set -ex -if [[ "${PYTHON3}" != "no" ]]; then - python3=python3 -fi - for file in /opt/loci/bindep*; do - PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROFILES} ${python3} || :)) + PACKAGES+=($(bindep -f $file -b -l newline ${PROJECT} ${PROFILES} || :)) done if [[ ! -z ${PACKAGES} ]]; then diff --git a/scripts/setup_pip.sh b/scripts/setup_pip.sh index bf4021c..76bb4ca 100755 --- a/scripts/setup_pip.sh +++ b/scripts/setup_pip.sh @@ -3,11 +3,7 @@ set -ex -if [[ "${PYTHON3}" == "no" ]]; then - TMP_VIRTUALENV="virtualenv" -else - TMP_VIRTUALENV="python3 -m virtualenv --python=python3" -fi +TMP_VIRTUALENV="python3 -m virtualenv --python=python3" # This little dance allows us to install the latest pip # without get_pip.py or the python-pip package (in epel on centos)