Docker build files with non-bash entrypoint causes errors in build-stx-images.sh

Bug #1857349 reported by Don Penney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Don Penney

Bug Description

Brief Description
-----------------
Eric MacDonald reported an error in build-stx-images.sh when trying to add a new image with a custom docker build file where the image entrypoint is not a shell. The build-stx-images.sh utility tries to run the container and pass in commands to collect information, assuming the entrypoint is bash (which was originally the case for all images being built by the tool).

+ docker run --rm emacdona/rvmc:dev-centos-stable-build bash -c 'rpm -qa | sort'
usage: rvmc.py [-h] --config_file CONFIG_FILE --target TARGET [--debug DEBUG]
rvmc.py: error: argument --config_file: expected one argument
+ docker run --rm emacdona/rvmc:dev-centos-stable-build bash -c 'pip freeze 2>/dev/null | sort'
usage: rvmc.py [-h] --config_file CONFIG_FILE --target TARGET [--debug DEBUG]
rvmc.py: error: argument --config_file: expected one argument

Severity
--------
Critical - new image cannot be built without an enhancement in build-stx-images.sh

Reproducibility
---------------
Reproducible

Test Activity
-------------
Developer Testing

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (master)

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

commit a6832d18711edbee61ff168a40c4c53880c8b6b3
Author: Don Penney <email address hidden>
Date: Mon Nov 25 13:12:04 2019 -0500

    Update image build tools to handle non-shell entrypoint

    If a custom docker build file sets up a non-shell entrypoint,
    build-stx-images.sh fails during the build while trying to collect
    some information by running the newly built image.

    This update enhances the handling to check the entrypoint and ensure
    it is maintained, while using bash to run any needed commands.

    Closes-Bug: 1857349
    Change-Id: I1f798476eb4976a4c81cdd2defe5d767a4681f5b
    Signed-off-by: Don Penney <email address hidden>

Changed in starlingx:
status: New → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
assignee: nobody → Don Penney (dpenney)
tags: added: stx.build
Revision history for this message
Ghada Khalil (gkhalil) wrote :

stx.4.0 / high priority - this affects feature development where new images are being introduced.

Changed in starlingx:
importance: Undecided → High
tags: added: stx.4.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to root (f/centos8)

Fix proposed to branch: f/centos8
Review: https://review.opendev.org/705827

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (f/centos8)
Download full text (5.4 KiB)

Reviewed: https://review.opendev.org/705827
Committed: https://git.openstack.org/cgit/starlingx/root/commit/?id=b7abdd160cc11bb86bdb876db0230b9f5160eccd
Submitter: Zuul
Branch: f/centos8

commit b864e153ddac995cb111b583a9d9e0c58a567387
Author: Don Penney <email address hidden>
Date: Tue Jan 21 17:04:10 2020 -0500

    Support source patches for building images

    The build-stx-images.sh allows for building images using a git repo as
    the source, which is cloned into the workspace as part of the build
    procedure. In some cases, there may be source changes required for
    fixes or enhancements that have not yet merged into the referenced
    repo. This update adds support in build-stx-images to allow the
    designer to specify patches in the image directives file, which will
    be applied after cloning.

    Designer workflow:
    * clone git repo (may need to apply any existing git patches from
    previous fixes)
    * make changes
    * commit, with a beautiful and admirable commit message
    * git format-patch
    * copy source patch to stx repo, somewhere alongside the docker_image
    directives file (ie. a docker_patches dir)
    * update docker_image directives file to add DOCKER_REPO_PATCHES or
    SOURCE_PATCHES, as appropriate, with DOCKER_REF or SOURCE_REF set to
    the current upstream SHA used as the base for the patch

    Story: 2006711
    Task: 38499
    Change-Id: Icac2b4dc2ebeb32946de6e5adcbf59a10c56a30c
    Signed-off-by: Don Penney <email address hidden>

commit 6cadc457483c7ce194e1f2f58f07cc3434eb20a7
Author: Joseph Richard <email address hidden>
Date: Tue Jan 21 12:08:40 2020 -0500

    Update old_image_reference regex

    This commit updates the old_image_reference regex to correctly handle
    images records using a hostname with hyphens and/or a port specified.

    Closes-bug: 1860465
    Change-Id: Ibf88d1c675277d4b133d0fd68029555ceea3e18d
    Signed-off-by: Joseph Richard <email address hidden>

commit e443a2c736e891226bcd2f5b08ade79a3aceaf02
Author: Lin Shuicheng <email address hidden>
Date: Sun Jan 19 01:15:50 2020 +0000

    Revert "Revert "add kata rpms to ISO""

    This reverts commit 4c7595db02ac250cdf8f04fd49df7a401c8bfb7e.

    Depends-On: https://review.opendev.org/703263

    Change-Id: Iefc0bafb369e3897e1028b33c45303d18f93a24b
    Signed-off-by: Shuicheng Lin <email address hidden>

commit 31aea8e88b2f0e2fe90e3b802a2ffff3c230b212
Author: John Kung <email address hidden>
Date: Thu Jan 16 16:03:27 2020 -0500

    Allow application to specify app_name in metadata

    Update build-helm-charts to allow application to optionally specify app_name.
    The script was ignoring app_name if it was already specified in the metadata;
    this updates it to accept the app_name if specified, otherwise default to
    APP_NAME as specified in command line for the tarball.

    Change-Id: I9368b3a8a7c3d50981f02fe7c4a5e4be8255cfc3
    Partial-Bug: 1859882
    Signed-off-by: John Kung <email address hidden>

commit b5bfa6087e7e131fdff107029f33fb46205e0884
Author: Don Penney <email address hidden>
Date: Wed Jan 15 23...

Read more...

tags: added: in-f-centos8
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.