Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Mitigate GSSAPIAuthError #487

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

vfreex
Copy link
Contributor

@vfreex vfreex commented Jul 29, 2021

koji.GSSAPIAuthError: unable to obtain a session still occurs very frequently
after applying 0436b54.

This PR proposes a workaround by calling gssapi_login on runtime.shared_koji_client_session
before we build any image or rpm. This would significantly reduce the number of gssapi_login calls
in one doozer invocation. Even if gssapi_login fails in the first call, it fails earlier.

`koji.GSSAPIAuthError: unable to obtain a session` still occurs very frequently
after applying openshift-eng@0436b54.

This PR proposes a workaround by calling `gssapi_login` on `runtime.shared_koji_client_session`
before we build any image or rpm. This would significantly reduce the number of `gssapi_login` calls
in one doozer invocation. Even if `gssapi_login` fails in the first call, it fails earlier.
@vfreex vfreex requested review from sosiouxme and jupierce July 29, 2021 09:40
@openshift-ci openshift-ci bot requested a review from Ximinhan July 29, 2021 09:40
@openshift-bot
Copy link

Build #1

GLOB sdist-make: /mnt/workspace/jenkins/working/art-tools_doozer_PR-487/setup.py
py3 create: /mnt/workspace/jenkins/working/art-tools_doozer_PR-487/.tox/py3
py3 installdeps: -rrequirements-dev.txt
py3 inst: /mnt/workspace/jenkins/working/art-tools_doozer_PR-487/.tox/.tmp/package/1/rh-doozer-1.3.15.zip
py3 installed: aiofiles==0.7.0,astroid==2.6.5,attrs==21.2.0,autopep8==1.5.7,backports.entry-points-selectable==1.1.0,bashlex==0.15,cached-property==1.5.2,certifi==2021.5.30,cffi==1.14.6,charset-normalizer==2.0.3,click==8.0.1,contextvars==2.4,coverage==5.5,cryptography==3.4.7,decorator==5.0.9,Deprecated==1.2.12,distlib==0.3.2,dockerfile-parse==1.2.0,filelock==3.0.12,flake8==3.9.2,flexmock==0.10.5,future==0.18.2,gssapi==1.6.14,idna==3.2,immutables==0.15,importlib-metadata==4.6.1,importlib-resources==5.2.1,iniconfig==1.1.1,isort==5.9.3,kobo==0.19.0,koji==1.25.1,lazy-object-proxy==1.6.0,mccabe==0.6.1,mock==4.0.3,mysql-connector-python==8.0.26,packaging==21.0,platformdirs==2.1.0,pluggy==0.13.1,protobuf==3.17.3,py==1.10.0,pycodestyle==2.7.0,pycparser==2.20,pyflakes==2.3.1,pygit2==1.6.1,PyGithub==1.55,PyJWT==2.1.0,pykerberos==1.2.1,pylint==2.9.6,PyNaCl==1.4.0,pyparsing==2.4.7,pytest==6.2.4,python-dateutil==2.8.2,PyYAML==5.4.1,requests==2.26.0,requests-gssapi==1.2.3,requests-kerberos==0.12.0,rh-doozer @ file:///mnt/workspace/jenkins/working/art-tools_doozer_PR-487/.tox/.tmp/package/1/rh-doozer-1.3.15.zip,rpm==4.14.3,rpm-py-installer==1.1.0,semver==2.13.0,six==1.16.0,tenacity==8.0.1,toml==0.10.2,tox==3.24.0,typed-ast==1.4.3,typing==3.7.4.3,typing-extensions==3.10.0.0,urllib3==1.26.6,virtualenv==20.6.0,wrapt==1.12.1,zipp==3.5.0
py3 run-test-pre: PYTHONHASHSEED='2386853806'
py3 run-test: commands[0] | flake8
py3 run-test: commands[1] | coverage run --branch --source doozerlib -m unittest discover -t . -s tests/
..............................Environment variables required for db operation missing. Doozer will be runningin no DB use mode.
.Environment variables required for db operation missing. Doozer will be runningin no DB use mode.
.Environment variables required for db operation missing. Doozer will be runningin no DB use mode.
.Environment variables required for db operation missing. Doozer will be runningin no DB use mode.
.........................................s.s....................................s.s...s.s.s..s.s.s................................................................................................ERROR:doozer.tests.test_runtime:Error attempting to find target branch branch hash: whatever
...................
----------------------------------------------------------------------
Ran 236 tests in 1.317s

OK (skipped=10)
py3 run-test: commands[2] | coverage report
Name                                    Stmts   Miss Branch BrPart  Cover
-------------------------------------------------------------------------
doozerlib/__init__.py                      11      4      2      1    62%
doozerlib/assembly.py                     103     18     60      6    80%
doozerlib/assertion.py                     22      0      6      0   100%
doozerlib/brew.py                         329    193    146      3    39%
doozerlib/build_status_detector.py         76      4     46      2    93%
doozerlib/cli/__init__.py                 100     45     20      0    46%
doozerlib/cli/__main__.py                1161   1161    480      0     0%
doozerlib/cli/cli_opts.py                  16      3      6      0    86%
doozerlib/cli/config_plashet.py           533    533    248      0     0%
doozerlib/cli/detect_embargo.py           163     35     70      8    75%
doozerlib/cli/images_health.py             79     28     24      2    61%
doozerlib/cli/images_streams.py           556    556    232      0     0%
doozerlib/cli/release_gen_assembly.py     156    156     76      0     0%
doozerlib/cli/release_gen_payload.py      340    258    163      1    19%
doozerlib/cli/rpms_build.py               165     59     58      8    57%
doozerlib/cli/scan_sources.py             153    123     78      2    16%
doozerlib/config.py                        98     98     44      0     0%
doozerlib/constants.py                      9      0      0      0   100%
doozerlib/coverity.py                     238    209     74      0     9%
doozerlib/dblib.py                        248    152     68      4    35%
doozerlib/distgit.py                     1368    906    634     13    31%
doozerlib/dotconfig.py                     56     44     32      0    14%
doozerlib/exceptions.py                     3      0      0      0   100%
doozerlib/exectools.py                    194     75     76     17    56%
doozerlib/gitdata.py                      168    133     76      0    14%
doozerlib/image.py                        263    220    132      2    11%
doozerlib/logutil.py                       10      1      2      1    83%
doozerlib/metadata.py                     424    170    190     26    55%
doozerlib/model.py                        111     21     36      2    82%
doozerlib/olm/__init__.py                   0      0      0      0   100%
doozerlib/olm/bundle.py                   218    163     36      0    22%
doozerlib/operator_metadata.py            364     65     66      6    79%
doozerlib/plashet.py                      134      9     90     15    89%
doozerlib/pushd.py                         21      2      2      0    91%
doozerlib/repos.py                        207    105    113     17    44%
doozerlib/rhcos.py                         36      9      6      0    74%
doozerlib/rpm_builder.py                  226     31    121     32    81%
doozerlib/rpmcfg.py                       145     56     58      8    57%
doozerlib/runtime.py                      845    613    346      9    22%
doozerlib/source_modifications.py          89     28     18      3    65%
doozerlib/state.py                         24     12      8      0    38%
doozerlib/util.py                         313    134    110      5    54%
-------------------------------------------------------------------------
TOTAL                                    9775   6432   4053    193    31%
___________________________________ summary ____________________________________
  py3: commands succeeded
  congratulations :)

@vfreex vfreex merged commit 20fdd0c into openshift-eng:master Jul 30, 2021
vfreex added a commit to vfreex/doozer that referenced this pull request Aug 9, 2021
dbe3d91 Fix a bug where upstream git commit was incorrectly pinned for stream assembly (openshift-eng#495)
084baa1 Turn git commit into a parsable yaml document This will allow our automation to be able to detect source and commit information without having to parse RPM spec files.
0917797 Build basis locked assemblies artifacts from their lastet build's upstream commit
c61bd43 Make evaluation of -alt image deterministic
e398878 Use unaltered git url to assess whether images are siblings
7d21721 Fixes for building from a specific commit
16f1e44 Allow assemblies to override streams
2a69d50 Do not write duplicate destinations
6821b79 Add emergency override
b908fe5 Gen-assembly from GA releases and default stream permits
788ae1e Reintroduce hotfix tagging
f4c42b7 Formalizing assembly issues and permitting them
20fdd0c Mitigate GSSAPIAuthError (openshift-eng#487)
5b7d850 Gen-payload for assembly fixes and updates for PR comments
cea8804 Make gen-payload enforce assembly consistency
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants