Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample data #99

Merged
merged 3 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is the simplest configuration for developers to start with.
**IMPORTANT**: Set both the Username and Email to the same valid email address.
Admin logins will break if you do not.
3. Run `docker-compose run --rm django ./manage.py makeclient --username your.email@email.com --uri http://localhost:8081/`
4. Run `docker-compose run --rm django ./manage.py populate --username your.email@email.com --csv /path/to/your/import.csv`
4. Run `docker-compose run --rm django ./manage.py populate --csv /srv/samples/scans_to_review-2019-01-23.csv`. This will populate the DB with the sample scans.

### Run Application
1. Run `docker-compose up`
Expand Down
11 changes: 5 additions & 6 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ Otherwise

#### Importing Data
(Note: it might be prudent to run the previous steps before this, i.e. `reset_db`, `migrate`, and `createsuperuser`)
1. Place folder containing sample data at root of project.
- This folder will be referenced here as `sample_data` but can be arbitrarily named.
- *NOTE:* `sample_data` should contain a CSV (referenced here as `file.csv`) with all paths prefixed by `/opt/django-project/`
2. Run `docker-compose build`
3. Finally, run `docker-compose run --rm django python manage.py populate --csv /opt/django-project/sample_data/file.csv`. This will create the corresponding models in the database.
- *NOTE:* Ensure that correct filenames/paths are used.
1. To import the sample data, set the import CSV to `/srv/samples/scans_to_review-2019-01-23.csv` in the GUI and click the Import button.
If you have not set up the initial project yet, this can be done with `docker-compose run --rm django python manage.py populate --csv /srv/samples/scans_to_review-2019-01-23.csv`.
2. To import other data, set the `SAMPLES_DIR` environment variable in your shell prior to running `docker-compose up`.
The `SAMPLES_DIR` should contain your import CSV and all of the data to be imported.
docker-compose will mount that directory at the same path (`${SAMPLES_DIR}:${SAMPLES_DIR}`), so your import CSV can use the same paths as on your native file system.


## Frontend
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
env_file: ./dev/.env.docker-compose
volumes:
- .:/opt/django-project
- ${SAMPLES_DIR-./samples}:${SAMPLES_DIR-/srv/samples}
ports:
- 8000:8000
depends_on:
Expand All @@ -33,6 +34,7 @@ services:
env_file: ./dev/.env.docker-compose
volumes:
- .:/opt/django-project
- ${SAMPLES_DIR-./samples}:${SAMPLES_DIR-/srv/samples}
depends_on:
- postgres
- rabbitmq
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<cat:Catalog ID="nifti" xmlns:arc="http://nrg.wustl.edu/arc" xmlns:cat="http://nrg.wustl.edu/catalog" xmlns:pipe="http://nrg.wustl.edu/pipe" xmlns:prov="http://www.nbirn.net/prov" xmlns:scr="http://nrg.wustl.edu/scr" xmlns:val="http://nrg.wustl.edu/val" xmlns:wrk="http://nrg.wustl.edu/workflow" xmlns:xdat="http://nrg.wustl.edu/security" xmlns:xnat="http://nrg.wustl.edu/xnat" xmlns:xnat_a="http://nrg.wustl.edu/xnat_assessments" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cat:metaFields>
<cat:metaField name="AUDIT">190176:Tue Jan 22 21:48:59 PST 2019=Added:3</cat:metaField>
</cat:metaFields>
<cat:entries>
<cat:entry URI="2_ncanda-mprage-v1/dcm2image.log" content="U" createdBy="RestAPI" createdEventId="190176" createdTime="2019-01-22T21:48:59.710" digest="50e8ddec11fde04768ed286aa8a72993" format="U" name="dcm2image.log">
<cat:tags>
<cat:tag>U</cat:tag>
</cat:tags>
</cat:entry>
<cat:entry URI="2_ncanda-mprage-v1/image.nii.gz" content="U" createdBy="RestAPI" createdEventId="190176" createdTime="2019-01-22T21:48:59.710" digest="25257c86dbe0a4c9528c73ecb0397904" format="U" name="image.nii.gz">
<cat:tags>
<cat:tag>U</cat:tag>
</cat:tags>
</cat:entry>
<cat:entry URI="2_ncanda-mprage-v1/image.nii.xml" content="U" createdBy="RestAPI" createdEventId="190176" createdTime="2019-01-22T21:48:59.710" digest="6b0da5dda68ade789d581eb612b17fc3" format="U" name="image.nii.xml">
<cat:tags>
<cat:tag>U</cat:tag>
</cat:tags>
</cat:entry>
</cat:entries>
</cat:Catalog>
Binary file not shown.
Loading