Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build-sync adding non-manifest lists in multiarch mode #137

Conversation

@tbielawa
Copy link
Member

tbielawa commented Nov 7, 2019

There was a variable being set in a higher more-persistent scope than
intended during the filtering stage. Now we explicitly reset it at the
beginning of that stage. This avoids thinking a pullspec is a manifest
list when it's actually just a single image.

This also update some of the output to be multi-arch specific.

For observing CURRENT behavior:

./doozer -i kuryr-cni --working-dir /home/rdu/tbielawa/gen-multiarch-payload --group 'openshift-4.3' release:gen-multiarch-payload --is-name 4.3-art-latest --organization openshift-release-dev --repository ocp-v4.0-art-dev

The above should give you a stack trace like this:

[tbielawa@buildvm doozer]$ doozer -i kuryr-cni --working-dir /home/rdu/tbielawa/gen-multiarch-payload --group 'openshift-4.3' release:gen-multiarch-payload --is-name 4.3-art-latest --organization openshift-release-dev --repository ocp-v4.0-art-dev
2019-11-07 15:36:57,753 INFO Data clone directory already exists, checking commit sha
2019-11-07 15:37:00,291 INFO Cloning config data from git@github.com:openshift/ocp-build-data.git
2019-11-07 15:37:01,772 INFO Using branch from group.yml: rhaos-4.3-rhel-7
###############################################################
Traceback (most recent call last):
  File "/usr/bin/doozer", line 2317, in <module>
    main()
  File "/usr/bin/doozer", line 2298, in main
    cli(obj={})
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/bin/doozer", line 1720, in release_gen_multiarch_payload
    if "error: the image is a manifest list" in result:
UnboundLocalError: local variable 'result' referenced before assignment

If you include these images with --images you will not get that error:

[tbielawa@buildvm doozer]$ doozer -i ose-cluster-kube-scheduler-operator,descheduler-operator,atomic-openshift-descheduler,hive,kuryr-cni --working-dir /home/rdu/tbielawa/gen-multiarch-payload --group 'openshift-4.3' release:gen-multiarch-payload --is-name 4.3-art-latest --organization openshift-release-dev --repository ocp-v4.0-art-dev

You will see that doozer runs all the way through and does not find any errors. Likewise if you omit --images IMAGES [,...] completely.

[tbielawa@buildvm doozer]$ doozer -i ose-cluster-kube-scheduler-operator,descheduler-operator,atomic-openshift-descheduler,hive,kuryr-cni --working-dir /home/r
du/tbielawa/gen-multiarch-payload --group 'openshift-4.3' release:gen-multiarch-payload --is-name 4.3-art-latest --organization openshift-release-dev --reposit
ory ocp-v4.0-art-dev
2019-11-07 15:40:07,419 INFO Data clone directory already exists, checking commit sha
2019-11-07 15:40:08,485 INFO git@github.com:openshift/ocp-build-data.git is already cloned and latest
2019-11-07 15:40:08,599 INFO Using branch from group.yml: rhaos-4.3-rhel-7
###############################################################
Verified source image exists and complies with naming conventions: registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-kube-scheduler-operator:v4.3.0-201911061513
ADDING to IS: registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-kube-scheduler-operator:v4.3.0-201911061513=quay.io/openshift-release-dev/ocp-v4.0-art-dev:v4.3.0-201911061513-ose-cluster-kube-scheduler-operator
###############################################################
Verified source image exists and complies with naming conventions: registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-descheduler-operator:v4.3.0-201911061038
ADDING to IS: registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-descheduler-operator:v4.3.0-201911061038=quay.io/openshift-release-dev/ocp-v4.0-art-dev:v4.3.0-201911061038-ose-descheduler-operator
...
###############################################################
Verified source image exists and complies with naming conventions: registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-kuryr-cni:v4.3.0-201911061038
ADDING to IS: registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-kuryr-cni:v4.3.0-201911061038=quay.io/openshift-release-dev/ocp-v4.0-art-dev:v4.3.0-201911061038-ose-kuryr-cni
Multiarching: Generating default arch (amd64) file
Multiarching: Generating arch-specific SRC=DEST files for 3 arches
Generating SRC=DEST for ppc64le
Generating SRC=DEST for s390x
Multiarching: Generating arch-specific ImageStream files for 3 arches
Generating ImageStream for ppc64le
Generating ImageStream for s390x
Images skipped due to invalid naming:
Images skipped due to missing source:

To test the fix

Checkout this branch and try running doozer with JUST the kuryr image:

[tbielawa@buildvm doozer]$ ./doozer -i kuryr-cni --working-dir /home/rdu/tbielawa/gen-multiarch-payload --group 'openshift-4.3' release:gen-multiarch-payload --is-name 4.3-art-latest --organization openshift-release-dev --repository ocp-v4.0-art-dev
2019-11-07 15:43:54,095 INFO Data clone directory already exists, checking commit sha
2019-11-07 15:43:55,239 INFO git@github.com:openshift/ocp-build-data.git is already cloned and latest
2019-11-07 15:43:55,348 INFO Using branch from group.yml: rhaos-4.3-rhel-7
###############################################################
NOT adding to IS, error querying image info (not a manifest list or doesn't exist?): registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-kuryr-cni:v4.3.0-201911061038
Multiarching: Generating default arch (amd64) file
Multiarching: Generating arch-specific SRC=DEST files for 3 arches
Generating SRC=DEST for ppc64le
Generating SRC=DEST for s390x
Multiarching: Generating arch-specific ImageStream files for 3 arches
Generating ImageStream for ppc64le
Generating ImageStream for s390x
Images skipped due to invalid naming:
Images skipped due to missing source:
 registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-kuryr-cni:v4.3.0-201911061038

Note: The messaging may be slightly different from this PR, but the core code change is the same

There was a variable being set in a higher more-persistent scope than
intended during the filtering stage. Now we explicitly reset it at the
beginning of that stage. This avoids thinking a pullspec is a manifest
list when it's actually just a single image.

This also update some of the output to be multi-arch specific.
@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Nov 7, 2019

Build #1

GLOB sdist-make: /mnt/workspace/jenkins/working/art-tools_doozer_PR-137/setup.py
py27 create: /mnt/workspace/jenkins/working/art-tools_doozer_PR-137/.tox/py27
py27 installdeps: -rrequirements-dev.txt
py27 inst: /mnt/workspace/jenkins/working/art-tools_doozer_PR-137/.tox/.tmp/package/1/rh-doozer-0.5.27.zip
py27 installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support,atomicwrites==1.3.0,attrs==19.3.0,autopep8==1.4.4,bashlex==0.14,certifi==2019.9.11,cffi==1.13.2,chardet==3.0.4,Click==7.0,configparser==4.0.2,contextlib2==0.6.0.post1,coverage==4.5.4,cryptography==2.8,dockerfile-parse==0.0.15,docopt==0.6.2,entrypoints==0.3,enum34==1.1.6,filelock==3.0.12,flake8==3.7.9,flexmock==0.10.4,funcsigs==1.0.2,functools32==3.2.3.post2,future==0.18.2,idna==2.8,importlib-metadata==0.23,ipaddress==1.0.23,koji==1.19.0,mccabe==0.6.1,mock==3.0.5,more-itertools==5.0.0,packaging==19.2,pathlib2==2.3.5,pluggy==0.13.0,py==1.8.0,pycodestyle==2.5.0,pycparser==2.19,pyflakes==2.1.1,pykerberos==1.2.1,pykwalify==1.7.0,pyOpenSSL==19.0.0,pyparsing==2.4.4,pytest==4.6.6,python-dateutil==2.8.1,python-krbV==1.0.90,PyYAML==5.1.2,requests==2.22.0,requests-kerberos==0.12.0,rh-doozer==0.5.27,rpm==4.14.2,rpm-py-installer==1.0.0,scandir==1.10.0,six==1.13.0,toml==0.10.0,tox==3.14.0,typing==3.7.4.1,urllib3==1.25.6,virtualenv==16.7.7,wcwidth==0.1.7,zipp==0.6.0
py27 run-test-pre: PYTHONHASHSEED='2266544'
py27 run-test: commands[0] | flake8
py27 run-test: commands[1] | coverage run --branch --source doozer,doozerlib -m unittest discover
....s.s.s.s....s......................................................s.s.s.s.s...No handlers could be found for logger "doozer.tests.test_runtime"
........................s.s...................................................
----------------------------------------------------------------------
Ran 148 tests in 0.336s

OK (skipped=12)
Coverage.py warning: Module doozer was never imported. (module-not-imported)
py27 run-test: commands[2] | coverage report
Name                                Stmts   Miss Branch BrPart  Cover
---------------------------------------------------------------------
doozerlib/__init__.py                   6      3      0      0    50%
doozerlib/assertion.py                 19      0      6      0   100%
doozerlib/brew.py                      79     55     18      0    25%
doozerlib/cli/__init__.py               0      0      0      0   100%
doozerlib/cli/__main__.py            1156   1156    418      0     0%
doozerlib/cli_opts.py                  14     14      4      0     0%
doozerlib/config.py                   105    105     46      0     0%
doozerlib/distgit.py                 1065    650    492      6    36%
doozerlib/dotconfig.py                 53     53     32      0     0%
doozerlib/exceptions.py                10      0      0      0   100%
doozerlib/exectools.py                 81     34     22      6    57%
doozerlib/gitdata.py                  157    132     74      0    11%
doozerlib/image.py                    164    135     78      0    12%
doozerlib/logutil.py                    9      1      2      1    82%
doozerlib/metadata.py                  78     56     25      0    21%
doozerlib/model.py                    144     87     62      3    31%
doozerlib/operator_metadata.py        307     54     52      3    80%
doozerlib/pushd.py                     19      0      2      0   100%
doozerlib/repos.py                    184    153     96      0    11%
doozerlib/rpmcfg.py                   202    178     78      0     9%
doozerlib/runtime.py                  589    422    224      5    23%
doozerlib/source_modifications.py      78     23     12      2    68%
doozerlib/state.py                     23     12      8      0    35%
doozerlib/util.py                      42     18      6      1    52%
---------------------------------------------------------------------
TOTAL                                4584   3341   1757     27    23%
___________________________________ summary ____________________________________
  py27: commands succeeded
  congratulations :)
@vfreex

This comment has been minimized.

Copy link
Contributor

vfreex commented Nov 9, 2019

/lgtm

@vfreex vfreex merged commit a54c014 into openshift:master Nov 9, 2019
1 check passed
1 check passed
continuous-integration/jenkins/pr-head This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.