gramex icon indicating copy to clipboard operation
gramex copied to clipboard

Offline installation on Linux

Open jaidevd opened this issue 4 years ago • 7 comments

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 avatar Sep 22 '20 05:09 jaidevd

@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 avatar Sep 23 '20 04:09 sanand0

@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?

jaidevd avatar Sep 23 '20 06:09 jaidevd

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?

sanand0 avatar Sep 23 '20 06:09 sanand0

This basically works, but if we want to use this as a basis to create a script which will generate the tarball; then

  1. The Anaconda download URL will keep changing.
  2. The gramex executable has a hashbang which will have to be respected on the client machine.
  3. The resulting tarball is almost a gigabyte.

Other than that, I don't see a problem.

jaidevd avatar Sep 23 '20 07:09 jaidevd

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 avatar Sep 23 '20 09:09 sanand0

@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/

jaidevd avatar Sep 30 '20 09:09 jaidevd

@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.

jaidevd avatar Jan 25 '21 07:01 jaidevd

Closed as outdated

sanand0 avatar Dec 21 '22 11:12 sanand0