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

Document program architecture #166

Merged
merged 6 commits into from
Aug 12, 2024
Merged

Document program architecture #166

merged 6 commits into from
Aug 12, 2024

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Jul 13, 2024

Part of #148.

@jwodder jwodder added documentation Improvements or additions to documentation skip deployment Do not deploy this PR upon merge labels Jul 13, 2024
@jwodder jwodder mentioned this pull request Jul 13, 2024
4 tasks
Copy link

codecov bot commented Jul 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.30%. Comparing base (8d058fe) to head (4b8db19).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
+ Coverage   47.08%   47.30%   +0.21%     
==========================================
  Files          27       27              
  Lines        3859     3854       -5     
==========================================
+ Hits         1817     1823       +6     
+ Misses       2042     2031      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jwodder jwodder mentioned this pull request Jul 13, 2024
12 tasks
@jwodder jwodder changed the title Document architecture and a good portion of the code Document program architecture Jul 14, 2024
@jwodder jwodder force-pushed the archdoc branch 2 times, most recently from f3df216 to 5e7c8a4 Compare July 14, 2024 12:25
@jwodder
Copy link
Member Author

jwodder commented Jul 15, 2024

@yarikoptic I feel that this could use more details, but I'm not sure what. What do you want/need to see in this document?

@jwodder jwodder modified the milestone: Current priorities Jul 17, 2024
@jwodder
Copy link
Member Author

jwodder commented Jul 25, 2024

@yarikoptic Ping.

Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is very nice and informative. Left a few more questions to clarify. Follow up with more details on zarr man could be done separately.

> A new architecture is currently being planned for the code. See [issue
> #67](https://github.com/dandi/dandidav/issues/67) for more information.

This document is best augmented by the doc comments in the `dandidav` source.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure that "doc comments" are in this context... so it should not be a PR changing this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comments are the documentation for the code's API, embedded in the source as triple-slashed comments (example) — like Python's docstrings, but using comments instead.

Also, by "augmented," I meant "To get more information about dandidav, read the documentation in the source," not "If you want to add to this document, add to the documentation in the source instead."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reworded this section in f8355a5.

following inside a clone of this repository:

```console
cargo doc --open --document-private-items --no-deps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to see comments involved installing everything but kitchensink (over 300 modules) and 35 seconds... and then opened

image

which lacks any "Overview" or architecture as far as I see it, not to mention "doc comments". Was this document forgotten to be included?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're looking at (the top page of) the rendered documentation for the source code. It's not supposed to contain an overview or dedicated architecture description (that's what this document is for). The descriptions shown for each item are the rendered doc comments.

doc/architecture.md Show resolved Hide resolved
present in all other responses.

- If any error occurs during the processing of a request, it will almost always
"bubble up" to `DandiDav::handle_request()`, which will log the error and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"bubble up" to `DandiDav::handle_request()`, which will log the error and
"bubble up" to [`DandiDav::handle_request()`][handle-request], which will log the error and

for convenience since we already have this hyperlink

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 4b8db19.

doc/architecture.md Show resolved Hide resolved
the mirror at <https://datasets.datalad.org/dandi/zarr-manifests/>. It is the
data source for the `/zarrs/` hierarchy served by `dandidav`.

See the documentation for the `dandidav::zarrman` module for more information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not really descriptive there ATM. Would be nice to get (follow up PR) some brief similar description for operations on zarrs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded in bb682a1.


- Making calls to a `DandiClient` or `ZarrManClient` instance as
appropriate to fetch information about the given resource and possibly
its child resources
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC our endpoints for under zarr operations under /dandisets/ as within the .zarr assets were notably slower than operation on zarrs under /zarrs/. Is there any caching done/worth doing here to avoid redoing some splitting/decision making?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no caching at the moment, but see #6.

redirect to the Archive API download URL. Unfortunately, certain WebDAV
clients (i.e., [davfs2](https://savannah.nongnu.org/bugs/?65376)) do not
support WebDAV servers that return redirects to other redirects, so the
`--prefer-s3-redirects` CLI option was added to `dandidav` to instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that the option we use on our https://webdav.dandiarchive.org/ ? worth making explicit note here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 4b8db19.

usually the blob ID and not user-friendly. Hence, by default, a `GET`
request to `dandidav` for a blob asset will be responded to with a
redirect to the Archive API download URL. Unfortunately, certain WebDAV
clients (i.e., [davfs2](https://savannah.nongnu.org/bugs/?65376)) do not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there also performance benefit from going directly to S3 in case of heavy (non-zarr) filetree hierarchies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt there's much benefit. The Archive download URLs refer to assets by ID rather than by path, so it should be a simple lookup on the Archive's end. The cost to dandidav is the same regardless of which download URL type it's returning.

doc/architecture.md Show resolved Hide resolved
@jwodder
Copy link
Member Author

jwodder commented Aug 12, 2024

@yarikoptic Ping.

@yarikoptic
Copy link
Member

I have skimmed briefly through changes etc, IMHO it is worth merging and then if anything to extend/fixup - we could do it later.

@jwodder jwodder marked this pull request as ready for review August 12, 2024 16:13
@jwodder jwodder merged commit e82610c into main Aug 12, 2024
@jwodder jwodder deleted the archdoc branch August 12, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation skip deployment Do not deploy this PR upon merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants