Hi everyone,
I am trying to package our python app aTrain, a local audio transcription GUI app based on whisper, as a snap.
I actually got quite far, getting it to mostly run in devmode confinement. However, when I switched to strict confinement I got a problem with permissions for multiprocessing:
File "/usr/lib/python3.12/multiprocessing/synchronize.py", line 57, in __init__
sl = self._semlock = _multiprocessing.SemLock(
^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied
Here are the two corresponding branches for the app and the backend.
To reproduce, clone the aTrain repository and switch to the feature snap branch, then run snapcraft to build (warning: takes a few GB).
Any ideas on how to fix this would be much appreciated, or alternatively the info that this is intended behavior of strict confinement and no solution is possible.
I also have number of smaller questions (like how to make created transcripts more easily accessible for users) after the big problems are fixed.
Below is also my snapcraft.yaml (also in the aTrain feature_snap branch)
Best, Jürgen
name: atrain
summary: aTrain summary
description: |
A GUI tool for offline transcription of speech recordings, including speaker diarization, utilizing state-of-the-art machine learning models.
version: test
base: core24
confinement: strict
parts:
atrain:
plugin: python
source: .
python-packages:
- pyqt5
- pyqtwebengine
- pywebview
- pywebview[qt]
- pycairo
- PyGObject == 3.50.0
- lightning-utilities
- numpy == 1.26.4
- packaging
build-environment:
- PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu121
build-packages:
- git
- build-essential
- libgl1-mesa-dev
- libcairo2
- libcairo2-dev
- libgirepository1.0-dev
- libglu1-mesa
- libwebkit2gtk-4.1-dev
stage-packages:
- libgl1
- libglx0
- libglvnd0
- libxau6
- libxdmcp6
- libx11-6
- libavfilter-dev
- libxcb-randr0-dev
- libxcb-xtest0-dev
- libxcb-xinerama0-dev
- libxcb-shape0-dev
- libxcb-xkb-dev
- libavcodec-dev
- libavcodec-extra
- libavutil-dev
- libavfilter-dev
- libavformat-dev
- libxcb-xinput0
- qtcreator
- qtbase5-dev
- qt5-qmake
- cmake
apps:
atrain:
command: bin/aTrain start
plugs:
- desktop
- desktop-legacy
- opengl
- x11
- wayland
- network
- network-bind
- network-status
- browser-support
extensions: [gnome]
environment:
LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/:$LD_LIBRARY_PATH
# "PYTHONPATH": "$NAP/usr/lib/python3/dist-packages/"
hooks:
install:
plugs: [network]