From bfb152091d48cf5157aeca15ab94011f24aab718 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Mon, 5 Jun 2017 13:09:06 +0200 Subject: [PATCH] [imagebuild] support requirements referring to /opt/stack/new Now that ironic-lib builds IPA from source, the IPA building procedure needs to support requirements referring to /opt/stack/new. As upper-constraints are not actually needed in the finalise step, they're no longer used there to avoid dealing with file:/// references. We also allow pre-release packages to be installed by pip. Also install git as it's a build requirement for PBR. Only tinyipa is updated, as it's used in the ironic-lib gate. Change-Id: Ia942cb710eb3fe1ba56c68f91fa893795c9cb651 Closes-Bug: #1695877 (cherry picked from commit 381f5073b5d7b15ac848cdbc8dfbb252ff417aba) --- imagebuild/tinyipa/build-tinyipa.sh | 15 +++++++++++++++ imagebuild/tinyipa/build_files/buildreqs.lst | 1 + imagebuild/tinyipa/finalise-tinyipa.sh | 4 +--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/imagebuild/tinyipa/build-tinyipa.sh b/imagebuild/tinyipa/build-tinyipa.sh index 1d75c0e5c..a2eb8c290 100755 --- a/imagebuild/tinyipa/build-tinyipa.sh +++ b/imagebuild/tinyipa/build-tinyipa.sh @@ -76,6 +76,8 @@ cp requirements.txt $BUILDDIR/tmp/ipa-requirements.txt imagebuild/common/generate_upper_constraints.sh upper-constraints.txt cp upper-constraints.txt $BUILDDIR/tmp/upper-constraints.txt +echo Using upper-constraints: +cat upper-constraints.txt cd $WORKDIR sudo cp /etc/resolv.conf $BUILDDIR/etc/resolv.conf @@ -84,6 +86,17 @@ trap "sudo umount $BUILDDIR/proc; sudo umount $BUILDDIR/dev/pts" EXIT sudo mount --bind /proc $BUILDDIR/proc sudo mount --bind /dev/pts $BUILDDIR/dev/pts +if [ -d /opt/stack/new ]; then + # Running in CI environment, make checkouts available + $CHROOT_CMD mkdir -p /opt/stack/new + for project in $(ls /opt/stack/new); do + if grep -q "$project" $BUILDDIR/tmp/upper-constraints.txt && + [ -d "/opt/stack/new/$project/.git" ]; then + sudo cp -R "/opt/stack/new/$project" $BUILDDIR/opt/stack/new/ + fi + done +fi + $CHROOT_CMD mkdir /etc/sysconfig/tcedir $CHROOT_CMD chmod a+rwx /etc/sysconfig/tcedir $CHROOT_CMD touch /etc/sysconfig/tcuser @@ -103,6 +116,8 @@ $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels setu $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels pip $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ipa-requirements.txt $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --no-index --pre --wheel-dir /tmp/wheels --find-links=/tmp/localpip --find-links=/tmp/wheels ironic-python-agent +echo Resulting wheels: +ls -1 $BUILDDIR/tmp/wheels # Build tgt rm -rf $WORKDIR/build_files/tgt.tcz diff --git a/imagebuild/tinyipa/build_files/buildreqs.lst b/imagebuild/tinyipa/build_files/buildreqs.lst index 2b5c216df..5e16e4326 100644 --- a/imagebuild/tinyipa/build_files/buildreqs.lst +++ b/imagebuild/tinyipa/build_files/buildreqs.lst @@ -16,3 +16,4 @@ zlib_base-dev.tcz glib2-dev.tcz pixman-dev.tcz binutils.tcz +git.tcz diff --git a/imagebuild/tinyipa/finalise-tinyipa.sh b/imagebuild/tinyipa/finalise-tinyipa.sh index c714e63fc..7bfc95913 100755 --- a/imagebuild/tinyipa/finalise-tinyipa.sh +++ b/imagebuild/tinyipa/finalise-tinyipa.sh @@ -136,9 +136,7 @@ $CHROOT_CMD depmod -a `$WORKDIR/build_files/fakeuname -r` # If flag is set install the python now if $BUILD_AND_INSTALL_TINYIPA ; then - cp -a $BUILDDIR/tmp/upper-constraints.txt $FINALDIR/tmp/upper-constraints.txt - $CHROOT_CMD python /tmp/get-pip.py -c /tmp/upper-constraints.txt --no-wheel --no-index --find-links=file:///tmp/wheelhouse ironic_python_agent - rm -rf $FINALDIR/tmp/upper-constraints.txt + $CHROOT_CMD python /tmp/get-pip.py --no-wheel --no-index --find-links=file:///tmp/wheelhouse --pre ironic_python_agent rm -rf $FINALDIR/tmp/wheelhouse rm -rf $FINALDIR/tmp/get-pip.py fi