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

Starting initial draft commit for building for EL 9 #855

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pirat89
Copy link
Member

@pirat89 pirat89 commented Apr 2, 2024

  • this is mostly broken, just putting here some tips what we should update, etc...

Copy link

github-actions bot commented Apr 2, 2024

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

To launch regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and leapp-repository*master* as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp-repository*PR42* as artifacts
  • /rerun-sst to schedule sst tests using this pr build and leapp-repository*master* as artifacts
  • /rerun-sst 42 to schedule sst tests using this pr build and leapp-repository*PR42* as artifacts

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@fernflower
Copy link
Member

/packit-build

@fernflower
Copy link
Member

/packit copr-build

@fernflower
Copy link
Member

@pirat89 You are missing packit refactor, please rebase against recent master

@pirat89
Copy link
Member Author

pirat89 commented Apr 2, 2024

@fernflower I guess that PEBKAC. I rebased, but I have a feel throw out all changes from master. I will take a look tomorrow. Thanks for the checking. It's pebkac - I just looked at leapp-repository instead :D thanks!

- this is mostly broken, just putting here some tips what
  we should update, etc...
@fernflower
Copy link
Member

/packit copr-build

importer.find_module(name).load_module(name)
loader = importer.find_spec(name).loader
module = importlib.util.module_from_spec(loader)
loader.exec_module(module)
Copy link
Member

Choose a reason for hiding this comment

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

@vinzenz Howdy :) We are currently working on 9>10 POC and it seems like find_module method was removed in Python 3.12. It should be replaced by either exec_module or create_module. However, when trying with exec_module, the execution gets stuck as:

^CTraceback (most recent call last):
  File "/usr/bin/leapp", line 33, in <module>
    sys.exit(load_entry_point('leapp==0.17.0', 'console_scripts', 'leapp')())
  File "/usr/lib/python3.9/site-packages/leapp/cli/__init__.py", line 45, in main
    cli.command.execute('leapp version {}'.format(VERSION))
  File "/usr/lib/python3.9/site-packages/leapp/utils/clicmd.py", line 111, in execute
    args.func(args)
  File "/usr/lib/python3.9/site-packages/leapp/utils/clicmd.py", line 133, in called
    self.target(args)
  File "/usr/lib/python3.9/site-packages/leapp/cli/commands/upgrade/breadcrumbs.py", line 166, in wrapper
    return f(*args, breadcrumbs=breadcrumbs, **kwargs)
  File "/usr/lib/python3.9/site-packages/leapp/cli/commands/upgrade/__init__.py", line 89, in upgrade
    repositories = util.load_repositories()
  File "/usr/lib/python3.9/site-packages/leapp/cli/commands/upgrade/util.py", line 90, in load_repositories
    manager.load()
  File "/usr/lib/python3.9/site-packages/leapp/repository/manager.py", line 120, in load
    repo.load(resolve=False, stage=_LoadStage.ACTORS, skip_actors_discovery=skip_actors_discovery)
  File "/usr/lib/python3.9/site-packages/leapp/repository/__init__.py", line 154, in load
    actor.discover()
  File "/usr/lib/python3.9/site-packages/leapp/repository/actor_definition.py", line 219, in discover
    result = q.get()
  File "/usr/lib64/python3.9/multiprocessing/queues.py", line 103, in get
    res = self._recv_bytes()
  File "/usr/lib64/python3.9/multiprocessing/connection.py", line 220, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File "/usr/lib64/python3.9/multiprocessing/connection.py", line 418, in _recv_bytes
    buf = self._recv(4)
  File "/usr/lib64/python3.9/multiprocessing/connection.py", line 383, in _recv
    chunk = read(handle, remaining)
KeyboardInterrupt

Using create_module fails with:

2024-04-07 20:07:24.940 DEBUG    PID: 62462 leapp.repository.system_upgrade_common: Starting actor discovery in actors/addupgradebootentry
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib64/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib64/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.9/site-packages/leapp/repository/actor_definition.py", line 32, in inspect_actor
    definition.load()
  File "/usr/lib/python3.9/site-packages/leapp/repository/actor_definition.py", line 201, in load
    self._module = importer.find_module(name).load_module(name)
  File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1029, in load_module
  File "<frozen importlib._bootstrap_external>", line 854, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/etc/leapp/repos.d/system_upgrade/common/actors/addupgradebootentry/actor.py", line 7, in <module>
    from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
ImportError: cannot import name 'InterimPreparationPhaseTag' from 'leapp.tags' (/usr/lib/python3.9/site-packages/leapp/tags/__init__.py)
2024-04-07 20:07:24.957 ERROR    PID: 62462 leapp.repository.system_upgrade_common: Process inspecting actor in actors/addupgradebootentry failed with 1

This was tried with Python3.9 to for easier reproducibility.

Any idea how to get this work? Cheers o/

Copy link
Member

Choose a reason for hiding this comment

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

I think you need to add the module to sys.modules

Copy link
Member

Choose a reason for hiding this comment

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

Original issue:

 localhost upgrade[2120]: 2024-03-20 12:24:50.85  DEBUG    PID: 1 leapp.repository.common: Loading topic modules
 localhost upgrade[2120]: Traceback (most recent call last):
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp3", line 6, in <module> 
 localhost upgrade[2120]:     sys.exit(leapp.cli.main())
 localhost upgrade[2120]:              ^^^^^^^^^^^^^^^^
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/cli/__init__.py", line 45, in main
 localhost upgrade[2120]:     cli.command.execute('leapp version {}'.format(VERSION))
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/utils/clicmd.py", line 111, in execute
 localhost upgrade[2120]:     args.func(args)
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/utils/clicmd.py", line 133, in called 
 localhost upgrade[2120]:     self.target(args)
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/cli/commands/upgrade/breadcrumbs.py", line 166, in wrapper
 localhost upgrade[2120]:     return f(*args, breadcrumbs=breadcrumbs, **kwargs)
 localhost upgrade[2120]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/cli/commands/upgrade/__init__.py", line 89, in upgrade 
 localhost upgrade[2120]:     repositories = util.load_repositories()
 localhost upgrade[2120]:                    ^^^^^^^^^^^^^^^^^^^^^^^^
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/cli/commands/upgrade/util.py", line 90, in load_repositories
 localhost upgrade[2120]:     manager.load() 
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/repository/manager.py", line 111, in load
 localhost upgrade[2120]:     repo.load(resolve=False, stage=_LoadStage.INITIAL)
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/repository/__init__.py", line 130, in load
 localhost upgrade[2120]:     self._load_modules(self.topics, 'leapp.topics')
 localhost upgrade[2120]:   File "/root/tmp_leapp_py3/leapp/repository/__init__.py", line 169, in _load_modules
 localhost upgrade[2120]:     importer.find_module(name).load_module(name)
 localhost upgrade[2120]:     ^^^^^^^^^^^^^^^^^^^^
 localhost upgrade[2120]: AttributeError: 'FileFinder' object has no attribute 'find_module' 

Comment on lines 170 to 172
loader = importer.find_spec(name).loader
module = importlib.util.module_from_spec(loader)
loader.exec_module(module)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
loader = importer.find_spec(name).loader
module = importlib.util.module_from_spec(loader)
loader.exec_module(module)
spec = importer.find_spec(name)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)

Copy link
Member

Choose a reason for hiding this comment

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

Thinking about it, I guess you will have to version switch it here, due to py27 backwards compatibility, unless you're no longer supporting py27/el7

@@ -0,0 +1,12 @@
FROM registry.access.redhat.com/ubi8/ubi:latest
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
FROM registry.access.redhat.com/ubi8/ubi:latest
FROM registry.access.redhat.com/ubi9/ubi:latest


VOLUME /payload

ENV DIST_VERSION 8
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ENV DIST_VERSION 8
ENV DIST_VERSION 9

@@ -0,0 +1,35 @@
FROM registry.access.redhat.com/ubi8/ubi:latest
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
FROM registry.access.redhat.com/ubi8/ubi:latest
FROM registry.access.redhat.com/ubi9/ubi:latest

Should be 10 really, but it's not out yet ;-)

VOLUME /payload

RUN yum update -y && \
yum install python3 python39 python3-virtualenv make -y && \
Copy link
Member

Choose a reason for hiding this comment

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

python312?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I've just created files without changes. keeping that for anyone who gets to it first :)

Copy link
Member Author

Choose a reason for hiding this comment

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

problem is that ubi10 image will not be available till rhel 10 GA I guess.

Copy link
Member

Choose a reason for hiding this comment

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

Not even for beta?

Copy link
Member Author

@pirat89 pirat89 Apr 12, 2024

Choose a reason for hiding this comment

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

no idea honestly. I haven't been checking plans around UBI.

@Rezney Rezney force-pushed the poc-ipu-9-10 branch 3 times, most recently from d1836a0 to 8ae1d5c Compare April 12, 2024 17:42
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants