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

[Bug]: Python-based hooks do not work on older distributions #19

Closed
NucciTheBoss opened this issue Jun 11, 2024 · 1 comment
Closed
Assignees

Comments

@NucciTheBoss
Copy link
Member

After upgrading the snap to core24 to so that we could pull the librocm-smi-dev package from Ubuntu Archive rather than a custom PPA I built, it seems that the Python-based hooks are no longer working on older distributions such as Focal or Jammy. It fails with a common error that typically indicates that your python virtualenv is corrupted. Error output below:

On 24.04 (Noble)

$ snap install slurm --classic --channel latest/candidate
2024-06-11T12:20:31Z INFO Waiting for automatic snapd restart...
slurm (candidate) 23.11.1 from Ubuntu High-Performance Computing (ubuntuhpcbot) installed

On a 22.04 machine deployed using Juju (Jammy)

$ snap install slurm --classic --channel latest/candidate
error: cannot perform the following tasks:
- Run install hook of "slurm" snap if present (run hook "install":
-----
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  safe_path = 0
  import site = 1
  is in build tree = 0
  stdlib dir = '/usr/lib/python3.12'
  sys._base_executable = '/snap/slurm/417/usr/bin/python3.12'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.platlibdir = 'lib'
  sys.executable = '/snap/slurm/417/bin/python3'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python312.zip',
    '/usr/lib/python3.12',
    '/usr/lib/python3.12/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f75abe3d300 (most recent call first):
  <no Python frame>
-----)

This needs to be fixed in order for the Slurm snap package to be truly atomic, and make onboarding the current Slurm snap into Charmed HPC easier.

@NucciTheBoss
Copy link
Member Author

This was fixed by reverting to core22. Going forward we'll need to evaluate if we want to continue using Python-based hooks or if we want to change our hooks to another language such as Lua or Go.

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

No branches or pull requests

1 participant