linien icon indicating copy to clipboard operation
linien copied to clipboard

Add instructions of how to install Linien without internet connection

Open bleykauf opened this issue 1 year ago • 1 comments

Along the lines of https://stackoverflow.com/questions/36725843/installing-python-packages-without-internet-and-using-source-code-as-tar-gz-and

bleykauf avatar Jan 24 '24 09:01 bleykauf

OK so today I tried to tackle this today, and this SO Q&A was a bit more helpful for me. I encountered many issues along the way - some of them will be hard to fix and some of them I managed to easily workaround.

First of all, these PRs are important:

  • https://github.com/linien-org/linien/pull/416
  • https://github.com/linien-org/pyrp3/pull/14
  • https://github.com/linien-org/linien/pull/417

If all of the above will be accepted, and a new pyrp3 will get a new release one would be able to run the following 3 commands, given that pip-tools is available for the python in $PATH:

  1. On the machine with the internet connection, download .whl and .tar.gz files:
python -m pip download \
  --platform=linux-armv7l \
  --no-deps \
  linien-server==2.0.4 \
  --requirement <(python -m piptools compile \
    /path/to/linien/linien-server/pyproject.toml \
    --output-file - 2>/dev/null | sed \
      -e 's/^\(numpy==1.26.4\|six==1.16.0\|scipy==1.14.0\)/#\0 is available on the target host by the Debian distribution/g' \
  )

--no-deps is used because all dependencies are known thanks to the piptools compile output - which includes recursively all the dependencies of all dependencies. numpy, scipy and six are filtered out from that piptools compile output, because they are available already in the RedPitaya OS.

  1. Then send them to the target RedPitaya with:
scp *.whl *.tar.gz [email protected]:
  1. Install the server with pip and the offline packages on the target RedPitaya:
ssh [email protected] pip install --no-index --find-links . linien-server==2.0.4 --no-build-isolation

--no-build-isolation is needed for numpy, scipy, and six to be detected as already installed (as part of the RedPitaya OS).

  1. Enable the server's Systemd service with:
ssh [email protected] linien-server enable

Until the 3 PRs mentioned above are merged, steps 1 and 2 should be slightly modified:

python -m pip download \
  --platform=linux-armv7l \
  --no-deps \
  linien-server==2.0.4 \
  --requirement <(python -m piptools compile \
    <(curl \ 
      --silent \
      --location \
      https://github.com/doronbehar/linien/raw/pyrp3-all-platforms/linien-server/pyproject.toml \
    ) --output-file - 2>/dev/null | sed \
      -e 's/^\(numpy==1.26.4\|six==1.16.0\|scipy==1.14.0\)/#\0 is available on the target host by the Debian distribution/g' \
  )
rm pyrp3-2.0.1.tar.gz && python -m pip download --platform=linux-armv7l --no-deps git+https://github.com/doronbehar/pyrp3@no-setuptools_scm

And after step 2 run:

scp pyrp3-2.0.1.zip [email protected]:

And step 3 should work smoothly with the .zip (and not the .tar.gz file) file as well.

doronbehar avatar Aug 02 '24 11:08 doronbehar