-
Notifications
You must be signed in to change notification settings - Fork 12
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 option to add remote mags and remote layer to an existing dataset #1187
Conversation
…o add-remote-layer-and-mag
It seems to me like the libs already support adding new mags / layers to remote datasets. Therefore, maybe calling the new methods |
full_mag_path = _find_mag_path( | ||
self.dataset.path, self.name, mag.to_layer_name(), self.mags[mag].path | ||
) | ||
assert is_fs_path(full_mag_path), "Cannot delete remote mags." | ||
|
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.
This throws an error in the tests. It is really true, that wklibs support deleting remote mags? e.g. on s3?
@daniel-wer I am now renaming the methods to |
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.
Ok that should be it. I commented everything that I think might be dangerous changes / changes about which I am unsure whether they might be breaking some wklibs functionallity.
Should @markbader review this, maybe? |
Yeah maybe. to me it looks like a state for a first review :) |
Can you clarify why you renamed this? As far as I understand, the libs support opening remote datasets and it's possible to add layers and mags to them. Do you think |
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.
Thanks @markbader for the feedback. It should now be applied
@MichaelBuessemeyer What do you think about my last comment? If possible, I'd like to get this merged and pulled into voxelytics in the next week, before I'm out of office :) Let me know if there are any open discussions or other blockers for you! |
In this specific scenario, I agree with you. But I think the add remote /foreign layer / mag is more mighty than this. At least it has the potential add layers located on any server or accessible file system.
Yeah that's definitely more complicated. What happens is that wklibs updates the datasource-properties.json which include the path to each mag. Thus, the wk server & wklibs should be able to access layers from other "remote" datasets.
sure 👍 |
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.
Looks good to me now. I just commented on the Datasets is_remote_dataset
property, as I can't see the value of it yet.
webknossos/tests/dataset/test_dataset_add_remote_mag_and_layer.py
Outdated
Show resolved
Hide resolved
@MichaelBuessemeyer @markbader Thank you for your work on this! |
….py which behave inconsistent
I'd say they are not strictly the opposite of each other as there are more implementations of upath which are not checked in either of the methods. See the list of official upath implementations from the gh repo But I think we only use the few implementations that are checked in @markbader Maybe you have an Idea why this is failing 🙈? |
Ok this should work (at least the ci still fails at the same point as before)
Strangely |
I get the same CI error in #1196 since yesterday, Both output_path0 and output_path1 fail but they are splitted in the CI (so output_path0 fails in webknossos_linux(3.12,1) and output_path1 in webknossos_linux(3.12, 3)). I don't know where this error comes from, but I think it is unrelated to the failing tests that you wrote. I had this json decode error before and thought they might be caused by vcr-py. But I didn't found a good way for debugging this. |
I also think, this might be related to vcr-py. All the more reason to get rid of it. Can we skip these tests for now and move on with merging? |
@MichaelBuessemeyer @markbader Instead of commenting out the tests you can use this pytest decorator and also include the reason for the skip :) @pytest.mark.skip(
reason="The test is flaky on the CI <for some reason>. Disable it for now."
) |
ok on it :) |
Now I'll give it a retry and if it doesn't work I'll have to disable this as well I guess :/ |
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.
LGTM 🚀 I noticed two minor spelling issues and a merge conflict needs to be resolved, as I disabled the ngff_metadata test in another PR already. Then it should be ready to merge.
webknossos/tests/dataset/test_dataset_add_remote_mag_and_layer.py
Outdated
Show resolved
Hide resolved
webknossos/tests/dataset/test_dataset_add_remote_mag_and_layer.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Mark Bader <[email protected]>
Co-authored-by: Mark Bader <[email protected]>
@MichaelBuessemeyer Sorry, I would have wanted to add a changelog entry before merging, but bulldozer was too eager. We've already spoken to Norman to reconfigure bulldozer to only merge when the automerge label is active. This is somehow misconfigured in this repo. |
Description:
This PR adds option to add remote mags and remote layer to an existing dataset via
dataset.add_remote_layer(layer / URL, layer_name
and `layer.add_remote_mag(mag / URL).When using
add_remote_mag
make sure that the layer to which the mag is added has matching dtype, category and so on.Testing:
I used this script for local testing. Run a local wk to make this work. Else change the local host URLs to webknossos.org urls.
Issues:
Todos:
Make sure to delete unnecessary points or to check all before merging: