-
Notifications
You must be signed in to change notification settings - Fork 248
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
[httpx][Makefile][copier] add --timeout to copier; use in Makefile #14138
Conversation
We have long had trouble with copying on flaky Internet connections. AFAIK, this is due to our very aggressive timeouts. This change permits the CLI to override the default timeout in `hailtop.aiotools.copy`. Setting this back to 600s should work on most flaky Internet connections. It works on my particularly bad home WiFi. The upload-docs target was old and broken so I deleted it. I did not change the upload-artifacts target because that is Google Cloud specific anyway.
Sent this to you, Ed, since, IIRC, you experienced broken uploads in the past due to our bad copy implementation. If you could clone this and try
that'd be most appreciated! |
From a fresh clone, the above (modified with $ rm -f hail/upload-remote-test-resources && make -C hail upload-remote-test-resources
make: Entering directory '/home/edmund/.local/src/hail/hail'
# # If hailtop.aiotools.copy gives you trouble:
# gcloud storage cp -r src/test/resources/\* gs://hail-test-ezlis/edmund/hail-test-resources/test/resources/
# gcloud storage cp -r python/hail/docs/data/\* gs://hail-test-ezlis/edmund/hail-test-resources/doctest/data/
python3 -m hailtop.aiotools.copy -vvv 'null' '[\
{"from":"src/test/resources","to":"gs://hail-test-ezlis/edmund/hail-test-resources/test/resources/"},\
{"from":"python/hail/docs/data","to":"gs://hail-test-ezlis/edmund/hail-test-resources/doctest/data/"}\
]' --timeout 600
/home/edmund/.local/src/hail/.venv/bin/python3: Error while finding module specification for 'hailtop.aiotools.copy' (ModuleNotFoundError: No module named 'hailtop')
make: *** [Makefile:355: upload-remote-test-resources] Error 1
make: Leaving directory '/home/edmund/.local/src/hail/hail' I'll try again with |
With
What am I missing? |
@ehigham
|
In particular, it appears that your Make might be invoking bash with the sixth argument starting with the three characters
|
e.g.
If you create such a Makefile and run Make do you see |
Good catch on the dependency issue, that should be fixed now. |
|
According to the makefile documentation https://www.gnu.org/software/make/manual/html_node/Splitting-Recipe-Lines.html:
Seems you (or .PHONY: print-shell
print-shell:
@echo $(SHELL) |
hail/Makefile
Outdated
python3 -m hailtop.aiotools.copy -vvv 'null' '[\ | ||
{"from":"src/test/resources","to":"$(CLOUD_HAIL_TEST_RESOURCES_DIR)"},\ | ||
{"from":"python/hail/docs/data","to":"$(CLOUD_HAIL_DOCTEST_DATA_DIR)"}\ | ||
]' --timeout 600 |
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 way would seem to be most compatible across platforms:
python3 -m hailtop.aiotools.copy -vvv 'null' '[\ | |
{"from":"src/test/resources","to":"$(CLOUD_HAIL_TEST_RESOURCES_DIR)"},\ | |
{"from":"python/hail/docs/data","to":"$(CLOUD_HAIL_DOCTEST_DATA_DIR)"}\ | |
]' --timeout 600 | |
python3 -m hailtop.aiotools.copy -vvv 'null' "[\ | |
{\"from\":\"src/test/resources\",\"to\":\"$(CLOUD_HAIL_TEST_RESOURCES_DIR)\"},\ | |
{\"from\":\"python/hail/docs/data\",\"to\":\"$(CLOUD_HAIL_DOCTEST_DATA_DIR)\"}\ | |
]" --timeout 600 |
(This or define SHELL
in all makefiles to make them portable)
EDIT2: OK, so, I'm not sure when this behavior changed but Make 4.0 wants a The docs page you linked directly addresses our use case and suggests we put the command inside of a make variable (thus triggering normal backslash-newline rules rather than the special recipe line rules).
It seems to me like there are not any great choices. Putting the JSON into a Make variable seems too magical and likely to confuse a newbie editing this file. Using escaped double quotes is less legible than literal JSON. Putting the whole JSON array on one line is quite long. I guess we can go with double quotes for now. I tested on Make 3.81 and Make 4.4.1 The first EDIT and the original comment follow for context. EDIT: Nope, I still appear to be wrong. Hold on. I have bash 3.2.57
Looks like this was an intentionally backwards incompatible change in Make 4.0 which removed the POSIX-compatible behavior on which our Makefile relies:
They seem to have broken the behavior in order to fix something else and then added a For the Makefile I shared above, I get equivalent behavior with and without a In particular, the problem is not the shell, it's our Makes behaving differently. Make 3 replaces I don't like the noise of the backslash-quotes. The end of the doc page you linked suggests using a Make variable when you intentionally want normal Makefile backslash-newline interpretation. That feels a bit too clever. Let's try just demanding POSIX-compatibility. I've pushed that change. Can you give it a try? |
You're absolutely right - my |
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.
Works like a charm
We have long had trouble with copying on flaky Internet connections. AFAIK, this is due to our very aggressive timeouts. This change permits the CLI to override the default timeout in
hailtop.aiotools.copy
. Setting this back to 600s should work on most flaky Internet connections. It works on my particularly bad home WiFi.The upload-docs target was old and broken so I deleted it. I did not change the upload-artifacts target because that is Google Cloud specific anyway.
Main benefit is that these targets work in Azure now.