From a9a7a13160fe4b81eab960e6c8c15dd0873dade7 Mon Sep 17 00:00:00 2001 From: rahulAira <136367354+rahulAira@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:42:14 -0400 Subject: [PATCH 1/4] Add kwargs to pass to docker container that runs the Jupyter Server --- autogen/coding/jupyter/docker_jupyter_server.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autogen/coding/jupyter/docker_jupyter_server.py b/autogen/coding/jupyter/docker_jupyter_server.py index 83455e272380..13497652355e 100644 --- a/autogen/coding/jupyter/docker_jupyter_server.py +++ b/autogen/coding/jupyter/docker_jupyter_server.py @@ -59,6 +59,8 @@ def __init__( stop_container: bool = True, docker_env: Dict[str, str] = {}, token: Union[str, GenerateToken] = GenerateToken(), + **kwargs: Any, + ): """Start a Jupyter kernel gateway server in a Docker container. @@ -77,6 +79,7 @@ def __init__( token (Union[str, GenerateToken], optional): Token to use for authentication. If GenerateToken is used, a random token will be generated. Empty string will be unauthenticated. + kwargs (Any): Additional keyword arguments to pass to the docker container. """ if container_name is None: container_name = f"autogen-jupyterkernelgateway-{uuid.uuid4()}" @@ -118,6 +121,7 @@ def __init__( environment=env, publish_all_ports=True, name=container_name, + **kwargs, ) _wait_for_ready(container) container_ports = container.ports From ee8aa910b97a020aedc81152fa57685c396a7bb8 Mon Sep 17 00:00:00 2001 From: Jack Gerrits Date: Wed, 25 Sep 2024 11:34:08 -0400 Subject: [PATCH 2/4] Update docker_jupyter_server.py --- autogen/coding/jupyter/docker_jupyter_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autogen/coding/jupyter/docker_jupyter_server.py b/autogen/coding/jupyter/docker_jupyter_server.py index 13497652355e..84c153c155aa 100644 --- a/autogen/coding/jupyter/docker_jupyter_server.py +++ b/autogen/coding/jupyter/docker_jupyter_server.py @@ -59,7 +59,7 @@ def __init__( stop_container: bool = True, docker_env: Dict[str, str] = {}, token: Union[str, GenerateToken] = GenerateToken(), - **kwargs: Any, + **docker_kwargs: Any, ): """Start a Jupyter kernel gateway server in a Docker container. @@ -79,7 +79,7 @@ def __init__( token (Union[str, GenerateToken], optional): Token to use for authentication. If GenerateToken is used, a random token will be generated. Empty string will be unauthenticated. - kwargs (Any): Additional keyword arguments to pass to the docker container. + docker_kwargs (Any): Additional keyword arguments to pass to the docker container. """ if container_name is None: container_name = f"autogen-jupyterkernelgateway-{uuid.uuid4()}" @@ -121,7 +121,7 @@ def __init__( environment=env, publish_all_ports=True, name=container_name, - **kwargs, + **docker_kwargs, ) _wait_for_ready(container) container_ports = container.ports From 39dae50cf7393beb4aeee07a6e5f6077c64d3fc7 Mon Sep 17 00:00:00 2001 From: Jack Gerrits Date: Wed, 25 Sep 2024 11:38:14 -0400 Subject: [PATCH 3/4] Update docker_jupyter_server.py --- autogen/coding/jupyter/docker_jupyter_server.py | 1 - 1 file changed, 1 deletion(-) diff --git a/autogen/coding/jupyter/docker_jupyter_server.py b/autogen/coding/jupyter/docker_jupyter_server.py index 84c153c155aa..5a3ba3970001 100644 --- a/autogen/coding/jupyter/docker_jupyter_server.py +++ b/autogen/coding/jupyter/docker_jupyter_server.py @@ -60,7 +60,6 @@ def __init__( docker_env: Dict[str, str] = {}, token: Union[str, GenerateToken] = GenerateToken(), **docker_kwargs: Any, - ): """Start a Jupyter kernel gateway server in a Docker container. From d5cd829b2433de18dafba38ea0d64f9431deadc6 Mon Sep 17 00:00:00 2001 From: Jack Gerrits Date: Wed, 25 Sep 2024 11:42:07 -0400 Subject: [PATCH 4/4] Update docker_jupyter_server.py --- autogen/coding/jupyter/docker_jupyter_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/coding/jupyter/docker_jupyter_server.py b/autogen/coding/jupyter/docker_jupyter_server.py index 5a3ba3970001..e5896014a613 100644 --- a/autogen/coding/jupyter/docker_jupyter_server.py +++ b/autogen/coding/jupyter/docker_jupyter_server.py @@ -8,7 +8,7 @@ import uuid from pathlib import Path from types import TracebackType -from typing import Dict, Optional, Type, Union +from typing import Any, Dict, Optional, Type, Union import docker