From 02e851fe2b80855c1bae92f6f07e2fc01b8000bb Mon Sep 17 00:00:00 2001 From: Jeremy Freudberg Date: Wed, 12 Aug 2020 11:39:19 -0400 Subject: [PATCH] Build timeout as CLI arg for container image build In https://review.opendev.org/#/c/678907/ it was suggested that the timeout be a CLI arg. And at present the ppc64le RDO container build job needs quite a big timeout. Change-Id: I6bf5238864228c54c84b22b567d873cf29f0e82c --- lower-constraints.txt | 2 +- requirements.txt | 2 +- tripleoclient/v1/container_image.py | 11 ++++++++++- tripleoclient/v2/tripleo_container_image.py | 9 +++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 7002d64ab..b843242fd 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -145,7 +145,7 @@ testscenarios===0.4 testtools==2.2.0 tooz==1.58.0 traceback2==1.4.0 -tripleo-common==12.4.0 +tripleo-common==12.6.0 ujson==1.35 unittest2==1.1.0 validations-libs==1.0.0 diff --git a/requirements.txt b/requirements.txt index 422c937ea..01b9baa13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ simplejson>=3.5.1 # MIT six>=1.10.0 # MIT osc-lib>=1.8.0 # Apache-2.0 websocket-client>=0.44.0 # LGPLv2+ -tripleo-common>=12.4.0 # Apache-2.0 +tripleo-common>=12.6.0 # Apache-2.0 cryptography>=2.1 # BSD/Apache-2.0 ansible-runner>=1.4.5 # Apache 2.0 validations-libs>=1.0.0 diff --git a/tripleoclient/v1/container_image.py b/tripleoclient/v1/container_image.py index e9ef4023d..f3328e2e1 100644 --- a/tripleoclient/v1/container_image.py +++ b/tripleoclient/v1/container_image.py @@ -193,6 +193,14 @@ class BuildImage(command.Command): help=_("TripleO container builds directory, storing configs and " "logs for each image and its dependencies.") ) + parser.add_argument( + "--build-timeout", + dest="build_timeout", + default=None, + type=int, + metavar="", + help=_("Build timeout in seconds.") + ) return parser def take_action(self, parsed_args): @@ -233,7 +241,8 @@ class BuildImage(command.Command): utils.get_from_cfg(kolla_cfg, "tag"), utils.get_from_cfg(kolla_cfg, "namespace"), utils.get_from_cfg(kolla_cfg, "registry"), - utils.getboolean_from_cfg(kolla_cfg, "push")) + utils.getboolean_from_cfg(kolla_cfg, "push"), + build_timeout=parsed_args.build_timeout) bb.build_all() elif parsed_args.list_dependencies: deps = json.loads(result) diff --git a/tripleoclient/v2/tripleo_container_image.py b/tripleoclient/v2/tripleo_container_image.py index 7fc91574e..0ff56fb19 100644 --- a/tripleoclient/v2/tripleo_container_image.py +++ b/tripleoclient/v2/tripleo_container_image.py @@ -217,6 +217,14 @@ class Build(command.Command): help=_("A comma separated list of RHEL modules to enable with " "their version. Example: 'mariadb:10.3,virt:8.3'."), ) + parser.add_argument( + "--build-timeout", + dest="build_timeout", + metavar="", + default=None, + type=int, + help=_("Build timeout in seconds.") + ) return parser def imagename_to_regex(self, imagename): @@ -639,6 +647,7 @@ class Build(command.Command): push_containers=parsed_args.push, volumes=parsed_args.volumes, excludes=list(set(excludes)), + build_timeout=parsed_args.build_timeout ) try: bb.build_all()