Skip to content

Commit

Permalink
Add kwargs to pass to docker container that runs the Jupyter Server (#…
Browse files Browse the repository at this point in the history
…3028)

* Add kwargs to pass to docker container that runs the Jupyter Server

* Update docker_jupyter_server.py

* Update docker_jupyter_server.py

* Update docker_jupyter_server.py

---------

Co-authored-by: Jack Gerrits <[email protected]>
  • Loading branch information
rahulAira and jackgerrits authored Sep 25, 2024
1 parent feef9d4 commit 3c10dc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autogen/coding/jupyter/docker_jupyter_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -59,6 +59,7 @@ def __init__(
stop_container: bool = True,
docker_env: Dict[str, str] = {},
token: Union[str, GenerateToken] = GenerateToken(),
**docker_kwargs: Any,
):
"""Start a Jupyter kernel gateway server in a Docker container.
Expand All @@ -77,6 +78,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.
docker_kwargs (Any): Additional keyword arguments to pass to the docker container.
"""
if container_name is None:
container_name = f"autogen-jupyterkernelgateway-{uuid.uuid4()}"
Expand Down Expand Up @@ -118,6 +120,7 @@ def __init__(
environment=env,
publish_all_ports=True,
name=container_name,
**docker_kwargs,
)
_wait_for_ready(container)
container_ports = container.ports
Expand Down

0 comments on commit 3c10dc5

Please sign in to comment.