-
Notifications
You must be signed in to change notification settings - Fork 28
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 a get_instance() function #186
Conversation
Codecov Report
@@ Coverage Diff @@
## master #186 +/- ##
==========================================
+ Coverage 76.56% 78.26% +1.69%
==========================================
Files 41 41
Lines 3124 3322 +198
==========================================
+ Hits 2392 2600 +208
+ Misses 732 722 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Let's just use semantic_version
which we already have in dependencies.
Now that /server-info
is provided, PR should include changes to make use of get_instance
+ add a few dedicated tests to validate correct handling of scenarios code has envisioned to handle.
dandi/utils.py
Outdated
) | ||
|
||
|
||
class CliVersionError(Exception): |
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.
Let's centralize exception definitions in dandi.exceptions
. I would probably subclass from RuntimeError
instead of a generic Exception
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.
probably worth adding a docstring (or make __str__
explicitly an @abc.abstractmethod
) to note that this is just a base exception, without __str__
and thus derived classes should be used
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.
Done.
@yarikoptic Some of the tests I wrote for |
do a full checkout? |
That works, though I was hoping for something involving a smaller checkout (not that this repo is all that large in the first place, though). New problem: The redirector uses the [1] Except when I ran the tests on my computer, for some reason. |
TL;DR: most likely indeed it would be best to just go with additional environment variable/configuration (e.g. Some details: rright... just some additional digesting for myself: redirector itself needs to be able to correspond to girder instance. For that reason currently On https://stackoverflow.com/a/43541681 found out about magical Also the same SO page talks about linux only "Use --network="host" in your docker run command, then 127.0.0.1 in your docker container will point to your docker host." but tells that it was removed and did not come back. The same SO page references https://github.com/qoomon/docker-host as a solution to establish NAT container as part of the setup... IMHO too heavy weight and seems might still need to require docker tune up to get it working. |
re |
Yes, I am using macOS, though if the tests can resolve the |
I created a PR to add the environment variable to the redirector: dandi/redirector#25. Once that's merged, the |
hm, if I add
with
then it seems to be able to access |
Setting |
if I parsed the sentence correctly,
|
Neither port 8079 nor port 8080 works for me now, and I've just realized that the tests might be failing to connect to the redirector as well, in which case they're falling back to the hard-coded URLs and emitting a (captured & suppressed) warning. |
just some notes from local testing on macos. i made the following changes to the docker-compose file, which allows me to access the relevant services via localhost, since they are exposed from the docker network.
the GUI_URL doesn't seem to work for me (i.e. it doesn't show up), but girder is accessible and the redirector is accessible. |
This would work for dandi-cli testing if we only talk to
yeap, as we discovered in troubleshooting session with @satra yesterday, reason is: dandi/dandiarchive-legacy#474 requiring a fix in the container first. dandi-cli anyways is not concerned with web ui client ATM anyhow anyways. |
@yarikoptic Yes, I believe that would work for now. |
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 for addressing all previous comments! We are converging, I just left two other requests.
Cheers!
The tests pass with |
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.
Left a comment but let's just proceed for now! Thank you @jwodder !
try: | ||
minversion = Version(server_info["cli-minimal-version"]) | ||
bad_versions = [Version(v) for v in server_info["cli-bad-versions"]] | ||
except ValueError as e: |
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.
thinking out loud: sorry for being slow, it got me thinking (since we do not test for version yet etc), what if any of those two is missing? and it kinda makes sense if server does not demand any specific version of the client somehow... I think later some time we might want to allow them to be "optional" but for now we would demand them, and if not present -- blow informatively... or let's just add that later ;)
don't you have a download test for subject folders based on the web ui link? but it's more about processing the link than for the ui to actually work :) |
Yes, but in those we go to central deployment ATM. Indeed we would need it later for self contained tests |
Closes #184