gramex
gramex copied to clipboard
Offline installation on Linux
This PR adds a make offline
option which creates a tarball, to be moved to the target machine. It includes an install.sh
script, which installs Gramex.
@jaidevd is this is automating what we have at https://gramener.com/gramex/guide/install/#offline-install? If yes, it sounds like too much code. If it's doing more, can we discuss?
@sanand0 Yes. The only other thing it's doing is making sure that the effect of gramex setup --all
is also present on the target machine. Please see https://github.com/gramener/gramex/blob/3f11c8a27af3980de60aa82a40e0b5f595f5226a/pkg/offline/build.tmpl
This is the largest file, can you suggest what can be trimmed?
I was thinking of an alternate approach:
wget https://repo.anaconda.com/archive/Anaconda2-5.2.0-Linux-x86_64.sh
bash Anaconda2-5.2.0-Linux-x86_64.sh -b -p /tmp/gramex
/tmp/gramex/bin/conda install -y -c conda-forge -c gramener gramex
tar -cvzf /tmp/gramex.tar.gz /tmp/gramex/
Wouldn't this do the entire job?
This basically works, but if we want to use this as a basis to create a script which will generate the tarball; then
- The Anaconda download URL will keep changing.
- The
gramex
executable has a hashbang which will have to be respected on the client machine. - The resulting tarball is almost a gigabyte.
Other than that, I don't see a problem.
Next steps:
- @jaidevd to test this with Miniconda instead of Anaconda, and share the final lines to copy-paste
- @sanand0 to test this on Windows, and add this to the guide
@sanand0 This is what works:
wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh -O /tmp/miniconda.sh
bash /tmp/miniconda.sh -b -p /tmp/gramex-offline
/tmp/gramex-offline/bin/conda create -n gramex python=3.7 -y
/tmp/gramex-offline/bin/conda install -y 'pip>=20.2'
/tmp/gramex-offline/bin/conda install -y -c conda-forge -c gramener gramex
tar -jvcf /tmp/gramex-offline.tar.bz2 /tmp/gramex-offline/
@kamleshdjango, checkout this branch, and run make offline
from the gramex directory. It will create an archive named gramex-offline.tar.bz2
.
Move the created file to the target machine, unpack it, and run the 'install.sh' script from the same folder.
Please try this out - this will help you avoid editing the hashbangs in the conda and gramex scripts.
Closed as outdated