diff --git a/.gitlab/test_python.sh b/.gitlab/test_python.sh index 6f62014b5..37d8eaab9 100755 --- a/.gitlab/test_python.sh +++ b/.gitlab/test_python.sh @@ -89,7 +89,7 @@ python3 test/python/prep_xfer_perf.py array echo "==== Running python examples ====" cd examples/python python3 nixl_api_example.py -python3 partial_md_example.py +python3 partial_md_example.py --init-port "$(get_next_tcp_port)" --target-port "$(get_next_tcp_port)" python3 partial_md_example.py --etcd python3 query_mem_example.py diff --git a/examples/python/partial_md_example.py b/examples/python/partial_md_example.py index 9c9dcaae2..8ee3ee5b7 100755 --- a/examples/python/partial_md_example.py +++ b/examples/python/partial_md_example.py @@ -77,6 +77,18 @@ def invalidate_target_metadata( action="store_true", help="Use ETCD for metadata exchange. Must set NIXL_ETCD_ENDPOINTS environment variable.", ) + parser.add_argument( + "--init-port", + type=int, + default=7777, + help="Port for initiator used in socket exchange (disabled when using ETCD)", + ) + parser.add_argument( + "--target-port", + type=int, + default=5555, + help="Port for target used in socket exchange (disabled when using ETCD)", + ) args = parser.parse_args() logger.info( @@ -101,8 +113,8 @@ def invalidate_target_metadata( # Needed for socket exchange ip_addr = "127.0.0.1" - target_port = 5555 - init_port = 7777 + target_port = args.target_port + init_port = args.init_port # Example using nixl_agent_config agent_config1 = nixl_agent_config(True, True, target_port)