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

Add instructions of how to install Linien without internet connection #378

Open
bleykauf opened this issue Jan 24, 2024 · 1 comment
Open
Labels
documentation Related to the documentation

Comments

@bleykauf
Copy link
Collaborator

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

@bleykauf bleykauf added the documentation Related to the documentation label Jan 24, 2024
doronbehar added a commit to doronbehar/linien that referenced this issue Aug 2, 2024
No other machines should really use the server, and this dependency
doesn't hurt any other platform that is used to test the server. This
also helps a bit installing the server in an offline manner (linien-org#378), see
also:

jazzband/pip-tools#1220
doronbehar added a commit to doronbehar/pyrp3 that referenced this issue Aug 2, 2024
If trying to install this package in an offline manner (see also:
linien-org/linien#378 ), the metadata pip will
put for this installation might be 0.0.0, due to potential compatiblitiy
issues with setuptools on the target host (RedPitaya probably). See
also:

pypa/setuptools-scm#636
@doronbehar
Copy link
Contributor

doronbehar commented Aug 2, 2024

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:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants