@@ -45,9 +45,11 @@ def latest_neo4j_version() -> str:
4545 return previous_month .strftime ("%Y.%m.0" )
4646
4747
48- def start_session (
49- inside_ci : bool , logs_dir : Path , network : Network , password_dir : Path
50- ) -> Generator [DockerContainer , None , None ]:
48+ def start_session (inside_ci : bool , logs_dir : Path , network : Network , password_dir : Path ) -> Generator [str , None , None ]:
49+ if session_uri := os .environ .get ("GDS_SESSION_URI" ):
50+ yield session_uri
51+ return
52+
5153 session_image = os .getenv (
5254 "GDS_SESSION_IMAGE" , "europe-west1-docker.pkg.dev/gds-aura-artefacts/gds/gds-session:latest"
5355 )
@@ -66,7 +68,7 @@ def start_session(
6668 session_container = session_container .with_network (network ).with_network_aliases ("gds-session" )
6769 with session_container as session_container :
6870 wait_for_logs (session_container , "Running GDS tasks: 0" )
69- yield session_container
71+ yield f" { session_container . get_container_host_ip () } : { session_container . get_exposed_port ( 8491 ) } "
7072 stdout , stderr = session_container .get_logs ()
7173
7274 if stderr :
@@ -80,12 +82,11 @@ def start_session(
8082 f .write (stdout .decode ("utf-8" ))
8183
8284
83- def create_arrow_client (session_container : DockerContainer ) -> AuthenticatedArrowClient :
85+ def create_arrow_client (session_url : str ) -> AuthenticatedArrowClient :
8486 """Create an authenticated Arrow client connected to the session container."""
85- host = session_container .get_container_host_ip ()
86- port = session_container .get_exposed_port (8491 )
87+
8788 return AuthenticatedArrowClient .create (
88- arrow_info = ArrowInfo (f" { host } : { port } " , True , True , ["v1" , "v2" ]),
89+ arrow_info = ArrowInfo (session_url , True , True , ["v1" , "v2" ]),
8990 auth = UsernamePasswordAuthentication ("neo4j" , "password" ),
9091 encrypted = False ,
9192 advertised_listen_address = ("gds-session" , 8491 ),
0 commit comments