Fix amphora image build

DIB dropped Python 2 support in its version 3.0.0 major release and as
so we had to pin it to 2.30.0 in stable/stein and stable/train branches.
However, upstream get-pip.sh recently introduced a regression where it
does not work well with Python <-3.5. Sadly, DIB 2.30.0 points to master
get-pip.sh [1] and DIB is branchless so the fix cannot be backported and
we are in a deadlock scenario where Python <=3.5 amphora images can't be
built.

To work-around this issue on stable/train, we have to make a compromise:
either build amphora images using master DIB and Python 3 only or be
stuck (unless someone else can come up with another approach, all ears).
Ussuri and newer releases are not impacted by this issue as they are
Python >=3.6 only releases.

The same issue also applies to Stein and that has an impact on the
octavia-grenade CI job in stable/train. Since Stein Octavia is EOL [2],
we no longer have to test upgrades.

[1] https://review.opendev.org/c/openstack/diskimage-builder/+/772254
[2] https://review.opendev.org/c/openstack/releases/+/772847

Change-Id: I13da9a49ace803e957dc52e4882b78141bc7bef3
This commit is contained in:
Carlos Goncalves 2021-02-03 09:59:21 +00:00
parent fd622009e6
commit 131c69608d
3 changed files with 14 additions and 36 deletions

View File

@ -98,7 +98,20 @@ function build_octavia_worker_image {
fi
sudo mkdir -m755 ${dib_logs}
sudo chown $STACK_USER ${dib_logs}
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh -l ${dib_logs}/$(basename $OCTAVIA_AMP_IMAGE_FILE).log $octavia_dib_tracing_arg -o $OCTAVIA_AMP_IMAGE_FILE ${PARAM_OCTAVIA_AMP_BASE_OS:-} ${PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:-} ${PARAM_OCTAVIA_AMP_IMAGE_SIZE:-}
# Build amphora image with master DIB in a Python 3 virtual environment
(
DIB_VENV_DIR=$(mktemp -d)
DIB_GIT_DIR=/tmp/dib-octavia
python3 -m venv $DIB_VENV_DIR
export USE_PYTHON3=True
export PATH=$DIB_VENV_DIR/bin:$PATH
if ! [ -d $DIB_GIT_DIR ]; then
git clone ${GITREPO["diskimage-builder"]} $DIB_GIT_DIR
fi
(cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) | sed '/diskimage-builder/d' > $DIB_VENV_DIR/u-c.txt
pip install -c $DIB_VENV_DIR/u-c.txt $DIB_GIT_DIR
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh -l ${dib_logs}/$(basename $OCTAVIA_AMP_IMAGE_FILE).log $octavia_dib_tracing_arg -o $OCTAVIA_AMP_IMAGE_FILE ${PARAM_OCTAVIA_AMP_BASE_OS:-} ${PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:-} ${PARAM_OCTAVIA_AMP_IMAGE_SIZE:-}
)
fi
upload_image file://${OCTAVIA_AMP_IMAGE_FILE} $TOKEN

View File

@ -69,19 +69,6 @@
amphora_image_size: 3
amphora_os_release: 28
- job:
name: octavia-grenade
parent: octavia-legacy-dsvm-base
run: playbooks/legacy/grenade-devstack-octavia/run.yaml
post-run: playbooks/legacy/grenade-devstack-octavia/post.yaml
required-projects:
- openstack/grenade
- openstack/devstack-gate
- openstack/octavia
- openstack/octavia-lib
- openstack/octavia-tempest-plugin
- openstack/python-octaviaclient
- job:
name: octavia-v2-dsvm-scenario-amphora-v2
parent: octavia-v2-dsvm-scenario

View File

@ -38,17 +38,6 @@
voting: false
- octavia-v2-dsvm-py2-scenario-two-node:
voting: false
- octavia-grenade:
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^octavia/tests/unit/.*$
- ^releasenotes/.*$
- ^setup.cfg$
- ^tools/.*$
- ^(test-|)requirements.txt$
- ^tox.ini$
- octavia-v2-dsvm-tls-barbican:
irrelevant-files:
- ^.*\.rst$
@ -92,17 +81,6 @@
- octavia-v2-dsvm-noop-api
- octavia-v2-dsvm-noop-py2-api
- octavia-v2-dsvm-scenario
- octavia-grenade:
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^octavia/tests/unit/.*$
- ^releasenotes/.*$
- ^setup.cfg$
- ^tools/.*$
- ^(test-|)requirements.txt$
- ^tox.ini$
periodic:
jobs:
- publish-openstack-octavia-amphora-image-xenial: