Skip to content

Configuration & Server Overhaul - Tool Shed and Reports#3179

Merged
bgruening merged 15 commits intogalaxyproject:devfrom
jmchilton:web_config_overhaul_0
Aug 12, 2017
Merged

Configuration & Server Overhaul - Tool Shed and Reports#3179
bgruening merged 15 commits intogalaxyproject:devfrom
jmchilton:web_config_overhaul_0

Conversation

@jmchilton
Copy link
Member

  • Bring startup scripts and config processing inline between Galaxy, Reports, and the Tool Shed (retry of Bring Galaxy, reports, and shed run scripts in sync. #2837).
  • Define a schema format and tooling (derived from pykwalify) to define web server and application option documentation and validation.
  • Update Galaxy common startup functions to allow starting up uwsgi.
  • Update Galaxy apps to allow YAML-based configuration files.
  • Switch out-of-the box server for use by tool shed and reports to uwsgi.
  • Add schema validation for uwsgi options (derived from uwsgi docs).
  • Add validation/documentation schema for tool shed including
    • Utilities to convert of .ini configs to new YAML ones and switch paste to uwsgi (make tool-shed-config-convert and make tool-shed-config-convert-dry-run).
    • Build a new YAML sample that targets uWSGI out of the box.
    • Utility to validate a tool shed configuration file in the new YAML format (make tool-shed-config-validate).
    • Utility to check best practice config option for tool shed (make tool-shed-config-lint).
  • Add validation/documentation schema for reports including
    • Utilities to convert of .ini configs to new YAML ones and switch paste to uWSGI (make reports-config-convert and make reports-config-convert-dry-run).
    • Build a new YAML sample that targets uWSGI out of the box.
    • Utility to validate a tool shed configuration file in the new YAML format (make reports-config-validate).
    • Utility to check best practice config option for reports (make reports-config-lint).
  • Add reports documentation to the admin section and documentation of the configuration options derived from the schema.

There is no additional duplication between various items (before a .ini.sample had a default and description) now the schema defines these items and everything else (docs, validation, sample YAML) are derived from that. The new validation format should be more usable from within the actual applications themselves to replace existing type conversion and default handling logic - an exciting future direction for this work.

This is hopefully a test bed to bring these concepts quickly to Galaxy - I think all of the infrastructure needed to do this is now readily available after this PR.

This is another attempt at #2866. This extends that work with more unit tests, new linting options, and correctly handles proxy prefix and gzip filters previously expressed in Paste.

@natefoo
Copy link
Member

natefoo commented Nov 16, 2016

Grr Jenkins... I wanted to merge this.

@martenson
Copy link
Member

@natefoo it targets 17.01, also please let me retest.

mercurial==3.7.3
numpy==1.9.2
pycrypto==2.6.1
pyuwsgi==2.1.dev0+gx1.c6ee1f6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be named uwsgi as in PyPi? https://pypi.python.org/pypi/uWSGI

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the naming difference was necessary to use the custom (sadface) version we had to build to make it manylinux wheel-able. More in galaxyproject/starforge#95 and galaxyproject/starforge#114.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, yeah, possibly. Since @jxtx's original work in galaxyproject/starforge#95 may have been destroyed I'm not 100% clear.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nsoranzo I appreciate you bringing this and I don't know the answer to the naming question. Given the difficulty of this - do you think resolving that is important prior to merging this? I think we can just create an issue to track this and go with what is here for now - but obviously we will wait if you think we need to.

Copy link
Member

@nsoranzo nsoranzo Nov 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmchilton Not a blocker for me, a tracking issue seems fair!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker for me either.

AFAIK the way @jxtx is building it is the only way a wheeled uWSGI will work at all and I believe it also needs to be the development version (2.1). Which means that galaxyproject/starforge#114 needs to have both the name and version updated? Unless the changes needed were merged back to 2.0.

@martenson
Copy link
Member

closing and reopening to trigger selenium tests

@martenson martenson closed this Dec 2, 2016
@martenson martenson reopened this Dec 2, 2016
@jmchilton
Copy link
Member Author

@galaxybot test this

@natefoo
Copy link
Member

natefoo commented Dec 7, 2016

Ok to merge @jmchilton?

@jmchilton
Copy link
Member Author

Of course

@martenson
Copy link
Member

martenson commented Dec 7, 2016

Am I missing something that has to be done after the conversion to yml for uwsgi to work (reports)?

Activating virtualenv at .venv
[uWSGI] getting YAML configuration from config/reports.yml
*** Starting uWSGI 2.1-dev (64bit) on [Wed Dec  7 15:49:14 2016] ***
compiled with version: 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72) on 28 June 2016 12:17:28
os: Darwin-15.6.0 Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64
nodename: martenson.bx.psu.edu
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /Users/marten/devel/git/galaxy
detected binary path: /Users/marten/devel/git/galaxy/.venv/bin/python
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 709
your memory page size is 4096 bytes
detected max file descriptor number: 4864
lock engine: OSX spinlocks
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Can't assign requested address [core/socket.c line 771]

@jmchilton
Copy link
Member Author

@martenson Can I see the config file?

@martenson
Copy link
Member

martenson commented Dec 7, 2016

$cat reports.yml
uwsgi:

  http: '127.0.0.1:9001'
  threads: 10

  http-raw-body: true

  offload-threads: 8

  module: 'galaxy.webapps.reports.buildapp:uwsgi_app()'

reports:

  database_connection: 'postgres://usr:pswd@localhost:5432/galaxy-git'

@jmchilton
Copy link
Member Author

@martenson

You already have that address in use?

If not, can you replace http: '127.0.0.1:9001' with http: 'localhost:9001' and let me know if that helps?

@martenson
Copy link
Member

@jmchilton shouldn't be in use; after the change to localhost it works

@jmchilton
Copy link
Member Author

Is 127.0.0.1 not a thing on Macs? I don't get it. @natefoo should this be localhost instead?

@martenson
Copy link
Member

martenson commented Dec 7, 2016

127.0.0.1 is a thing, I use it (even with Galaxy) normally

- They now uniformly handle server option processing.
- Reports and Tool Shed now respect many new and important options such as --skip_venv.
- Reports and Tool Shed now do extra checking around Python version that Galaxy does.

In addition to improving the reports and tool shed startup scripts and reducing cognative load with respect to option handling, this is an important pre-condition to us being able us to switch on uwsgi by default for all three services simultaneously without a bunch of copy and pasting.
Initial outline of allowing launch via uwsgi.
This has been rebased several times and includes a variety of fixes (some thanks to martenson).
 - Implement kwalify schema to validate/define the schema.
 - Replace ini configuration with YAML (completely backward compatible).
 - Rebuild a sample configuration from the schema (config/tool_shed.yml.sample).
 - Implement kwalify schema to validate/define the schema.
 - Replace ini configuration with YAML (completely backward compatible).
 - Rebuild a sample configuration from the schema (config/reports.yml.sample).
- Automatically generate RST docs from config schema.
- Describe older functionality as well as new YAML-based configuration.
- Replace https://wiki.galaxyproject.org/Admin/UsageReports.
Required for the new out-of-the-box configuration of tool shed and reports.
@jmchilton jmchilton force-pushed the web_config_overhaul_0 branch from 1f9f5b7 to 98ca8ce Compare August 10, 2017 17:15
@jmchilton
Copy link
Member Author

Rebased... again...

@bgruening
Copy link
Member

restarted the tests, now everything is green
ping @natefoo and @erasche for review

@bgruening
Copy link
Member

@jmchilton the only thing I have found so far is a not so nice warning if you only have sample yml files.

make tool-shed-config-lint   
if [ -f .venv/bin/activate ]; then . .venv/bin/activate; fi; python lib/galaxy/webapps/config_manage.py lint tool_shed
WARNING: Path [None] not a file, using sample.

I think this can be improved in a later PR and we should get this in asap. Will merge after dinner if no one beats me to it.

uwsgi-rebuild-validation: ## rebuild uwsgi_config.yml kwalify schema against latest uwsgi master.
$(CONFIG_MANAGE) build_uwsgi_yaml

tool-shed-config-validate: ## validate tool shed YAML configuration file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there are a number of lint / validation could we have a target for all of these? e.g. config-validate: uwsgi-rebuild-vlaidation toolshed-config-validate ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uwsgi-rebuild-validation isn't something I'd expect deployers to run that is something we build and ship to them. I guess . a config validate that checked Galaxy, Reports, and Tool Shed configs if they are present would be cool though - I'd hope not too many people have tool shed configurations though 😓.

Configuration Options
----------------------------

.. include:: reports_options.rst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite like this :D

Copy link
Member Author

@jmchilton jmchilton Aug 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to help me get this done for Galaxy for this release 😄?

@bgruening
Copy link
Member

I talked to @erasche and his comments are not critical but nice to have. Would be great if this can be added in follow-up PR.
Tracking issue here: #4419

@bgruening bgruening merged commit 331851b into galaxyproject:dev Aug 12, 2017
@bgruening
Copy link
Member

Thanks @jmchilton - this enables some nice additions in the future!

@martenson
Copy link
Member

martenson commented Aug 12, 2017

Glad this got finally merged, thanks @jmchilton @bgruening @natefoo @erasche 🥇


python ./scripts/paster.py serve $TOOL_SHED_CONFIG_FILE --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $args
find_server $TOOL_SHED_CONFIG_FILE
$run_server $server_args
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martenson @jmchilton After these changes we are setting but not using any more the $args variable, is this breaking the TS bootstrap?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt I tested this so I don't know, no one has complained though 😅. I wouldn't worry too much about that functionality unless someone really intends to use it. I just double checked a fresh Planemo build and its bootstrapped toolshed is working - but it is probably called in a fairly custom way (xref https://github.com/galaxyproject/ansible-galaxy-toolshed/blob/d1355719f431f9228952d57c6c73b47394dba07f/tasks/database.yml#L29).

@nsoranzo nsoranzo deleted the web_config_overhaul_0 branch February 6, 2020 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants