-
Notifications
You must be signed in to change notification settings - Fork 25
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
RF/ENH: download - reimplementation to support original and upcoming UI/API #134
Merged
Merged
Changes from 30 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
e06cbac
ENH: add API server url to the instance records
yarikoptic 9871ece
RF: move girder specifics around
yarikoptic 888b2e4
ENH: support parsing "dandiapi" style URLs from unversioned current D…
yarikoptic d647032
BF(TST): there was one not fixed earlier test with incorrect assert o…
yarikoptic b1539aa
BF: add /api to the API endpoint
yarikoptic d10fa77
RF+ENH: introduce "dandiapi" type of server to download from
yarikoptic 2c1cc94
RF: WiP - I remember that download for girder worked
yarikoptic 764237b
NF: IteratorWithAggregation - to help receiving/displaying total whil…
yarikoptic cb4c80f
NF: remap_dict helper to remap dicts from one "schema" to another
yarikoptic 55774be
ENH/RF: remap girder dandiset into API record, centralize download+ch…
yarikoptic 188530c
ENH: harmonize records from girder to API (+modified), both downloade…
yarikoptic e2bbac1
ENH(TST): a test on 000027 to ensure that both types of download work…
yarikoptic d291eb9
ENH: download - support DANDI: shortcuts
yarikoptic 84fb8c4
ENH: mess of changes to get all downloads working (no parallel yet)
yarikoptic c56d948
ENH: parallel downloads as a tribute to more ugliness
yarikoptic fcfa310
BF: make friends with lint + fix one warning msg to properly include …
yarikoptic afea1f0
BF: girder paths are os specific so use os.path.sep instead of /
yarikoptic aa170d0
Merge remote-tracking branch 'origin/master' into enh-download-api
yarikoptic c3081e7
BF: add None for publish/api in local-docker-tests + TODO comments fo…
yarikoptic e4938cf
BF(TST): avoid using POSIX paths in the test to please Windows
yarikoptic c9d3cf2
ENH(TST): make sleeps shorter, but keep last outter sleep long
yarikoptic 51b0743
minor: test for it.finished without explicit == True
yarikoptic d61295d
BF(workaround,TST): give more time for windows to react
yarikoptic 0708d1a
Merge remote-tracking branch 'origin/master' into enh-download-api
yarikoptic a941485
RF: download - encapsulating some code + moving around + TODOs
yarikoptic 19e3d77
Merge remote-tracking branch 'origin/master' into enh-download-api
yarikoptic aed98c5
BF: making linting happy
yarikoptic 327881e
RF: "dandiapi" -> "api" and "DANDI API" to match /server-info simple …
yarikoptic a4f2a3d
BF: moved lock_dandiset into correct position (incorrect merge side e…
yarikoptic 64d9952
BF(TST): yet one more test fix up for incorrect handling while merging
yarikoptic 4798e49
RF: do not duplicate defaults within kwargs in @click entrypoint for …
yarikoptic 09b2196
BF: cast env var DANDI_MAX_CHUNK_SIZE to int
yarikoptic f367313
BF: close the session if we started a new one
yarikoptic a45b550
ENH: use result.ok instead of checking only for 200 and 201
yarikoptic 515538e
RF: dandiapi - remove not used include_metadata option
yarikoptic 096c8dd
BF: ask for pyout != 0.6.0 so we could keep passing tuples with field…
yarikoptic 5abd195
ENH(UX): set warn to True upon issueing first warning that we got mor…
yarikoptic e52d728
RF: quit loop even before the first .get if exception was raised
yarikoptic 20718e2
RF: completely remove custom subclass HTTPError for now
yarikoptic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
# A list of metadata fields which dandi extracts from .nwb files. | ||
# Additional fields (such as `number_of_*`) might be added by the | ||
# get_metadata` | ||
import os | ||
|
||
metadata_nwb_file_fields = ( | ||
"experiment_description", | ||
"experimenter", | ||
|
@@ -73,23 +75,31 @@ | |
dandiset_metadata_file = "dandiset.yaml" | ||
dandiset_identifier_regex = "^[0-9]{6}$" | ||
|
||
dandi_instance = namedtuple("dandi_instance", ("girder", "gui", "redirector")) | ||
dandi_instance = namedtuple("dandi_instance", ("girder", "gui", "redirector", "api")) | ||
|
||
known_instances = { | ||
"local-girder-only": dandi_instance( | ||
"http://localhost:8080", None, None | ||
"http://localhost:8080", None, None, None | ||
), # just pure girder | ||
# Redirector: TODO https://github.com/dandi/dandiarchive/issues/139 | ||
"local-docker": dandi_instance( | ||
"http://localhost:8080", "http://localhost:8085", None | ||
"http://localhost:8080", | ||
"http://localhost:8085", | ||
None, | ||
"http://localhost:9000", # ATM it is minio, not sure where /api etc | ||
# may be https://github.com/dandi/dandi-publish/pull/71 would help | ||
), | ||
"local-docker-tests": dandi_instance( | ||
"http://localhost:8081", "http://localhost:8086", "http://localhost:8079" | ||
"http://localhost:8081", | ||
"http://localhost:8086", | ||
"http://localhost:8079", | ||
None, # TODO: https://github.com/dandi/dandi-cli/issues/164 | ||
), | ||
"dandi": dandi_instance( | ||
"https://girder.dandiarchive.org", | ||
"https://gui.dandiarchive.org", | ||
"https://dandiarchive.org", | ||
"https://publish.dandiarchive.org/api", # ? might become api. | ||
), | ||
} | ||
# to map back url: name | ||
|
@@ -100,6 +110,14 @@ | |
|
||
file_operation_modes = ["dry", "simulate", "copy", "move", "hardlink", "symlink"] | ||
|
||
# | ||
# Download (upload?) specific constants | ||
# | ||
# Chunk size when iterating a download (and upload) body. Taken from girder-cli | ||
# TODO: should we make them smaller for download than for upload? | ||
# ATM used only in download | ||
MAX_CHUNK_SIZE = os.environ.get("DANDI_MAX_CHUNK_SIZE", 1024 * 1024 * 8) # 64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to cast this to an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. d'oh, right,THANKS! done in 09b2196 |
||
|
||
# | ||
# Some routes | ||
# TODO: possibly centralize in dandi-common from our redirection service | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a situation where click would leave
format
unfilled, and if there is, shouldn't the default be "pyout", not "pytout"?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh... so we can avoid duplicating default values within
kwargs
?! let met just strip then them away fromdownload
and we could do to the rest in a separate PR. THANK YOU! done in 4798e49