From fd96864bd6fca8f4ff149ca0ba270ebb164254ac Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Thu, 25 Jan 2018 12:33:07 -0500 Subject: [PATCH] Finish updates to framework dependencies doc --- doc/source/admin/framework_dependencies.rst | 577 ++++++------------ doc/source/admin/scaling.md | 3 +- lib/galaxy/dependencies/conda-environment.txt | 74 --- lib/galaxy/dependencies/conda-file.sh | 29 + scripts/common_startup.sh | 2 + 5 files changed, 217 insertions(+), 468 deletions(-) delete mode 100644 lib/galaxy/dependencies/conda-environment.txt create mode 100755 lib/galaxy/dependencies/conda-file.sh diff --git a/doc/source/admin/framework_dependencies.rst b/doc/source/admin/framework_dependencies.rst index 73ba85e519b..4537bb01649 100644 --- a/doc/source/admin/framework_dependencies.rst +++ b/doc/source/admin/framework_dependencies.rst @@ -78,6 +78,15 @@ source code has been cloned to ``/srv/galaxy/server``. $ . /srv/galaxy/venv/bin/activate (venv)$ +Next, in ``galaxy.yml``, set the ``virtualenv`` option in the ``uwsgi`` section to point to your new virtualenv: + +.. code-block:: yaml + + --- + uwsgi: + #... + virtualenv: /srv/galaxy/venv + Install dependencies ^^^^^^^^^^^^^^^^^^^^ @@ -127,8 +136,6 @@ incompatibilities with new versions). By default, the release branches of Galaxy 3. Pinning furthers Galaxy's goal of reproducibility as differing dependency versions could result in non-reproducible behavior. -Pinning management is being migrated to `pipenv`_. See `Pull Request #4891`_ for details. - If you would like to install unpinned versions of Galaxy's dependencies, Install dependencies using the `unpinned requirements file`_, and then instruct Galaxy to start without attempting to fetch wheels: @@ -139,464 +146,248 @@ requirements file`_, and then instruct Galaxy to start without attempting to fet $ sh run.sh --no-create-venv --skip-wheels You may be able to save yourself some compiling by adding the argument ``--index-url -https://wheels.galaxyproject.org/simple/`` to ``pip install``, but it is possible to install all fo Galaxy's +https://wheels.galaxyproject.org/simple/`` to ``pip install``, but it is possible to install all of Galaxy's dependencies directly from PyPI_. -.. _pipenv: http://pipenv.readthedocs.io/ .. _Pull Request #4891: https://github.com/galaxyproject/galaxy/pull/4891 .. _unpinned requirements file: https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/dependencies/requirements.txt .. _PyPI: https://pypi.org -Wheel interaction with other software -------------------------------------- +Dependency management complications +----------------------------------- + +Certain deployment scenarios or other software may complicate Galaxy dependency management. If you use any of these, +relevant information can be found in the corresponding subsection below. Galaxy job handlers ^^^^^^^^^^^^^^^^^^^ -All Galaxy jobs run a metadata detection step on the job outputs upon -completion of the tool. The metadata detection step requires many of Galaxy's -dependencies. Because of this, it's necessary to make sure the metadata -detection step runs in Galaxy's virtualenv. If you run a relatively simple -Galaxy setup (e.g. single process, or multiple Python Paste processes started -using ``run.sh``) then this is assured for you automatically. In more -complicated setups (supervisor, the "headless" Galaxy handler, and/or the -virtualenv used to start Galaxy is not a shared filesystem) it may be necessary -to make sure the handlers know where the virtualenv (or a virtualenv containing -Galaxy's dependencies) can be found. +All Galaxy jobs run a metadata detection step on the job outputs upon completion of the tool. The metadata detection +step requires many of Galaxy's dependencies. Because of this, it's necessary to make sure the metadata detection step +runs in Galaxy's virtualenv. If you run a relatively simple Galaxy deployment (e.g. ``run.sh``) then this is assured for +you automatically. In more complicated setups (running under supervisor and/or the virtualenv used to start Galaxy is +not on a shared filesystem) it may be necessary to make sure the handlers know where the virtualenv (or a virtualenv +containing Galaxy's dependencies) can be found. -If your jobs are failing due to Python ``ImportError`` exceptions, this is most -likely the problem. If so, you can use the ```` tag in ``job_conf.xml`` to -source the virtualenv. For example: +If the virtualenv cannot be located, you will see job failures due to Python ``ImportError`` exceptions, like so: + +.. code-block:: pytb + + Traceback (most recent call last): + File "/srv/galaxy/tmp/job_working_directory/001/set_metadata_RK41sy.py", line 1, in + from galaxy_ext.metadata.set_metadata import set_metadata; set_metadata() + File "/srv/galaxy/server/lib/galaxy_ext/metadata/set_metadata.py", line 23, in + from sqlalchemy.orm import clear_mappers + ImportError: No module named sqlalchemy.orm + +If this is the case, you can instruct jobs to activate the virtualenv with an ``env`` tag in ``job_conf.xml``: .. code-block:: xml - - - ... - - - - ...cluster options... + +