Skip to content

Commit

Permalink
fix tls errors for async client stream
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewitt1 committed Aug 25, 2024
1 parent 216b93b commit cb8e590
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ typer
uvicorn
wheel
apispec
httpx
httpx[http2]
6 changes: 4 additions & 2 deletions runhouse/servers/http/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(
self.verify = self.cert_path if self._certs_are_self_signed() else True

self.async_session = httpx.AsyncClient(
auth=self.auth, verify=self.verify, timeout=None
auth=self.auth, verify=self.verify, timeout=None, http2=True
)

self.log_formatter = ClusterLogsFormatter(self.system)
Expand Down Expand Up @@ -573,7 +573,9 @@ async def _alogs_request(
# When running this in another thread, we need to explicitly create an async client here. When running within
# the main thread, we can use the client that was passed in.
if create_async_client:
client = httpx.AsyncClient(auth=self.auth, verify=self.verify, timeout=None)
client = httpx.AsyncClient(
auth=self.auth, verify=self.verify, timeout=None, http2=True
)
else:
client = self.async_session

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def parse_readme(readme: str) -> str:
"uvicorn",
"wheel",
"apispec",
"httpx",
"httpx[http2]",
]

# NOTE: Change the templates/spot-controller.yaml.j2 file if any of the following
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/docker_cluster_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def docker_cluster_pk_ssh(request, test_org_rns_folder):
reqs=[
"ray==2.30.0",
"pytest",
"httpx",
"httpx[http2]",
"pytest_asyncio",
"pandas",
"numpy<=1.26.4",
Expand Down Expand Up @@ -477,7 +477,7 @@ def docker_cluster_pk_http_exposed(request, test_rns_folder):
reqs=[
"ray==2.30.0",
"pytest",
"httpx",
"httpx[http2]",
"pytest_asyncio",
"pandas",
"numpy<=1.26.4",
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pytest
pytest-mock
httpx
httpx[http2]
pytest_asyncio
datasets
dask
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def friend_account_in_org():

def test_env(logged_in=False):
return rh.env(
reqs=["pytest", "httpx", "pytest_asyncio", "pandas", "numpy<=1.26.4"],
reqs=["pytest", "httpx[http2]", "pytest_asyncio", "pandas", "numpy<=1.26.4"],
working_dir=None,
setup_cmds=[
f"mkdir -p ~/.rh; touch ~/.rh/config.yaml; "
Expand Down

0 comments on commit cb8e590

Please sign in to comment.