build-stx-base.sh and build-stx-images.sh need to accept a config file

Bug #1886062 reported by Scott Little
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
zhipeng liu

Bug Description

Brief Description
-----------------
Features like ussuri caused frequent build breakages.

One cause was the requirement to pass extra parameters to build-stx-base.sh and build-stx-images.sh. This in turn requires downstream changes to documentation, jenkins build scripts, etc.

All the downstream effects could be avoided if these two commands accepted a config file
providing default arguments.

I propose the following:
- build-stx-base.sh and build-stx-images.sh need to accept a new argument (--config-file <path>) specifying a path to a config file. We can establish a well known location within the code repository for such config files. If the cengn scripts see that file, it will add a single EXTRA_ARGS+="--config-file <path>"

- Alternatively these commands automatically look for the config files at the predetermined location, and apply them if found. If not found, continue without error. Perhaps add an optional new argument to suppress this behavior, or substitute an alternate config file.

- The config file needs to be able to specify additional arguments to be passed into the the command. e.g.
    --repo
ussuri-ceph,http://mirror.starlingx.cengn.ca/mirror/centos/download.ceph.com/rpm-mimic/el7/x86_64/
\
    --repo
ussuri-wsgi,http://mirror.starlingx.cengn.ca/mirror/centos/centos/mirror.centos.org/centos/7/sclo/x86_64/rh/

Severity
--------
Provide the severity of the defect.
Major
- avoid build breakages in future

Steps to Reproduce
------------------
build-stx-base.sh

Expected Behavior
------------------
base image builds

Actual Behavior
----------------
Build fails unless extra --repo arguements are provided

Reproducibility
---------------
100%

System Configuration
--------------------
N/A

Branch/Pull Time/Commit
-----------------------
Jun 30, 2020

Last Pass
---------
Jun 29, 2020

Timestamp/Logs
--------------
Error: Package: rh-python36-mod_wsgi-4.5.17-2.el7.x86_64 (stx-mirror-distro)
Requires: libpython3.6m.so.rh-python36-1.0()(64bit)
Error: Package: rh-python36-mod_wsgi-4.5.17-2.el7.x86_64 (stx-mirror-distro)
Requires: httpd24-httpd >= 2.4.6-23
Error: Package: rh-python36-mod_wsgi-4.5.17-2.el7.x86_64 (stx-mirror-distro)
Requires: httpd24-httpd-mmn = 20120211x8664
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
The command '/bin/sh -c set -ex ; sed -i '/\[main\]/ atimeout=120' /etc/yum.conf ; mv /stx.repo /etc/yum.repos.d/ ; yum upgrade --disablerepo=* ${REPO_OPTS} -y ; yum install --disablerepo=* ${REPO_OPTS} -y qemu-img openssh-clients python3 python3-pip python3-wheel rh-python36-mod_wsgi ; rm -rf /var/log/* /tmp/* /var/tmp/*' returned a non-zero code: 1

Test Activity
-------------
Build

Workaround
----------
Add extra arguments to build-stx-base.sh ...
--repo ussuri-ceph,http://build.starlingx.cengn.ca:80/mirror/centos/download.ceph.com/rpm-mimic/el7/x86_64/
--repo ussuri-wsgi,http://build.starlingx.cengn.ca:80/mirror/centos/centos/mirror.centos.org/centos/7/sclo/x86_64/rh/

Ghada Khalil (gkhalil)
tags: added: stx.build
Revision history for this message
Frank Miller (sensfan22) wrote :

Assigning to Zhipeng to make the suggested changes. As this is impacting workarounds on the CENGN build server, request is to source this in STX master and also to cherry pick to r/stx.4.0

Changed in starlingx:
assignee: nobody → zhipeng liu (zhipengs)
importance: Undecided → High
status: New → Confirmed
tags: added: stx.4.0
Changed in starlingx:
status: Confirmed → In Progress
Revision history for this message
zhipeng liu (zhipengs) wrote :
yong hu (yhu6)
Changed in starlingx:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (master)

Reviewed: https://review.opendev.org/740920
Committed: https://git.openstack.org/cgit/starlingx/root/commit/?id=4d6af626b1976987e614487a9c7a9293e5427113
Submitter: Zuul
Branch: master

commit 4d6af626b1976987e614487a9c7a9293e5427113
Author: zhipengl <email address hidden>
Date: Wed Jul 15 01:47:53 2020 +0800

    Add --config-file argument for docker image build script

    build-stx-base.sh and build-stx-images.sh need to accept a
    new argument (--config-file <path>) specifying a path to a
    config file.
    These commands automatically look for the config files at
    the predetermined location, and apply them if found. If not
    found, continue without error. If optional argument
    --config-file is added, These commands will use specified
    configfile instead of predetermined one.

    Test pass on local build enviroment.

    Closes-Bug: 1886062

    Change-Id: I476e38064d1515d3d0a0d49c789f1d472d8ca1cc
    Signed-off-by: zhipengl <email address hidden>

Changed in starlingx:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to root (r/stx.4.0)

Fix proposed to branch: r/stx.4.0
Review: https://review.opendev.org/743712

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (r/stx.4.0)

Reviewed: https://review.opendev.org/743712
Committed: https://git.openstack.org/cgit/starlingx/root/commit/?id=95611f4adfdd73d846e9cdc040afe4ce1a7bb66a
Submitter: Zuul
Branch: r/stx.4.0

commit 95611f4adfdd73d846e9cdc040afe4ce1a7bb66a
Author: zhipengl <email address hidden>
Date: Wed Jul 15 01:47:53 2020 +0800

    Add --config-file argument for docker image build script

    build-stx-base.sh and build-stx-images.sh need to accept a
    new argument (--config-file <path>) specifying a path to a
    config file.
    These commands automatically look for the config files at
    the predetermined location, and apply them if found. If not
    found, continue without error. If optional argument
    --config-file is added, These commands will use specified
    configfile instead of predetermined one.

    Test pass on local build enviroment.

    Closes-Bug: 1886062

    Change-Id: I476e38064d1515d3d0a0d49c789f1d472d8ca1cc
    Signed-off-by: zhipengl <email address hidden>
    (cherry picked from commit 4d6af626b1976987e614487a9c7a9293e5427113)

Ghada Khalil (gkhalil)
tags: added: in-r-stx40
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.