Commit Graph
50 Commits
Author SHA1 Message Date
Alok Saldanha d747860118 made pruner a daemon thread 2025-11-08 18:40:33 -05:00
Alok Saldanha 55b268125f blacken 2025-11-08 17:23:47 -05:00
Alok Saldanha 4df58f9ceb fixe bug in status.json 2025-11-08 17:21:37 -05:00
Alok Saldanha 1d1d8b4e59 Address linter warnings 2025-11-08 10:57:50 -05:00
Alok Saldanha f260180a76 set default_item_source and start pruner thread 2025-11-05 21:54:18 -05:00
Alok Saldanha 58ae41fe0c Delay itemsource initialization until first request is served 2025-11-05 21:41:10 -05:00
Alok Saldanha 3e5accad65 fixed linting and tests 2025-11-04 06:57:43 -05:00
Andy 903d25763f Fix AttributeError by storing ItemSource objects in default_item_source
Previously, default_item_source was set to a string ("s3" or "local"),
but matching_source() tried to access default_item_source.name, causing:
  AttributeError: 'str' object has no attribute 'name'

This bug occurred when source_name=None (single data source configuration)
and has existed since the ItemSource interface was introduced in 2021.

Changes:
- Store the actual ItemSource object reference instead of string name
- Assign to intermediate variables (s3_source, file_source) for clarity

Fixes the error when viewing datasets with a single data source configured.
2025-10-29 14:08:56 -04:00
Andy 08c546f40a Fix WSGI server initialization by extracting data source setup
Addresses the issue where Gunicorn/uWSGI servers import the gateway
module but never call main(), leaving item_sources empty and causing
the file crawler to fail.

Changes:
- Extract data source initialization into initialize_data_sources()
- Call initialization at module import time for WSGI compatibility
- Add _initialized flag to prevent double initialization
- Simplify main() to delegate to initialize_data_sources()

This ensures data sources are populated when running under WSGI servers
(Gunicorn, uWSGI) while maintaining backward compatibility with the
Flask development server.

Related to GitHub issues #33 and #92
2025-10-29 14:08:56 -04:00
Alok Saldanha 2754bc1ef1 #81 Combined GATEWAY_ENABLE_ANNOTATIONS and GATEWAY_ENABLE_GENE_SETS flags 2023-07-06 08:53:19 -06:00
Alok Saldanha 36c0a4d3d7 #68 add param to set log level 2022-06-20 21:29:19 -04:00
Alok Saldanha fd48920c5b #59 add refresh query param to force refresh of S3 cache 2022-03-14 21:44:05 -04:00
Alok Saldanha 551cb46af8 #42 add support for is_authorized hook 2021-11-14 17:28:10 -05:00
Alok Saldanha 73a7920cc8 add back ip_address endpoint 2021-08-12 13:58:19 -04:00
Alok Saldanha 7b799d0159 removed unused code 2021-04-23 07:00:53 -04:00
Alok Saldanha ccf1ba58a8 #45 add extra_scripts to cache_status page 2021-04-20 13:17:37 -04:00
Alok Saldanha ae35d24d80 only set wsgi.url_scheme when EXTERNAL_PROTOCOL is set 2021-04-05 07:55:20 -04:00
Alok Saldanha 33331c9198 Template has correct relaunch_url. 2021-04-03 07:08:20 -04:00
Alok Saldanha 5c488d8d5e only include source path element in url when multiple sources 2021-04-02 11:40:11 -04:00
Alok Saldanha 76f3939fdd rebased "Introduction of ItemSource interface" patch 2021-03-28 22:05:08 -04:00
Alok Saldanha 5404a8b0f3 removed trailing slash from render_annotations 2021-03-28 21:59:03 -04:00
Alok Saldanha f1f4b0c0ca added environment variables for ProxyFix 2021-02-13 16:42:34 -05:00
Gregor Sturm fbc18fb636 Add ProxyFix to gateway.py 2021-01-18 20:01:53 +01:00
Gregor Sturm 94062c2d64 apply proxy fix 2021-01-18 18:19:25 +01:00
Alok Saldanha ce3eb0eedf Merge branch 'gmerge' into gmaster
# Conflicts:
#	cellxgene_gateway/backend_cache.py
#	cellxgene_gateway/cache_entry.py
#	cellxgene_gateway/env.py
#	cellxgene_gateway/gateway.py
#	cellxgene_gateway/subprocess_backend.py
#	tests/test_cache_entry.py
#	tests/test_dir_util.py
2020-08-30 13:47:22 -04:00
Alok Saldanha 9219336356 blackened code 2020-08-30 13:38:35 -04:00
Alok Saldanha b689357f29 Applied "Formatting and new enumeration for Cellxgene-gateway" patch 2020-08-30 13:36:39 -04:00
Alok Saldanha bfa80f7ef8 #22 blackened code 2020-08-10 17:56:32 -04:00
Alok Saldanha 578845b133 #22 Added /metadata/ip_address endpoint 2020-08-10 17:49:03 -04:00
Alok Saldanha 2b65c095a6 updated import to reflect change in werkzeug api 2020-03-23 03:49:20 -04:00
Alok Saldanha 9f1d217e50 #14 properly use the external protocol in 302 redirects 2020-01-08 03:32:06 -05:00
Alok Saldanha 6c611f55dd #14 redirect prior to returning loading screen 2020-01-07 10:07:46 -05:00
Alok Saldanha 201f876341 #14 added custom method to create data dirs 2020-01-01 01:24:18 -05:00
Alok Saldanha c03098af17 #14 enabled new annotations
Due to issue with opening annotation files with "-" in the name, this doesn't quite work.
2019-12-28 21:55:43 -05:00
Alok Saldanha f41db75a24 #15 added intermediate index pages 2019-12-21 11:57:35 -05:00
Alok Saldanha 9532375eb0 #12 introduce GATEWAY_PORT, rename GATEWAY_HOST and GATEWAY_PROTOCOL to EXTERNAL_HOST and EXTERNAL_PROTOCOL
Keep GATEWAY_HOST and GATEWAY_PROTOCOL for backwards compatibility (for now)
2019-11-17 19:03:47 -05:00
Alok Saldanha 91c9607808 #9 fix race condition by grabbing lock before adding cache entry 2019-10-29 21:19:50 -04:00
Alok Saldanha c937f90779 #8 added endpoint to return status json 2019-10-20 21:08:23 -04:00
Alok Saldanha 464ee87305 #7 added link to terminate loaded dataset 2019-10-20 20:53:38 -04:00
Alok Saldanha 2f2541d2b1 #6 added info output of env
improved logging config
2019-09-23 15:15:44 -04:00
Alok Saldanha d3a290a3ab #6 add GATEWAY_ENABLE_UPLOAD environment variable
routes that modify disk are not added unless the env variable is set.
2019-09-23 14:48:58 -04:00
Alok Saldanha 6cf953aaab #5 added os.path.join to flask routes
Also added a subdir check for security.
2019-09-19 12:54:26 -04:00
Alok Saldanha 5c41dbb18d #2 remove missing property 2019-09-17 11:35:25 -04:00
Alok Saldanha 820314adff #2 blackened 2019-09-17 11:06:50 -04:00
Alok Saldanha f7f49b3568 #2 added link to relaunch server on process error page 2019-09-17 11:05:22 -04:00
Alok Saldanha 2b259ab6b5 #2 added a way to relaunch a cellxgene server 2019-09-17 10:13:20 -04:00
Alok Saldanha a6c9456786 added support for gateway ttl and manual pruning 2019-09-16 17:12:29 -04:00
Alok Saldanha 1b053092b4 added cache status 2019-09-16 13:40:50 -04:00
Alok Saldanha 1e1de19878 added unit test 2019-09-16 10:58:02 -04:00
Eric Ma 952cb1e8e1 refactor to allow use with console entry points 2019-09-05 11:54:34 -04:00