Skip to content

Commit

Permalink
Merge pull request #1795 from kbase/develop
Browse files Browse the repository at this point in the history
Merge to master for 4.3.0 release.
  • Loading branch information
briehl authored Aug 14, 2020
2 parents b952eb7 + 2c96ddb commit c2cedbe
Show file tree
Hide file tree
Showing 64 changed files with 1,008 additions and 1,235 deletions.
12 changes: 8 additions & 4 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
env:
browser: true
amd: true
browser: true
es6: true
node: true
extends: 'eslint:recommended'
parserOptions:
ecmaVersion: 6
ecmaVersion: 2018
root: true
rules:
strict:
- error
- function
indent:
- error
- 4
- SwitchCase:
- 1
- SwitchCase: 1
linebreak-style:
- error
- unix
Expand All @@ -27,3 +29,5 @@ rules:
- allow:
- warn
- error
require-await:
- error
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dev-image:
SKIP_MINIFY=1 DOCKER_TAG=dev sh $(DOCKER_INSTALLER)

run-dev-image:
ENV=$(ENV) bash scripts/local-dev-run.sh
ENV=$(ENV) sh scripts/local-dev-run.sh

install:
bash $(INSTALLER)
Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,7 @@ cd narrative
kbase-narrative
```

Long version:

[Local Narrative setup/deployment](docs/install/local_install.md)

## Server installation (for administrators)

If you want to set up your own Narrative server that uses the Docker framework, the below document will walk you through it. Once the server is set up, you only need to pull new code and build a new Docker image from it. You can also pull Narrative images directly from Dockerhub in the KBase namespace.

The document specifically describes how you would build the system on a [Vagrant](https://www.vagrantup.com) image, but is applicable to any Ubuntu-based system.

[Production Narrative setup/deployment](docs/install/deployment.md)
[Dockerhub Narrative builds](docs/install/dockerhub_builds.md)
Long version: [Local Narrative setup](docs/install/local_install.md)

## Architecture

Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ The Narrative Interface allows users to craft KBase Narratives using a combinati

This is built on the Jupyter Notebook v6.0.2 (more notes will follow).

### Version 4.3.0
- SCT-2664 - Show the app cell status when in a collapsed state.
- Added an "Info" tab to all app cells with app information.
- Updated links to new KBase home page and docs site.
- Fixed an uploader issue where uploads taking longer than 30 seconds would fail.

### Version 4.2.1
- Address problems with SampleSet / AMA Viewer widget.
- SCT-1822 - fix problems with drag and drop data upload failing for more than 100 files (updated the Dropzone widget to version 5.7.0)
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kbase-narrative",
"version": "4.2.1",
"version": "4.3.0",
"homepage": "https://kbase.us",
"dependencies": {
"bluebird": "3.4.7",
Expand All @@ -26,7 +26,7 @@
"requirejs-plugins": "1.0.3",
"requirejs-text": "2.0.14",
"require-css": "0.1.8",
"select2": "4.0.3",
"select2": "^4.0.13",
"select2-bootstrap-theme": "0.1.0-beta.9",
"underscore": "1.8.3",
"file-saver": "1.3.4",
Expand Down
16 changes: 8 additions & 8 deletions docs/developer/local-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ The following changes are required:
- Build the docker image using the make target "dev_image", this builds the docker image without the "grunt minify" step.
The image will be tagged kbase/narrative:dev instead of the current git branch

```bash
make dev-image
```
make dev_image
```

- start the container using the `scripts/local-dev-run.sh` script.

This script starts the narrative image using features to integrate it with local kbase-ui.
- start the container:

```
env=ci bash scripts/local-dev-run.sh
```bash
ENV={ci/next/prod} PORT=<some port number> make run-dev-image
```

where env sets the CONFIG_ENV environment variable for the Docker container; ci is the environment in which you are working (needs to be same as the ui is running on.)
where
* ENV sets the CONFIG_ENV environment variable for the Docker container; ci is the environment in which you are working (needs to be same as the ui is running on.)
* PORT sets the host port that can be used. E.g. if you use PORT=12345, then http://localhost:12345 will start the Narrative. Default is 8888. Note that the logging on the console will always show 8888 since that will be used internal to the container.

- uses the config set $env; makes it easy to test different environments alongside ui
- uses kbase-dev network; allows interoperation with the kbase-ui proxier
Expand Down
25 changes: 25 additions & 0 deletions docs/developer/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Staging a new Narrative release
(Updated 8/12/2020)

1. Update versions following (roughly) semantic versioning. The file to be updated are:
* package.json, package-lock.json, bower.json, src/config.json, src/config.json.templ, src/biokbase/narrative/\_\_init\_\_.py
* Major - backward incompatible changes, like the move from Python 2 -> Python 3, or Narrative typed object changes.
* Minor - new features that don't affect compatibility.
* Patch - adjustments to existing features, bug fixes.

2. Add release notes in RELEASE_NOTES.md
* Add a new heading with the updated version.
* Add a list of changes with some reasonable detail. You don't need to add the name of every module changed, just the overall feature affected. Include JIRA ticket numbers where appropriate.

3. PR these changes to the develop branch.
* Ensure that tests pass.
* Ensure that things work as expected on the CI environment.

4. PR the develop branch to the master branch.
* Deploy on the next environment.
* Ensure that things work as expected.

5. Create a new release in the narrative repo.
* tag it with the new version, prefixed with v (e.g. v4.2.1).

That's it. The deployment image is automatically pushed to Dockerhub (as of this writing) on a successfully merged pull request, and deployed from there.
57 changes: 13 additions & 44 deletions docs/install/local_install.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
## Installing and Running the Narrative Interface
(Updated 8/12/2020)

### Requirements

* Python > 2.7 and < 3.0 (for now, a Python 3.6+ version is upcoming)
* Python's virtualenv package
* NodeJS and NPM >= v8.0.0 (available here: https://nodejs.org/en/)
* Python > 3.6+
* NodeJS and NPM >= v10.0.0 (available here: https://nodejs.org/en/, LTS recommended)
* Bower (install with `npm install -g bower` or instructions here https://bower.io/)
* Highly recommended - a Python environment manager. Conda is mostly used here, but venv, Poetry, or Pipenv should work as well.

### Install - Short version

From the root of the narrative repo:
```
./scripts/install_narrative.sh -v narrative_venv
```
or, for another directory target
```
./scripts/install_narrative.sh -v /path/to/my_venv
./scripts/install_narrative.sh
```

This will create a virtual environment and install the Narrative in to it. You can also leave off the `-v` and install it globally, though that might cause problems with other installed Python packages (especially other versions of the Jupyter Notebook, or Jupyter extensions).
Expand All @@ -25,53 +22,25 @@ If you've never used virtual environments before, read this: https://packaging.p

### Install - Detailed version - read this if you have any problems with the above

1. Create a virtual environment with virtualenv. This creates a directory that encapsulates a complete environment that is separate from others on your system, and protects your system from module and version conflicts. This needs to have a Python2 executable. So do the following to make sure the right version is there. This document will use the directory/environment name "narrative_venv" throughout, but you can call it whatever you want.

First, we're going to find the path to a Python 2 executable.
```
python --version
```
Will give a line like `Python 2.7.15` or `Python 3.6.7 :: Anaconda custom (64-bit)`. If the version is 2.7, then you can use this one. Find the path with
It's highly recommended to create a Python virtual environment with one of the many tools around. This encapsulates a complete environment that is separate from others on your system, and protects your system from module and version conflicts. E.g. with conda installed, the command to create a new environment would be
```
which python
conda create -n narrative-env
```
(will probably return something like `/usr/bin/python`)
If the version is Python 3, then you'll have to find the path to a Python 2 executable. You can do this with
Then activate it with
```
which python2
conda activate narrative-env
```
(which may return soething like `/usr/local/bin/python2`)

With whatever path you get, keep it in mind.

Next, make sure you have `virtualenv` installed. If the `virtualenv` command works, then you're set. If not, do the following:
```
pip install virtualenv --upgrade # vanilla Ubuntu 14.04 images come with a very old version of virtualenv that might be problematic
```

Now, we can make that environment. With the path to your Python 2 executable, do:
```
virtualenv --python=/path/to/python narrative_venv
```

2. Activate that environment
```
source narrative_venv/bin/activate
```

3. Install a few pre-requisite pip packages. There's drift between the local installer and the deployed environments, and this is a patch while things get put back in line (will be fixed on release of the Python 3 Narrative, hopefully before January 1, 2020).
```
pip install scikit-learn pandas clustergrammer_widget
```

4. Run the installation script. With your virtual environment activated, any dependencies will be installed there. This'll take ~450MB in your virtualenv.
2. Run the installation script. With your virtual environment activated, any dependencies will be installed there.
```
sh scripts/install_narrative.sh
```

### Running the Narrative Interface
With your virtualenv active (or not, if you didn't use one), just run:
Just run:
```
kbase-narrative
```
This will automatically open a browser window and run the Narrative inside of it. It will open the Jupyter-based 'tree' page that lists all available Narratives. If you get prompted for a "dev" authentication token, you'll need one from CI.

By default, this will be open on port 8888. If port 8888 is in use, it'll go to the next available one. You can set an optional port with `kbase-narrative -port ####`
2 changes: 1 addition & 1 deletion kbase-extension/kbase_templates/basic_header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav class="navbar-kbase navbar-static-top" id="header">
<div class="container-fluid kb-navbar-container">
<div class="navbar-header">
<a href="http://www.kbase.us">
<a href="https://www.kbase.us">
<img id="logo" src="{{ static_url("kbase/images/kbase_logo.png") }}" width="46">
</a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions kbase-extension/kbase_templates/narrative_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li><a id="kb-shutdown-btn"><div class="kb-nav-menu-icon"><span class="fa fa-power-off"></span></div> Shutdown and Restart</a></li>
</ul>
</div>
<a href="http://www.kbase.us">
<a href="https://www.kbase.us">
<img id="logo" src="{{ static_url("kbase/images/kbase_logo.png") }}" width="46">
</a>
</div>
Expand Down Expand Up @@ -57,8 +57,8 @@
</button>
<ul class="dropdown-menu" aria-labelledby="kb-help-menu">
<li><a id="kb-tour"><div class="kb-nav-menu-icon"><span class="fa fa-map-o"></span></div> Narrative Tour</a></li>
<li><a target="_blank" href="https://kbase.us/narrative-guide/"><div class="kb-nav-menu-icon"><span class="fa fa-book"></span></div> Narrative User Guide</a></li>
<li><a target="_blank" href="https://kbase.us/contact-us/"><div class="kb-nav-menu-icon"><span class="fa fa-envelope-o"></span></div> Contact Us</a></li>
<li><a target="_blank" href="https://docs.kbase.us/getting-started/narrative"><div class="kb-nav-menu-icon"><span class="fa fa-book"></span></div> Narrative User Guide</a></li>
<li><a target="_blank" href="https://www.kbase.us/support/"><div class="kb-nav-menu-icon"><span class="fa fa-envelope-o"></span></div> Contact Us</a></li>
</ul>
</div>
<div class="btn-group">
Expand Down
2 changes: 1 addition & 1 deletion kbase-extension/kbase_templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* https://github.com/ded/bowser
*/
function checkBrowser() {
var redirectUrl = 'kbase.us/user-support/messages/unsupported-browser';
var redirectUrl = 'https://docs.kbase.us/getting-started/browsers';

if (bowser.msie && bowser.version <= 9) {
var protocol = window.location.protocol;
Expand Down
9 changes: 0 additions & 9 deletions kbase-extension/static/kbase/js/api/kbase-client-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7145,7 +7145,6 @@ function ExpressionServices(url,auth) {
this.get_expression_samples_data = function(sampleIds)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_samples_data", [sampleIds]);
// var resp = json_call_sync("ExpressionServices.get_expression_samples_data", [sampleIds]);
return resp[0];
}

Expand All @@ -7157,7 +7156,6 @@ function ExpressionServices(url,auth) {
this.get_expression_samples_data_by_series_ids = function(seriesIds)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_samples_data_by_series_ids", [seriesIds]);
// var resp = json_call_sync("ExpressionServices.get_expression_samples_data_by_series_ids", [seriesIds]);
return resp[0];
}

Expand All @@ -7169,7 +7167,6 @@ function ExpressionServices(url,auth) {
this.get_expression_samples_data_by_experimental_unit_ids = function(experimentalUnitIDs)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_samples_data_by_experimental_unit_ids", [experimentalUnitIDs]);
// var resp = json_call_sync("ExpressionServices.get_expression_samples_data_by_experimental_unit_ids", [experimentalUnitIDs]);
return resp[0];
}

Expand All @@ -7181,7 +7178,6 @@ function ExpressionServices(url,auth) {
this.get_expression_experimental_unit_samples_data_by_experiment_meta_ids = function(experimentMetaIDs)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_experimental_unit_samples_data_by_experiment_meta_ids", [experimentMetaIDs]);
// var resp = json_call_sync("ExpressionServices.get_expression_experimental_unit_samples_data_by_experiment_meta_ids", [experimentMetaIDs]);
return resp[0];
}

Expand All @@ -7193,7 +7189,6 @@ function ExpressionServices(url,auth) {
this.get_expression_samples_data_by_strain_ids = function(strainIDs, sampleType)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_samples_data_by_strain_ids", [strainIDs, sampleType]);
// var resp = json_call_sync("ExpressionServices.get_expression_samples_data_by_strain_ids", [strainIDs, sampleType]);
return resp[0];
}

Expand All @@ -7205,7 +7200,6 @@ function ExpressionServices(url,auth) {
this.get_expression_samples_data_by_genome_ids = function(genomeIDs, sampleType, wildTypeOnly)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_samples_data_by_genome_ids", [genomeIDs, sampleType, wildTypeOnly]);
// var resp = json_call_sync("ExpressionServices.get_expression_samples_data_by_genome_ids", [genomeIDs, sampleType, wildTypeOnly]);
return resp[0];
}

Expand All @@ -7217,7 +7211,6 @@ function ExpressionServices(url,auth) {
this.get_expression_data_by_feature_ids = function(featureIds, sampleType, wildTypeOnly)
{
var resp = json_call_ajax_sync("ExpressionServices.get_expression_data_by_feature_ids", [featureIds, sampleType, wildTypeOnly]);
// var resp = json_call_sync("ExpressionServices.get_expression_data_by_feature_ids", [featureIds, sampleType, wildTypeOnly]);
return resp[0];
}

Expand All @@ -7242,8 +7235,6 @@ function ExpressionServices(url,auth) {

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/json");
//http.setRequestHeader("Content-length", body.length);
//http.setRequestHeader("Connection", "close");
return [http, body];
}

Expand Down
2 changes: 1 addition & 1 deletion kbase-extension/static/kbase/js/kbaseNarrativePrestart.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ define(
.append($('<p>').css({ 'margin': '1em 0 0 1em' })
.html('If that doesn\'t work, please ' +
'contact us at ' +
'<a href="http://kbase.us/contact-us/">http://kbase.us/contact-us/</a> ' +
'<a href="https://www.kbase.us/support/">https://www.kbase.us/support/</a> ' +
'and include the following information:'))
.append($('<p>').css({ margin: '1em 0 0 2em' }).addClass('kb-err-text')
.text('Version: ' + full_version))
Expand Down
Loading

0 comments on commit c2cedbe

Please sign in to comment.