You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-12Lines changed: 42 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ if you want to run locally you must install requirements.txt for python3
17
17
18
18
## running
19
19
20
-
to run locally run /deployment/bin/entrypoint.sh
20
+
to run locally run /deployment/bin/entrypoint_staging_service.sh
21
21
22
22
to run inside docker run /run_in_docker.sh
23
23
@@ -62,6 +62,21 @@ To add new mappings, update the `GenerateMappings.py` script. New file types and
62
62
to the `staging_service.autodetect.Mappings` module and included from there. See `GenerateMappings.py`
63
63
docstrings for more details.
64
64
65
+
## Data Transfer Service file watcher
66
+
The KBase [Data Transfer Service](https://github.com/kbase/dts) (DTS,
67
+
See [here](https://kbase.github.io/dts) for further documentation) copies data files from external sources into a KBase user's staging area, accompanied by a `manifest.json` file.
68
+
However, due to various permissions reasons, it cannot copy those files directly. First,
69
+
it drops them off in a separate directory to which it has access. The Staging Service DTS
70
+
File Watcher then moves those files to the user's directory.
71
+
72
+
The DTS File Watcher is a separate entrypoint that uses much of the same machinery as the
73
+
rest of the Staging Service. The script can be found in `scripts/run_dts_watcher.py`, and
74
+
the entrypoint can be found in `deployment/bin/entrypoint_dts_watcher.sh`. It
75
+
does not provide a web service, but just watches a directory given in the config as
76
+
`DTS_STAGING_DIR` for changes. If it sees a `manifest.json` file in a subdirectory, it
77
+
parses that to get a KBase username and moves the whole subdirectory to that user's
78
+
staging area.
79
+
65
80
## API
66
81
67
82
all paths should be specified treating the user's home directory as root
@@ -802,21 +817,27 @@ Error Connecting to auth service ...
802
817
### Parse bulk specifications
803
818
804
819
This endpoint parses one or more bulk specification files in the staging area
805
-
into a data
806
-
structure (close to) ready for insertion into the Narrative bulk import or
807
-
analysis cell.
820
+
into a data structure (close to) ready for insertion into the Narrative bulk
821
+
import or analysis cell.
808
822
809
-
It can parse `.tsv`, `.csv`, and Excel (`.xls` and `.xlsx`) files. Templates for
810
-
the currently
811
-
supported data types are available in
823
+
By default, it can parse `.tsv`, `.csv`, and Excel (`.xls` and `.xlsx`) files.
824
+
Templates for the currently supported data types are available in
812
825
the [templates](./import_specifications/templates)
813
826
directory of this repo. See
814
827
the [README.md](./import_specifications/templates/README.md) file
815
828
for instructions on template usage.
816
829
830
+
When given the `dts` flag in the URL, this endpoint can also parse manifest
831
+
files that come from the KBase [Data Transfer Service](https://github.com/kbase/dts) (DTS)
832
+
See [here](https://kbase.github.io/dts) for further documentation on the service.
833
+
This service copies data files from external sources into a KBase user's staging
834
+
area, accompanied by a `manifest.json` file. These also contain information on how to
835
+
load files into KBase importer apps. However, since they are a very specific format,
836
+
this means adding a `dts` flag to the URL. When this flag is present, all files
837
+
are expected to be `.json` files and conform to the [DTS schema](./import_specifications/schema/dts_manifest_schema.json).
838
+
817
839
See the [import specification ADR document](./docs/import_specifications.ADR.md)
GET bulk_specification/?files=file1.<ext>[,file2.<ext>,...]
837
858
```
838
859
839
860
`<ext>` is one of `csv`, `tsv`, `xls`, or `xlsx`.
840
861
841
-
Reponse:
862
+
863
+
```
864
+
GET bulk_specification/?files=file1.json[,file2.json,...]&dts
865
+
```
866
+
867
+
When using the `dts` flag, all files must be JSON and have the `.json` extension.
868
+
869
+
Both versions of the endpoint respond in the same format.
870
+
871
+
Response:
842
872
843
873
```
844
874
{
@@ -1024,7 +1054,7 @@ POST write_bulk_specification/
1024
1054
-`data` contains any data to be written to the file as example data, and is analogous to the data structure returned from the parse endpoint. To specify that no data should be written to the template provide an empty list.
1025
1055
-`<value for ID, row N>` is the value for the input for a given `spec.json` ID and import or analysis instance, where an import/analysis instance is effectively a row in the data file. Each data file row is provided in order for each type. Each row is provided in a mapping of `spec.json` ID to the data for the row. Lines > 3 in the templates are user-provided data, and each line corresponds to a single import or analysis.
0 commit comments