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: py cryptography is pinned to a version that works with magma #13960

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

nstng
Copy link
Contributor

@nstng nstng commented Sep 19, 2022

Signed-off-by: Nils Semmelrock nils.semmelrock@tngtech.com

Summary

cryptography for bazel was upgraded to 38.0.1 (from 37.0.4) with #13946. This was not visible in the PR CI because it causes a runtime issue with magmad that is only seen in the integration tests.

bazel run orc8r/gateway/python/magma/magmad
...
Traceback (most recent call last):
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/__main__/orc8r/gateway/python/magma/magmad/main.py", line 20, in <module>
    from magma.common.sentry import sentry_init
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/__main__/orc8r/gateway/python/magma/common/sentry.py", line 19, in <module>
    import sentry_sdk
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/python_deps_pypi__sentry_sdk/sentry_sdk/__init__.py", line 1, in <module>
    from sentry_sdk.hub import Hub, init
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/python_deps_pypi__sentry_sdk/sentry_sdk/hub.py", line 8, in <module>
    from sentry_sdk.scope import Scope
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/python_deps_pypi__sentry_sdk/sentry_sdk/scope.py", line 7, in <module>
    from sentry_sdk.utils import logger, capture_internal_exceptions
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/python_deps_pypi__sentry_sdk/sentry_sdk/utils.py", line 895, in <module>
    HAS_REAL_CONTEXTVARS, ContextVar = _get_contextvars()
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/python_deps_pypi__sentry_sdk/sentry_sdk/utils.py", line 865, in _get_contextvars
    if not _is_contextvars_broken():
  File "/tmp/bazel/execroot/__main__/bazel-out/k8-fastbuild/bin/orc8r/gateway/python/magma/magmad/magmad.runfiles/python_deps_pypi__sentry_sdk/sentry_sdk/utils.py", line 826, in _is_contextvars_broken
    from eventlet.patcher import is_monkey_patched  # type: ignore
  File "/usr/local/lib/python3.8/dist-packages/eventlet/__init__.py", line 17, in <module>
    from eventlet import convenience
  File "/usr/local/lib/python3.8/dist-packages/eventlet/convenience.py", line 7, in <module>
    from eventlet.green import socket
  File "/usr/local/lib/python3.8/dist-packages/eventlet/green/socket.py", line 4, in <module>
    __import__('eventlet.green._socket_nodns')
  File "/usr/local/lib/python3.8/dist-packages/eventlet/green/_socket_nodns.py", line 11, in <module>
    from eventlet import greenio
  File "/usr/local/lib/python3.8/dist-packages/eventlet/greenio/__init__.py", line 3, in <module>
    from eventlet.greenio.base import *  # noqa
  File "/usr/local/lib/python3.8/dist-packages/eventlet/greenio/base.py", line 468, in <module>
    from OpenSSL import SSL
  File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in <module>
    class X509StoreFlags(object):
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
    CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Test Plan

  • execute bazel run orc8r/gateway/python/magma/magmad and see that error above does not happen

Additional Information

  • This change is backwards-breaking

@nstng nstng requested review from a team and vktng September 19, 2022 17:19
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines. label Sep 19, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions
Copy link
Contributor

github-actions bot commented Sep 19, 2022

dp-workflow

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit bab2926.

♻️ This comment has been updated with latest results.

@@ -1011,7 +1007,7 @@ priority==1.3.0 \
--hash=sha256:6bc1961a6d7fcacbfc337769f1a382c8e746566aaa365e78047abe9f66b2ffbe \
--hash=sha256:be4fcb94b5e37cdeb40af5533afe6dd603bd665fe9c8b3052610fc1001d5d1eb
# via -r requirements.in
prometheus-client==0.3.1 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why did this one have a dash before?

@@ -979,7 +975,7 @@ oslo-config==8.8.0 \
--hash=sha256:96933d3011dae15608a11616bfb00d947e22da3cb09b6ff37ddd7576abd4764c \
--hash=sha256:b1e2a398450ea35a8e5630d8b23057b8939838c4433cd25a20cc3a36d5df9e3b
# via -r requirements.in
oslo-i18n==5.1.0 \
oslo.i18n==5.1.0 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems some naming scheme on pypi has changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I noticed too - lets see if ci is ok with this

@@ -25,7 +25,7 @@ bravado_core
jsonschema==3.2.0
psutil
systemd-python
cryptography
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think it would be nice to add a short comment with the reason why we need this restriction. Also, some more context in the PR description would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context in PR was in the writing during review :) comment in requirements.in, yes, good idea

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
@nstng nstng merged commit c89642a into magma:master Sep 19, 2022
mpfirrmann pushed a commit to wolfseb/magma that referenced this pull request Sep 21, 2022
…gma#13960)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
MoritzThomasHuebner pushed a commit to MoritzThomasHuebner/magma that referenced this pull request Oct 10, 2022
…gma#13960)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

(cherry picked from commit c89642a)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
MoritzThomasHuebner pushed a commit to MoritzThomasHuebner/magma that referenced this pull request Nov 4, 2022
…gma#13960)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

(cherry picked from commit c89642a)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
MoritzThomasHuebner added a commit that referenced this pull request Nov 9, 2022
* fix(agw): Downgrade grpcio to fix pylint (#13946)

Downgrade grpcio in
- setup.py
- build script
- bazel setup

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>

(cherry picked from commit 1d34f11)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

* fix: py cryptography is pinned to a version that works with magma (#13960)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

(cherry picked from commit c89642a)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

* fix: workflows on 1.8 are pinned to relevant bazel base image and are using own cache key

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

* fix(ci): node is pinned to version 17 that can be used on xenial (#14343)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
(cherry picked from commit a03db0f)

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Co-authored-by: Nils Semmelrock <42540177+nstng@users.noreply.github.com>
Co-authored-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
jordanvrtanoski pushed a commit to jordanvrtanoski/magma that referenced this pull request Feb 8, 2023
* fix(agw): Downgrade grpcio to fix pylint (magma#13946)

Downgrade grpcio in
- setup.py
- build script
- bazel setup

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>

(cherry picked from commit 1d34f11)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

* fix: py cryptography is pinned to a version that works with magma (magma#13960)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

(cherry picked from commit c89642a)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

* fix: workflows on 1.8 are pinned to relevant bazel base image and are using own cache key

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

* fix(ci): node is pinned to version 17 that can be used on xenial (magma#14343)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
(cherry picked from commit a03db0f)

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Co-authored-by: Nils Semmelrock <42540177+nstng@users.noreply.github.com>
Co-authored-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
jordanvrtanoski pushed a commit to jordanvrtanoski/magma that referenced this pull request Feb 8, 2023
* fix(agw): Downgrade grpcio to fix pylint (magma#13946)

Downgrade grpcio in
- setup.py
- build script
- bazel setup

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>

(cherry picked from commit 1d34f11)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

* fix: py cryptography is pinned to a version that works with magma (magma#13960)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

(cherry picked from commit c89642a)
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

* fix: workflows on 1.8 are pinned to relevant bazel base image and are using own cache key

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

* fix(ci): node is pinned to version 17 that can be used on xenial (magma#14343)

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>

Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
(cherry picked from commit a03db0f)

Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Co-authored-by: Nils Semmelrock <42540177+nstng@users.noreply.github.com>
Co-authored-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants