ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.81k stars 889 forks source link

Python dependencies are missing in release binaries #7665

Open ShahanaFarooqui opened 1 week ago

ShahanaFarooqui commented 1 week ago

Currently, we are not packaging Python plugins (clnrest & wssproxy) dependencies with the release binaries. To resolve this, we can consider the following options:

Option 1: Use PyInstaller

Convert the plugin into a standalone executable using PyInstaller. This approach bundles the Python interpreter and all required libraries into a single folder or executable file, making distribution easier.

Option 2: Bundle Python Libraries with Binaries

Bundle dist-packages for CLN with the binaries as they are already being installed with && pip install -r requirements.txt \ command in Dockerfile. files.**

Option 3: Bundle requirements.txt with Binaries

Include the requirements.txt with the binaries and install the dependencies after extraction. The installation process would look something like this:

sudo tar -xvf clightning-v24.08-Ubuntu-24.04.tar.xz -C /usr/local --strip-components=2 \
&& sudo pip3 install -r /usr/local/python/requirements.txt \
&& sudo rm -rf /usr/local/python

For more complex future installation steps, we could convert it into a shell script (e.g., install.sh).

#!/bin/bash

# Extract the tar.xz file and strip components
sudo tar -xvf clightning-v24.08-Ubuntu-24.04.tar.xz -C /usr/local --strip-components=2

# Install Python dependencies
sudo pip3 install -r /usr/local/python/requirements.txt

# Delete the python directory after installation
sudo rm -rf /usr/local/python

Note to self: If we choose this option, remember to remove && pip install -r requirements.txt \ from Dockerfile. files.

Open to Other Suggestions:

Feel free to share your thoughts if there is a better solution.

vincenzopalazzo commented 1 week ago

Due that we already have rust as a build dependencies, why not use the alternative rust plugin that @daywalker90 made for cln rest?

IMHO this should be a good alternative, and we stop required python dependencies to just run vanilla cln

dfgjknhgcrj commented 1 week ago

pip install pyinstaller

dfgjknhgcrj commented 1 week ago

&& pip install -r requirements.txt \henry