DataONEorg / mnlite

Light weight read-only DataONE member node in Python Flask
Apache License 2.0
0 stars 0 forks source link

Installation and dependencies pitfalls #22

Closed iannesbitt closed 1 year ago

iannesbitt commented 1 year ago

Some issues I've run into when trying to replicate the mnlite service onto its own user account at mnlite@gmn2. Several overlapping dependency issues must be thought through and resolved for this package to become a plug-and-play installation candidate that we can easily reproduce across platforms/services.

  1. poetry is required for dependency maintenance, but the current version (poetry==1.4.0) does not accept the formatting of poetry.lock/pyproject.toml dependency files created by this version (poetry==1.1.12)
  2. Many of the dependencies are out of date and perhaps conflicting between sonormal and mnlite, but I'm not sure which ones should be pinned due to breaking changes and which can be bumped. Is a simple poetry update sufficient or are there other considerations?
  3. We need to create an installation guide as the process is not obvious to me as someone with limited poetry experience.
iannesbitt commented 1 year ago

@datadavev can you add me as an editor on sonormal? I would like to be able to update the dependencies there.

datadavev commented 1 year ago

I transferred the sonormal repo to DataONEorg, will make updates and integrations a bit simpler

iannesbitt commented 1 year ago

Perfect, thank you!

iannesbitt commented 1 year ago

I finally got a working conda virtual environment. To do so I had to:

iannesbitt commented 1 year ago

I will most likely end up redesigning the installation process like this as although it is unorthodox, it will significantly reduce the pain to reproducibly install mnlite in a new environment.

iannesbitt commented 1 year ago

Turns out uwsgi wasn't building because it wanted an older version of gcc (unbit/uwsgi#1770). I solved the build issue by doing the following:

apt-get update && apt-get install gcc-4.8 && rm /usr/bin/gcc && ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
poetry add uwsgi # or: pip install uwsgi

and then re-linking the gcc version that was formerly linked (gcc-7):

rm /usr/bin/gcc && ln -s gcc-7 /usr/bin/gcc
iannesbitt commented 1 year ago

This can also be solved without root access by doing the following:

conda install -c free gcc

See that it's linked properly and is the correct version:

$ which gcc
#> /home/mnlite/miniconda3/envs/mnlite/bin/gcc
$ gcc --version
#> gcc (GCC) 4.8.5
#> Copyright (C) 2015 Free Software Foundation, Inc.
#> This is free software; see the source for copying conditions.  There is NO
#> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Then poetry add uwsgi