Review feedback from builds#12229
Conversation
hack/build-images.sh
Outdated
| function image { | ||
| # image-build is wrapped to allow output to be captured | ||
| function image-build { | ||
| local tag=$1 |
hack/build-images.sh
Outdated
| # builds an image and tags it two ways - with latest, and with the release tag | ||
| function image { | ||
| # image-build is wrapped to allow output to be captured | ||
| function image-build { |
There was a problem hiding this comment.
we use parens
function my-name() {
hack/build-images.sh
Outdated
| fi | ||
|
|
||
| local STARTTIME=$(date +%s) | ||
| local STARTTIME=$(date +%s) |
There was a problem hiding this comment.
don't mix expansions with return codes and scoping statements
hack/build-images.sh
Outdated
| ) > "${out}" 2>&1 | ||
| local rc=$? | ||
| set -e | ||
| local ENDTIME=$(date +%s); echo "Finished in $(($ENDTIME - $STARTTIME)) seconds" |
There was a problem hiding this comment.
if you have nothing else trapped on EXIT just use the exit trap framework
There was a problem hiding this comment.
More complicated, don't see the value.
There was a problem hiding this comment.
At some point I want to turn on that trap by default for everyone, and I don't see a compelling reason for you to make my life harder :)
There was a problem hiding this comment.
this is a trap per test case.
hack/build-images.sh
Outdated
| local tag=$1 | ||
| local dir=$2 | ||
| local out | ||
| out="$( mktemp )" |
There was a problem hiding this comment.
under $BASETMPDIR would be better
hack/build-images.sh
Outdated
| @@ -125,7 +122,7 @@ function image { | |||
| ( image openshift/origin-docker-registry images/dockerregistry ) & | |||
| ( image openshift/origin-egress-router images/router/egress ) & | |||
There was a problem hiding this comment.
Shouldn't these be build-image?
Also, correctly written, build-image function shouldn't touch global state and there is no need for the subshells
There was a problem hiding this comment.
Don't see any reason to overlap them. And no, they should be image because we are capturing output.
There was a problem hiding this comment.
I didn't realize you had image AND image-build ... image is not a super clear method name, from name alone I have no idea what differentiates it from image-build.
| if [[ -n "$( which imagebuilder )" ]]; then | ||
| if os::util::find::system_binary 'imagebuilder'; then | ||
| if [[ -n "${dockerfile}" ]]; then | ||
| eval "imagebuilder -f '${dockerfile}' -t '${tag}' ${options} '${directory}'" |
There was a problem hiding this comment.
What are possible values in ${options}? Really don't like the eval here
There was a problem hiding this comment.
Arbitrary CLI flags.
There was a problem hiding this comment.
@Miciah, is it possible to support arbitrary flags like this?
@smarterclayton do you expect those flags to contain spaces? In either case, this just smells like a massive anti-pattern here.
There was a problem hiding this comment.
@stevekuznetsov, yeah, the user just needs to use normal shell escaping as necessary. For example, something like OS_BUILD_IMAGE_ARGS='-foo=bar\ baz -bar -baz="quux xyzzy"' should work as expected.
39f836c to
c0e78c7
Compare
|
[test] |
c0e78c7 to
b526f1b
Compare
Remove parallelism for now
b526f1b to
a70e5f4
Compare
|
[test] |
|
Evaluated for origin test up to a70e5f4 |
|
continuous-integration/openshift-jenkins/test Running (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12306/) (Base Commit: a5ae7f1) |
|
Going to merge on green to unblock the queue - parallelism causes docker to throw a wobbler on RHEL. |
nice |
Follow up to #12218