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

ModuleNotFoundError: No module named 'markupsafe' error at build time #883

Open
DnPlas opened this issue Apr 23, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@DnPlas
Copy link
Contributor

DnPlas commented Apr 23, 2024

Bug Description

Charms that list jinja2 as a requirement could result in a build failure with the following message:

::    :: Collecting jinja2==3.1.2
::    ::   Using cached Jinja2-3.1.2.tar.gz (268 kB)
::    ::     ERROR: Command errored out with exit status 1:
...
::    ::       File "/tmp/pip-install-jf2rwxln/jinja2/src/jinja2/environment.py", line 14, in <module>
::    ::         from markupsafe import Markup
::    ::     ModuleNotFoundError: No module named 'markupsafe'
::    ::     ----------------------------------------

The issue is due to pallets/jinja#1496 and canonical/charmcraft#1664.

Potential fixes

  1. Use ubuntu 22.04 as base for build-on since this OS version will have a newer version of setuptools
  2. List the packages that depend on jinja2 in the charm-binary-python-packages to avoid building them from source. For example charm-binary-python-packages: [charmed-kubeflow-chisme]
  3. If jinja2 is a direct dependency of a charm, use the above method

To Reproduce

Try building any of the packages that list jinja2 in the requirements file:

  1. Any of the kfp-operators
  2. istio-pilot

Environment

  • Ubuntu 20.04
  • Charmcraft latest/candidate (2.6.0)

Relevant Log Output

Logs: https://pastebin.canonical.com/p/DhpBRNn7pz/

Workaround

Install jinja2 from binary as we do in canonical/kfp-operators#443

@DnPlas DnPlas added the bug Something isn't working label Apr 23, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5602.

This message was autogenerated

DnPlas added a commit to canonical/kfp-operators that referenced this issue Apr 23, 2024
This commit removes charmed-kubeflow-chisme from the requirements file to prevent
it to be built at charm build time, as some of its build deps are causing the
issue described in canonical/bundle-kubeflow#883.
Also in this commit the requirements-unit.in has been changed to include
charmed-kubeflow-chisme to install it during unit tests as it was
removed from the requirements.txt; therefore from the
requirements-unit.txt file.
Finally, this commit removes the "usage" legend from
requirements-unit.in as it is not a team standard anymore.

Part of canonical/bundle-kubeflow#883
@ca-scribner
Copy link
Contributor

I see istio-pilot listed here, but I don't see the CI that is breaking. Is istio-pilot blocked by this too?

@DnPlas
Copy link
Contributor Author

DnPlas commented Apr 24, 2024

I have seen it intermittently in istio-operator's CI: here is an example of this.

@ca-scribner
Copy link
Contributor

of course it has to be intermittent ... :/

DnPlas added a commit to canonical/kfp-operators that referenced this issue Apr 24, 2024
This commit installs jinja2 (an install dependency of charmed-kubeflow-chisme) as a binary 
to avoid running into the build time issues described in canonical/bundle-kubeflow#883.

Part of canonical/bundle-kubeflow#883
NohaIhab pushed a commit to canonical/kfp-operators that referenced this issue May 9, 2024
switch to jlumbroso/free-disk-space for freeing runner space (#428)

The previous space freeing method (easimon/maximize-build-space) at some point circa 2024-01 stopped freeing as much space, likely due to changes in the runner (~29GB free after it freed space).  Not sure why this happened, but jlumbroso/free-disk-space at time of this commit would get us up to ~45GB free on the runner without negative effects so we've switched to that.

Support functionality to override default images for kfp-profile-controller (#416)

* Support functionality to override default images for kfp-profile-controller

ci: remove destructive mode from integration tests (#441)

The charmcraft issues that forced us to use destructive mode are now fixed.

build: install `jinja2` from binary (#443)

This commit installs jinja2 (an install dependency of charmed-kubeflow-chisme) as a binary
to avoid running into the build time issues described in canonical/bundle-kubeflow#883.

Part of canonical/bundle-kubeflow#883

refactor: use k8s_service_info lib instead of SDI (#436)

* refactor: use k8s_service_info lib instead of SDI

Use the k8s_service_info for receiving the MLMD GRPC Service info instead of using
the SDI, as it will stop being supported soon.
This commit also ensures that mlmd runs with trust=True in the
integration tests.

Fixes #413

fix: Pin integration test dependencies in main (#434)

* pin integration test dependencies

Co-authored-by: Daniela Plascencia <daniela.plascencia@canonical.com>

feat: Integrate ROCK in metadata-writer charm (#439)

chore: Bump o11y libs and remove obsolete juju topology (#446)

Ref canonical/bundle-kubeflow#880
Ref canonical/bundle-kubeflow#849

ci: bump juju to 3.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants