Commit Graph

1122 Commits

Author SHA1 Message Date
Matt Weiden
7d4d360e52 Refactor developer convenience scripts (#1377)
* Cleanup the backend-dev convenience method

* Add the frontend_dev convenience method

frontend_dev is a soup-to-nuts convenience method for setting up the FE
development environment with node running a the client code on port 3000
with the a separate cellxgene package serving the API over port 5005 in
the background.

The script can be run from Finder.

* Update the developer scripts documentation

* Remove the 'test' make target in the client Makefile

Rationale:
* Given how long the smoke tests take to run, it is unlikely that
  developers will want to run all tests together.
* It is unlikely that developers will have set up the backend server
  properly for the tests to pass.
* Available commands should be safe-ish and not lend themselves to
  confusing errors.
* You can still group tests by concatenating them in a make command, as
  in `make unit-test smoke-test`.
* This target isn't used in any of our CI pipelines -- KISS.

* Some version of python3...

* Minor typos in docs

* Respond to feedback from @bkmartinjr

* Make adjustments so that DATASET path is predictable

* Simplify environment defaults a bit
2020-04-15 10:32:19 -07:00
Severiano Badajoz
e5dfd6e8fa Add eslint steps to lint job (#1335)
* add lint-client and lint-diff-client targets

* add lint-diff and lint targets

* prettier

* add lint-diff call to lint task

* temp

* tweak lint-diff

* add lint for PRs and lint for master

* remove temp

* remove incorrect branches syntax, use github_ref

* pull all branches

* format

* proper target and comment

* create separate steps with conditionals

* fix indentation

* refactor lint->lint-server, introduce lint to lint all

* trade diff-index for diff, do check against base instead of master

* remove fetching all branches

* Revert "remove fetching all branches"

This reverts commit 26ce7a0f05.

* tweak comparison

* use local eslint

* add eslint  dep install

* temp

* grab only base

* simplify fetch

* add pull_request type trigger

* specify pushes only to master

* change conditionals to be based on event name

* Revert "temp"

This reverts commit 3d59134cc0.

* "branch" => "branches"

* create separate installation step

* change command based on os
2020-04-15 09:41:45 -07:00
Colin Megill
64bd908c25 Render categories with one label without checkbox (#1375)
* categories with 1 item rendered without checkbox

* break out into helper functions

* prettier
2020-04-13 23:04:23 -04:00
Bruce Martin
a3df1a9f4a performance and correctness fixes to brushable histogram (#1390) 2020-04-13 20:03:46 -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
Matt Weiden
14021db239 Clean up main Makefile (#1376)
* Remove unnecessary make target alias

* Remove installing from build directory

* Update documentation
2020-04-09 17:35:49 -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
Matt Weiden
1f94c71c22 Use sci notation for axis ticks abs(tick) >= 10000 (#1363)
Fixes https://github.com/chanzuckerberg/cellxgene/issues/1349

For more information see https://github.com/d3/d3-format

Note that does not _fully_ fix the issue described in #1349, but rather
makes the formatting issue far less likely. It is _still_ possible for
this to occur if the difference between two ticks in axes happes in the
a significant digit cropped by the scientific notation format
2020-04-08 09:45:32 -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
Bruce Martin
3b341a7191 add hcl dataset (#1366) 2020-04-07 07:51:32 -07:00
Bruce Martin
6193ae4997 Cleanup front-end build and python module contents (#1350)
* cleanup build and module contents

* lint

* update chalk

* more cleanup

* fix unit test
2020-04-06 19:04:06 -07:00
Severiano Badajoz
4efabf5231 refactor to remove non-standard terms in centroid files (#1330)
* refactor to remove non-standard terms

* switch key/value -> label/coords

* fix missing parenth
2020-04-06 10:20:11 -07:00
Bruce Martin
ffa95b5a55 update s3fs requirements (#1348) 2020-04-05 09:22:32 -07:00
Bruce Martin
0d9f24115c cziscience landing page (#1347)
* fix dead link in launch page

* first cut at landing page

* wording changes

* add additional refinements

* fixes from PR review
2020-04-03 16:30:02 -07:00
Bruce Martin
de8033e551 correctly handle categoricals that are not strings (#1346) 2020-04-03 15:50:02 -07:00
Matt Weiden
4117050081 make install should fail if there's no build dir (#1344)
Currently, if there is no build directory, the `make install` target
will attempt to cd into the build directory, fail, and run pip install
-e . in the root directory anyway. This causes cellxgene to be installed
from the source tree instead of what the user would expect.

This commit changes the behavior such that the `make install` will fail
if there is no build directory.
2020-04-03 15:09:54 -07:00
Bruce Martin
7c56041b11 categorical type handling fix (#1342)
* fix numeric category conversion bug

* correctly compute categorical summaries

* lint

* remove debugging print
2020-04-02 14:44:07 -07:00
bmccandless
308ee64f30 Improvements to the matrix cache (#1340)
* Improvements to the matrix cache

- Add a timelimit for the matrix in the cache.
Once the timelimit is reached, the matrix can be removed.

- If a DatasetAccessError occurs, then remove the dataset
from the matrix cache.

Fixes #1322
2020-04-02 13:44:11 -07:00
Bruce Martin
fa0164fdf6 use no-store cache control (#1337) 2020-04-02 09:20:35 -07:00
Bruce Martin
c2a24ae0c6 add cache control headers (#1333)
* add cache control headers

* add config param check
2020-04-01 15:43:43 -07:00
Bruce Martin
33ce95ba09 work-around for column name encoding bug (#1324)
* add attribute cleanup

* fix typo

* handle mappings

* logging

* fix regex

* remove debugging printfs

* update masked characters

* fix typo

* add missing incr
2020-04-01 15:06:21 -07:00
Bruce Martin
708a5af039 Add fetch concurrency limit on obs annotation loading (#1318)
* add fetch concurrency limit

* add tests for PromiseLimit
2020-03-30 16:23:09 -07:00
Severiano Badajoz
033727632c add truncation to loading (#1320) 2020-03-30 15:48:52 -07:00
Bruce Martin
d4ec976aaa update locust routes to match new server URL structure (#1321) 2020-03-30 15:09:45 -07:00
bmccandless
03d7a107bf Fix for s3 region name in data locator (#1316)
There is a small chicken and egg problem.
The config file could be in s3, therefore when using the DataLocator to
download the config file, we don't yet have an app_config object.
Adding a check to handle this case.
2020-03-29 09:20:34 -07:00
Bruce Martin
c8f98917c5 tos prompt (#1313)
* tos toast

* finish ToS prompt

Co-authored-by: Colin Megill <colinmegill@gmail.com>
2020-03-28 22:31:19 -07:00
Bruce Martin
8fac40b6ae various fixes for s3fs use (#1312)
* various fixes for s3fs use

* lint
2020-03-28 22:26:03 -07:00
bmccandless
54a75ffd7e Add support to include static files into the eb deployment (#1305)
Mostly this is just instructions for how to do this,
with a small addition to the makefile.
This enables support for serving the about_legal_tos and about_legal_privacy
from the cellxgene server.
2020-03-26 15:03:37 -07:00
bmccandless
8c0480b0bc Added a config hook for secret key into the app. (#1304)
* Added a config hook for secret key into the app.

the server first looks in an environment variable,
then looks in a config file.

For the cellxgene launch app, a default key is used if none is provided.
For the eb app, a secret key must be provided.
2020-03-26 15:03:08 -07:00
Bruce Martin
a398f85ccc turn off auto-reload in debug mode (#1301) 2020-03-26 13:34:56 -07:00
Bruce Martin
57938b487b remove static route redirects / bump static to top level (#1299)
* add another favicon rule

* catch only top-level dataset names

* add config flag to disable redirects

* remove static redirect, point all links to top-level /static

* remove extraneous argument

* remove httpd redirect
2020-03-26 10:45:10 -07:00
bmccandless
40c2e4c164 Change route to the datasets (#1302)
Previously is was /<dataset>/...
Now there is an extra levle:  /d/<dataset>/...
2020-03-26 10:35:17 -07:00
Colin Megill
adf7010f50 Add TOS and Privacy url via config (#1300)
* add tos and privacy url via config

* typo

* readd condition

* param
2020-03-26 11:33:41 -04:00
bmccandless
91e17e64a5 Fixes for static_rewrite.config (#1298)
replace tabs with spaces (yaml parsing complained).

change to favicon.png.
2020-03-25 17:44:15 -07:00
Bruce Martin
26605049a4 Various hardening to REST routes (#1293)
* URL reweriting for static

* request size limits

* improve quotas, make tests work

* remove debugging code

* pass limits to front-end

* fix renaming boggle
2020-03-25 16:14:52 -07:00
bmccandless
7b53209ae3 Fix a deadlock when an exception is thrown during matrix validate/open (#1296) 2020-03-25 15:49:49 -07:00
Bruce Martin
674f14f9bd harden dataset name handling (#1297) 2020-03-25 15:37:06 -07:00
Matt Weiden
e07ebf85e8 Small documentation fix in prepare (#1292)
See sample of current behavior below:
```
venv❯ cellxgene prepare example-dataset/pbmc3k.h5ad
[cellxgene] Starting CLI...
Error: [cellxgene] cellxgene prepare has not been installed. Please run
`pip install cellxgene[prepare]` to install the necessary requirements.

~/workspace/cellxgene mweiden/446-custom-color-palette*
1 venv❯ pip install cellxgene[prepare]
zsh: no matches found: cellxgene[prepare]
```

Fix:
Wrap cellxgene[prepare] in single quotes.
2020-03-25 14:38:07 -07:00
bmccandless
5ec66c5b0e Avoid race condition in the matrix cache handling. (#1280)
* Improved fix for matrix cache handling.

During the MatrixDataCacheItem acquire function there was a
time when the write lock was released and the read lock was taken.
During that time, the dataset could have been deleted, later
result in the MatrixDataCacheManageri data adaptor returning None.

The solution is to demote the writer lock to a reader lock instead
of unlocking and relocking.

Also, when a the cache needs to delete an entry, the delete
is done outside the MatrixDataCacheManager lock.   This operation
only requires the write lock for the MatrixDataCacheItem.

Fixes #1255
2020-03-24 12:23:47 -07:00