Commit Graph

301 Commits

Author SHA1 Message Date
bmccandless
f3d5081d38 exclude a tiledb version that has a known bug (#1604)
exclude a tiledb version that has a known bug
2020-07-07 08:39:50 -07:00
Matt Weiden
e5670d1732 Do not cache index.html (#1603)
* Fix typo

* Run black for code formatting

* Do not cache index.html
2020-07-01 14:35:44 -07:00
bmccandless
5015c5ca3f Return float32 for embedding data type (#1597) 2020-06-30 14:16:55 -07:00
Matt Weiden
152c07a28e Change default branch from 'master' to 'main' (#1589)
The default branch has been changed. This PR cleans up references to
`master` and fixes links that would otherwise be broken.

For more background see the following references:
* https://www.independent.co.uk/life-style/gadgets-and-tech/news/github-master-slave-slavery-whitelist-language-inclusive-a9568576.html
* https://tools.ietf.org/id/draft-knodel-terminology-00.html
2020-06-25 14:04:30 -07:00
Timmy Huang
83376627e8 1510-smoke-test (#1548)
* 1510-smoke-test

* config default

* update tests

* update test config

* fix linter errors

* more comments

* address comments

* use npm install in push_tests.yml

* use environment.default.json

* adding docs

* Take care of @mweiden's nits

* Save screenshots in the __tests__/screenshots/ directory

* typo

* docs

* Add chart tests (#1580)

* merge tests

* check if bin creation returned null before rendering charts (#1576)

* check if bin creation returned null before rendering charts

* refactor chart rendering into functions (#1577)

* little fixes from PR

* reintroduce fix to check for null values

* change getAllByClass to return element

* slice instead

* new stackedbar test

* feedback-1573-test (#1579)

* feedback-1573-test

* enable whole test set

* revert tests

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>

* tweak test to actually render chart

* include snapshot

* remove async

* fix getAllHistograms

* properly grab id

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>

Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com>
Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
2020-06-24 11:45:39 -07:00
bmccandless
e22e671f10 Return 404 when the dataset does not exist (#1581)
Also in this PR, restructure the exception handling.

fixes #1566
2020-06-23 17:14:42 -07:00
bmccandless
99d004d1f0 add config option to handle multiple dataroots (#1531)
#1513
2020-06-04 19:29:37 -07:00
Matt Weiden
101f446f8d Add .gitignore file added by elastic beanstalk (#1506) 2020-06-03 09:14:24 -07:00
bmccandless
76523d4f32 sparse column shift encoding. (#1502)
Many of our matrices are log normalized, which tends to eliminate
the number of non zero values (if there were any).  This prevents
the matrix from being stored as a sparse matrix.  The solution here
is to use a simple transformation to make it sparse again.  The most
common value from each column is subtracted from that column.  These
values that were subtracted are saved in an array called X_col_shift.

The cellxgene code needs to understand how to undo the transformation when
operating over the X matrix.

- added script to create a synthetic dataset for testing
- added a script to convert an existing CXG dataset to a sparse CXG dataset
2020-06-02 08:23:52 -07:00
bmccandless
d0577b94af Return an empty matrix if no rows or columns are selected (#1501)
Return an empty matrix if no rows or columns are selected

Fixes #1499
2020-05-29 14:47:46 -07:00
bmccandless
f7585eef1e Support for sparse tiledb arrays for the X matrix (#1496)
Support for sparse tiledb arrays for the X matrix

1. cxgtool can now output sparse matrices
2. cxg_adaptor and diffexp_cxg updated to handle sparse matrices
3. added a test in test_diffexp to test sparse diffexp and get_X_array
2020-05-28 18:36:02 -07:00
bmccandless
030eea1898 Update run_diffexp.py (#1494)
You can now select labels within groups instead of random rows.
2020-05-26 16:06:33 -07:00
Matt Weiden
51758a0be9 Remove the trusted types requirement (#1495)
There seem to be breaking changes in Chrome that are causing this to
fail. We've weighed the risk of disabling the feature with the issues
we've encountered using it and decided to disable it for now.
2020-05-26 12:31:56 -07:00
bmccandless
4d100d4507 Upgrade to tiledb 2.0 (#1485)
* Upgrade to tiledb 2.0
2020-05-21 14:55:11 -07:00
Matt Weiden
e21997799c Upgrade python requirements to click>=7.1.2 (#1472)
6.7 does not have the `hidden` flag used in the code. Users building the
app with an older version of click within the current range specified by
requirements.txt may fail.
2020-05-14 10:04:28 -07:00
Matt Weiden
730410c5e1 Autoformat python to fix lint errors (#1470)
* Autoformat python to fix lint errors

* Fix lint errors not caught by black
2020-05-12 13:19:38 -07:00
Bruce Martin
c1bf491a96 Hooks for sentry integration (#1460)
* add sentry webpack plugin

* allow override of webpack config

* work around cheerio inability to parse jinga templates

* webpack can not minify jinja templates

* allow script injection to specify other attributes

* allow script injection to specify other attributes

* Adjustments to make plugin systems work

* Add sourcemaps for javascript in prod webpack

* Update .gitignore

* Fix spelling errors

Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com>
2020-05-08 15:59:56 -07:00
bmccandless
f49507f18a app_config, fix bug with list/tuple command line arguments. (#1464)
* app_config, fix bug with list/tuple command line arguments.

There was a error caused by pyyaml using lists, and click using tuples.
Now tuples are automatically converted to lists when the config is
updated.
2020-05-06 12:00:02 -07:00
Matt Weiden
5947306ca0 Add server plugin system (#1447)
* Add server plugin system

Plugins are optional modules loaded at runtime. Specification:
* Plugins are loaded from the server.plugins module (directory
  server/plugins)
* The import_plugins method is run as part of the initialization of the
  server module in __init__.py

* Add plugins to the EB build process

* Remove bit of dead code

* Respond to feedback from @bmccandless
2020-05-05 17:05:42 -07:00
bmccandless
55a7967001 Add a process for specifying exact requirements for an EB deployment (#1451)
Add a process for keeping specifying exact requirements for an EB deployment
2020-05-05 10:51:02 -07:00
bmccandless
61ca75e846 hosted, update order to look for config file. (#1452)
* hosted, update order to look for config file.

The app now uses a local config.yaml file bundled with the artifact
(if present), if it exists, then looks in the CXG_CONFIG_FILE
environment variable.  This is the reverse of previous behavior.
The purpose of this change is to move away from using the
config file on s3, since that could lead to problem where an older
version of the app uses a newer version of the config.

Also in this PR:
1. Changed documentation around dataroot, to describe the posibility of using lustre.
2. Added a few improvements around the secret manager region name.  If we use lustre for dataroot and a local config file, then we will no longer be able to
auto determine the region for the secret manager.  I plan to start using the
environment variable option for hosted cellxgene.

* small edit to README

Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
2020-05-05 10:50:28 -07:00
Matt Weiden
1ee76826c7 Pin tiledb version 0.5.9 (#1453)
There is a regression in 0.6.0
2020-05-05 10:03:57 -07:00
Bruce Martin
f42f5151a6 Refactor build and CSP headers for Safari compat (#1442)
* add unsafe-inline directive to style-src

* debugging - turn on csp reporting

* revert reporting only csp

* do not inline JS and CSS in build

* enable HTTPs only when in production mode

* remove debug printf

* fix clean target

* revert force_https removal
2020-05-04 12:47:35 -07:00
bmccandless
b255e32548 Add a more consistent way to customize the eb deployment (#1446)
* Add a more consistent way to customize the eb deployment

Plus a few minor bugfixes
2020-05-04 09:52:03 -07:00
Matt Weiden
a17fff83cf Return empty colors for .cxg v0.0 files (#1441)
* Return empty colors for .cxg v0.0 files

Fixes https://github.com/chanzuckerberg/cellxgene/issues/1440

The CxgAdaptor.get_colors method currently assumes that the .cxg file has
cxg_group_metadata. As a result, the /api/v0.2/colors endpoint always fails for
.cxg v0.0 files.

* Add test fixture
2020-04-30 17:21:20 -07:00
bmccandless
cd821a0344 Update the EB build process to package in scripts (#1434)
This is implemented specifically to handle the google analytics
script for hosted cellxgene
2020-04-28 14:38:35 -07:00
bmccandless
e495c571c3 Change the EB log level from DEBUG to INFO (#1435)
The log level was mistakenly set to DEBUG, which sent out tons
of less than useful messages.  INFO works much more useful,
and much less verbose.
2020-04-28 14:37:41 -07:00
Bruce Martin
05fcdaf93c Revised terms and privacy consent dialog, analytics hooks (#1426)
* revised terms and privacy consent

* reorg code

* fix conditional

* Overlay reflects un-dissmissable state

* add inline scripts, and consent callback

* add csp_directive config hook

* revert config.yaml

* fix logic error

Co-authored-by: Colin Megill <colinmegill@gmail.com>
2020-04-28 14:21:53 -07:00
Matt Weiden
546e272a60 Add user-defined category-label colors (#1402)
* Add user-defined category-label colors

Fixes https://github.com/chanzuckerberg/cellxgene/issues/1152

As described in https://github.com/chanzuckerberg/cellxgene/issues/1307

* Respond to feedback from @bkmartinjr in nodejs

* Respond to feedback from @bkmartinjr in python

* Add tests to the server module

* Autoformat python, run linter

* Make colors_get error handling specific

* Respond to feedback from @bkmartinjr

* Respond to feedback from @bkmartinjr

* Fix whitespace

* Fix python lint errrors

* Update documentation

* Add --disable-user-colors option to launch and cxgtool.py

* Fix python formatting

* Rename '--disable-user-colors' to '--disable-custom-colors'
2020-04-26 22:52:57 -07:00
Eduardo Lopez
565a3f148d [feature] Prototype a Heroku deployment of hosted cellxgene (#1427)
* hello world

* stuff

* successful build

* updates"

* maybe a basic example

* simplify

* reamde into dockerfile

* some more stuff

* Release procfile

* package.json at top levle

* don't release in procfile for now

* more package.json stuff

* copy assets

* merge master

* not in the relase phase

* revert not necessary

* pin gunicorn version

* reset common.mk

* Update package.json

Co-authored-by: Madison Dunitz <dunitzm@gmail.com>
2020-04-24 12:44:38 -07:00
Bruce Martin
735eb11eb7 refinments to csp (#1422) 2020-04-23 09:54:09 -07:00
Bruce Martin
55ef1448e8 CSP content hashes (#1406)
* remove duplicate content-type header

* plumbing to compute CSP content hashes

* add logging of missing CSP hashes

* convert sub-class init protocol to static

* factor function

* lint
2020-04-17 11:42:09 -07:00
Bruce Martin
d22300e3db fix typo in cxgtool bool handler (#1404) 2020-04-17 11:11:14 -07:00
bmccandless
03a75ec566 s3 listings were cached, preventing new datasets from being accessible (#1408)
Fixes #1407
2020-04-17 10:14:24 -07:00
Matt Weiden
58e4c2489b Auto format python, make sure it passes lint checks (#1401) 2020-04-16 08:07:10 -07:00
bmccandless
7e7ed74b92 Provide a hook into the AWS Secret Manager for the flask secret key (#1398)
Also, the secret manager required a region name, so there was some
refactoring around how regions are handled.

Fixes #1239
2020-04-15 14:33:40 -07:00
bmccandless
5c0b8c6296 Improve diffexp for tiledb (#1388)
* Improve diffexp for tiledb

- The rows from the A and B sets are gathered and processed at the same time.  In this
  way the matrix is only accessed once instead of twice for each tile.
- There is now a single thread queue that gets shared between all callers of the diffexp.
  This will slow down work if diffexp gets too busy.
- There is a target_workunit amount of work given to each thread.  Previously the
  workunit was (rows selected * width of tile), which could be small.  Now multiple
  column tiles can be combined into one workunit.  If the target is too small then
  thread and other overheads may reduce performance.  If target_workunit is too large
  then the size of the gathered sub matrix may take up too much memory.
- add configuration parameters (max_workers, cpu_multiplier, and  target_workunit)
2020-04-13 18:53:13 -07:00
Bruce Martin
136093d583 add GET routes for expression data (#1387)
* add GET routes for expression data

* fix comment typo
2020-04-13 11:28:35 -07:00
bmccandless
98c2a1359b Specialize diffexp for tiledb (#1384)
* Specialize diffexp for tiledb

This patch adds a new diffexp algorithm which is tuned for tiledb.
This algorithm was written by Bruce and is adapted here to plug into the
current framework.  The anndata_adaptor still calls the original
algotithm (which was move from diffexp.py to diffexp_generic.py).
The cxg_adaptor now calls the new diffexp_tiledb version.  Some
code is shared between the two.

This is part 1 of the diffexp for tiledb.  Further tuning and
global throttles are still needed.

A script to run and time diffexp with various options is also
added: test/run_diffexp.py.
2020-04-12 09:56:55 -07:00
bmccandless
5dcfcb5467 s3 region should have a single config param (#1386)
* s3 region should have a single config param

The s3 region can also now be automatically determined to further
reduce errors.

This patch also fixes a bug with order of handling the config params.
The tiledb config needs to be fixed before attempting to load
(need to handle_adaptor before handle_single_dataset)
2020-04-11 15:20:01 -07:00
bmccandless
b3c26e7bc7 Allow diffexp for hosted cellxgene (#1385) 2020-04-11 13:15:26 -07:00
Bruce Martin
bff5745139 disable SSL cert verification (#1374) 2020-04-10 12:58:51 -07:00
Bruce Martin
cfacdb15a8 fix typo (#1379) 2020-04-10 12:58:30 -07:00
Bruce Martin
2d2a7c2108 bump cache control max_age to one week (#1380) 2020-04-10 12:58:09 -07:00
Bruce Martin
61b330b9b0 fix non-finite condition in mean/var calculation (#1381) 2020-04-10 12:52:02 -07:00
Bruce Martin
0398249a20 CXG performance improvements (#1371)
* initial kv cache

* add per-key locks

* comments

* memoize schema

* add missing initialization

* fix sever timing

* fetch only what is requested

* fix tests to not require strict ordering of columns

* clean up annotation request

* remove debugging print
2020-04-09 10:19:26 -07:00
Bruce Martin
e2a12ba9bb diffexp limit UI and configuration (#1336)
* warning on maxCount for diffexp

* cleanup logging

* clarification

* make the limits configurable

* make diff exp limit work

* danger!

* remove debugging code

* fix merge with master

* fix unit tests

Co-authored-by: Colin Megill <colinmegill@gmail.com>
2020-04-09 07:13:41 -07:00
bmccandless
d457988810 Update for app config (#1369)
fixes an issue with "cellxgene launch" which had a bad interaction between
command line parameters and config file parameters.
Now, the config files are applied first, followed by the parameters that
were provided in the command line.

There is also now a check that each of the config attributes is type checked.
2020-04-08 15:44:56 -07:00
Bruce Martin
b466d952f9 add config and init for server timings (#1368)
* add config and init for server timings

* add missing config error check
2020-04-07 15:08:57 -07:00
Bruce Martin
bcacb75296 load embeddings in parallel (#1352)
* load embeddings in parallel

* correctly capture unclipped

* test

* another test

* add convenient copy assets target

* cleanup
2020-04-07 09:48:07 -07:00