chipmuenk / pyfda

Python Filter Design Analysis Tool
http://chipmuenk.github.io/
MIT License
655 stars 94 forks source link

Created flatpak (Github action script) cannot be accessed #241

Open chipmuenk opened 1 year ago

chipmuenk commented 1 year ago

Running the flatpak from Flathub or pyfda releases

flatpak run com.github.chipmuenk.pyfda

fails with

Traceback (most recent call last):
  File "/app/bin/pyfdax", line 33, in <module>
    sys.exit(load_entry_point('pyfda==0.7.1', 'console_scripts', 'pyfdax')())
  File "/app/bin/pyfdax", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  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 "/app/lib/python3.9/site-packages/pyfda/pyfdax.py", line 20, in <module>
    import matplotlib
  File "/app/lib/python3.9/site-packages/matplotlib/__init__.py", line 113, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "/app/lib/python3.9/site-packages/matplotlib/rcsetup.py", line 28, in <module>
    from matplotlib._fontconfig_pattern import parse_fontconfig_pattern
  File "/app/lib/python3.9/site-packages/matplotlib/_fontconfig_pattern.py", line 15, in <module>
    from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
ModuleNotFoundError: No module named 'pyparsing'

There have been some deprecation warnings during the build process (which I can't find right now). The action 'bilelmoussaoui/flatpak-github-actions@v4' probably is outdated and should be replaced by 'flatpak/flatpak-github-actions' but I'm just guessing here.

@Murmele : could you perhaps take a look at this?

Murmele commented 10 months ago

I tried to look into it, but I am unable to get the flatpak package running again, I am not able to update the requirements without running into strange build errors

chipmuenk commented 3 days ago

It seems the flatpak is building now, the artifact is uploaded but I cannot download it:

Action script

- name: Build package
  uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
  with:
    bundle: com.github.chipmuenk.pyfda.flatpak
    manifest-path: com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml
    cache: false
    branch: development

The build process runs successfully, files are uploaded but I have no idea where to:

Creating a bundle...
/usr/bin/flatpak build-bundle repo com.github.chipmuenk.pyfda.flatpak --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo --arch=x86_64 com.github.chipmuenk.pyfda development
Uploading artifact...
Starting artifact upload
For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Artifact name is valid!
Container for artifact "com.github.chipmuenk.pyfda-x86_64" successfully created. Starting upload of file(s)
...
Total size of all the files uploaded is 54986200 bytes
File upload process has finished. Finalizing the artifact upload
Artifact has been finalized. All files have been successfully uploaded!

The raw size of all the files that were specified for upload is 54986200 bytes

The next step also is successful and uploads more files:

- name: Publish build artifacts
  uses: actions/upload-artifact@v4
  with:
    path: com.github.chipmuenk.pyfda/*
    name: pyfda Flatpak

... giving the following output.

Run actions/upload-artifact@v4
  with:
    path: com.github.chipmuenk.pyfda/*
    name: pyfda Flatpak
    if-no-files-found: warn
    compression-level: 6
    overwrite: false
    include-hidden-files: false
/usr/bin/docker exec  9b2ced314f022e9fe8efb59f5d57f13304f9bd0d1a83bcdd98204bb68d2ee1a0 sh -c "cat /etc/*release | grep ^ID"
With the provided path, there will be 8 files uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 11493
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is YYY
Finalizing artifact upload
Artifact pyfda Flatpak.zip successfully finalized. Artifact ID xxx
Artifact pyfda Flatpak has been successfully uploaded! Final size is 11493 bytes. Artifact ID is xxx
Artifact download URL: https://github.com/chipmuenk/pyfda/actions/runs/11321603163/artifacts/xxx

The problem occurs during download of the artifacts:

- name: Download artifacts
  uses: actions/download-artifact@v4.1.7
  with:
    path: artifacts

- name: list artifacts folder
  run: |
    echo "*** Show artifacts folder: ***"
    ls artifacts
    echo "*** Show artifacts/pyfda Flatpak folder: ***"
    ls "artifacts/pyfda Flatpak"
    # This doesn't work, path / file not found
    echo "*** Show com.github.chipmuenk.pyfda-x86_64: ***"
    ls "com.github.chipmuenk.pyfda-x86_64"

giving the following output:

Run actions/download-artifact@v4.1.7
  with:
    path: artifacts
    merge-multiple: false
    repository: chipmuenk/pyfda
    run-id: 11321603163
Found 1 artifact(s)
No input name or pattern filtered specified, downloading all artifacts
An extra directory with the artifact name will be created for each download
Preparing to download the following artifacts:
- pyfda Flatpak (ID: 2051632930, Size: 11493)
Redirecting to blob download url: https://productionresultssa11.blob.core.windows.net/actions-results/257f05f2-8a9b-43d5-ae1f-174286de7091/workflow-job-run-a187e388-c9ad-5cfd-c7bd-4b71dca68066/artifacts/13dd00d6cad7cd862e9ff996de0250acb53fd27407c587e278e245d080c604b0.zip
Starting download of artifact to: /home/runner/work/pyfda/pyfda/artifacts/pyfda Flatpak
(node:1779) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Artifact download completed successfully.
Total of 1 artifact(s) downloaded
Download artifact has finished successfully

However, the large artifact has not been downloaded, causing the action to fail.

Run echo "*** Show artifacts folder: ***"
*** Show artifacts folder: ***
pyfda Flatpak
*** Show artifacts/pyfda Flatpak folder: ***
Readme.md
build.sh
com.github.chipmuenk.pyfda.yaml
flathub.json
flatpak-github-action-modified-com.github.chipmuenk.pyfda.yaml
install.sh
matplotlib-setup.cfg
pyqt5.json
*** Show com.github.chipmuenk.pyfda-x86_64: ***
ls: cannot access 'com.github.chipmuenk.pyfda-x86_64': No such file or directory
chipmuenk commented 3 days ago

@Murmele : sorry to needle you once more, the build process now seems to run through but I cannot access the uploaded artifact. This problem seems to be much simpler, perhaps you've got an idea here. If not, just ignore my message ;-)

Murmele commented 2 days ago

Hi @chipmuenk I will have a look into it :)