This service is used for creating and managing Static Narratives. These are Narratives that are meant to be available for public viewing. They are:
- Viewable anonymously through a shareable link.
- Non-functional, in that they cannot execute jobs or check on job status.
- Non-updateable, each given version of a Static Narrative is tied to a specific version of the original working Narrative that was used to create it.
- Partially interactive, while some elements (mainly the App Cells) have most of their interactivity in common with the Narrative Interface, other visualizer cells do not, and link back to their Narrative.
...
This is a KBase module generated by the KBase Software Development Kit (SDK).
You will need to have the SDK installed to use this module if you want to make any changes to the spec or the API. However, other development work does not require the SDK and can be done locally.
Learn more about the SDK and how to use it.
The StaticNarrative repo has been developed and tested using Python 3.12. There are two sets of dependencies for the repo:
requirements.txt
- packages required for runtimerequirements-test.txt
- packages used in testing and generating coverage, and code linting and formatting.
The contents of the files are mutually exclusive, so both should be installed for the full development environment.
Pip is not always completely reliable at pulling in package dependencies, so it is recommended that you install packages one at a time as follows:
$ cat requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install
...substituting in the appropriate requirements file name.
There are two scripts to assist in local development of static narratives:
create_static_narrative.py
- generate the HTML and data files for the static narrative locallyfetch_test_narrative.py
- retrieve the data objects and reports for a given narrative
See the files for information on how to run them.
Tests do not require the use of the SDK or a test token. They can be run using the shell script test/run_tests.sh
, or directly from the command line:
$ export PYTHONPATH=$PYTHONPATH:$(pwd)/lib
$ pytest test
If you make changes to the spec (and thus the API) of the StaticNarrative app, you will need to recompile the app to generate updated versions of StaticNarrativeImpl.py
, StaticNarrativeServer.py
, and the compilation report, compile_report.json
. These updated files must be committed to the GitHub repo.
Note that there is a bug in some versions of the SDK that assumes the wrong location for the baseclient.py
and authclient.py
files. To fix it, after compilation, edit the StaticNarrativeServer.py
file to amend the following lines:
find (around line 19):
from biokbase import log
from StaticNarrative.authclient import KBaseAuth as _KBaseAuth
replace with:
from biokbase import log
from installed_clients.authclient import KBaseAuth as _KBaseAuth
This is deployed as all other KBase dynamic services, with a hitch. This needs an extra configured directory mount to put the generated static narratives. This is set internally to the module in deploy.cfg
as static_file_root
, but must be mounted in the running service externally.
You may find the answers to your questions in our FAQ or Troubleshooting Guide.