Repository navigation
Releases: questcollector/autogen-kubernetes
Release list
autogen-kubernetes-v0.6.2
What's Changed
- code executor update by @questcollector in #16
- auto-remove feature
Full Changelog: autogen-kubernetes-mcp-v0.6.1...autogen-kubernetes-v0.6.2
autogen-kubernetes-v0.6.1
What's Changed
- fix behaviors of command, args parameter by @questcollector in #15
bug fix
PodJupyterServer
- support None command
- support args parameter in
_from_config
Full Changelog: autogen-kubernetes-mcp-v0.6.0...autogen-kubernetes-v0.6.1
autogen-kubernetes-mcp-v0.6.1
What's Changed
- fix behaviors of command, args parameter by @questcollector in #15
bug fix
- command and args argument uses single string type
... --command "python -m" --args "arg1 arg2 arg3"Full Changelog: autogen-kubernetes-mcp-v0.6.0...autogen-kubernetes-mcp-v0.6.1
autogen-kubernetes-v0.6.0
What's Changed
- change pod-spec parameter as mergeable attribute by @questcollector in #12
- add automountServiceAccountToken: false to default pod spec by @questcollector in #13
- add Jupyter server code executor by @questcollector in #14
PodJupyterServer
- Creates a Jupyter Server Pod using
jupyter-kernel-gateway, along with the required token secret and service resources. - Similar to
PodCommandLineCodeExecutor, theservice_spec, andsecret_speccan be customized in multiple formats: Python dictionary, YAML/json string, YAML/json file path, or Kubernetes client model. - When used with default arguments, it runs on the
quay.io/jupyter/docker-stacks-foundationimage withjupyter-kernel-gatewayandipykernalinstalled, and executes viajupyter-kernel-gateway. For efficiency in production, building a custom image is recommended. Below is the sample Dockerfile
FROM quay.io/jupyter/docker-stacks-foundation
RUN mamba install --yes jupyter_kernel_gateway ipykernel && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
CMD python -m jupyter kernelgateway --KernelGatewayApp.ip=0.0.0.0 \
--JupyterApp.answer_yes=true \
--JupyterWebsocketPersonality.list_kernels=truePodJupyterCodeExecutor
- A
CodeExecutorthat leverages PodJupyterServer and the jupyter-kernel-gateway server to executor code statefully and retrieve results - When used together with PodJupyterServer,note that the server generates PodJupyterConnectionInfo based on the service FQDN. This means it cannot be directly used in a non-incluster environment.
- After creating the PodJupyterServer, you must construct and provide PodJupyterConnectionInfo so that PodJupyterCodeExecutor can access it properly.
Using with PodJupyterServer
async with PodJupyeterServer() as jupyter_server:
async with PodJupyterCodeExecutor(jupyter_server) as executor:
code_result = await executor.execute_code_blocks(
code_blocks=[
CodeBlock(language="python", code="print('Hello, World!')"),
],
cancellation_token=CancellationToken(),
)
print(code_result)Using custom PodJupyterConnectionInfo
async with PodJupyeterServer() as jupyter_server:
# connection info for created jupyter server pod
connection_info = PodJupyetrConnectionInfo(
host="https://jupyter-server/access/path",
port="443",
token=SecretStr("token-string")
)
async with PodJupyterCodeExecutor(connection_info) as executor:
code_result = await executor.execute_code_blocks(
code_blocks=[
CodeBlock(language="python", code="print('Hello, World!')"),
],
cancellation_token=CancellationToken(),
)
print(code_result)- Even without using PodJupyterServer, you can configure a custom Jupyter server that meets the required conditions and provide PodJupyterConnectionInfo for PodJupyterCodeExecutor to work with
Full Changelog: v0.5.2...autogen-kubernetes-v0.6.0
autogen-kubernetes-mcp-v0.6.0
What's Changed
Command-line Arguments
Command-line arguments are used when creating PodCommandLineCodeExecutor/PodJupyterCodeExecutor and MCP server.
type arguments: jupyter type creates PodJupyterCodeExecutor for python code executor tool.
MCP server have to run in same kubernetes cluster because PodJupyterCodeExecutor only uses service FQDN to connect jupyter server.
Not validated for non-text outputs yet.
flowchart LR
subgraph K8sCluster["Kubernetes Cluster"]
E[PodJupyterCodeExecutor]
J[JupyterServerPod]
end
E --generate--> JAll the arguments are optional
| Argument | Description | Default |
|---|---|---|
type |
Code Executor type, commandline(stateless), jupyter(stateful) supported | |
--host |
MCP server host address | 0.0.0.0 |
--port |
MCP server port | 8000 |
--kubeconfig |
Path to the kubeconfig file | None(auto-detected) |
--image |
Pod container image name | None |
--pod-name |
Pod name | (auto-generated) |
--timeout |
Code execution timeout(seconds) | 60 |
--workspace-path |
Path inside the container where scripts are stored | /workspace |
--namespace, -n |
Kubernetes namespace for Pod creation | default |
--volume |
Kubernetes volume to mount into the Pod/container, accepts YAML format string, YAML file path | None |
--pod-spec |
Custom Pod spec definition(YAML format string, YAML file path) | None |
--command |
Custom executor container command | None |
--args |
Custom executor container arguments | None |
example
commandline type
uvx autogen-kubernetes-mcp commandline --namespace my-namespace --image python:3.11-slimpython -m autogen_kubernetes_mcp commandline --namespace my-namespace --image python:3.11-slimjupyter type
uvx autogen-kubernetes-mcp jupyter --namespace my-namespace --timeout 120python -m autogen_kubernetes_mcp jupyter --namespace my-namespace --timeout 120Full Changelog: v0.5.2...autogen-kubernetes-mcp-v0.6.0
v0.5.2
What's Changed
added autogen-kubernetes-mcp package
- Feat/mcp by @questcollector in #10
- mcp: fix structure, add host, port argument by @questcollector in #11
Full Changelog: v0.5.1...v0.5.2
v0.5.1
What's Changed
- V0.5.1 branch by @questcollector in #9
Project
- pyright: add pyright task
- upgrade autogen version
- pytest: add asyncio_default_fixture_loop_scope in ini_options
README
- update guide for project setting
PodCommandLindCodeExecutor
- Component serialization feature(new)
- CancellationToken support(new)
Full Changelog: v0.4.0.dev10...v0.5.1
v0.4.0.dev10
What's Changed
- 0.4.0.dev9 by @questcollector in #1
- add Workflows by @questcollector in #2
- update license specification by @questcollector in #3
- refactoring by @questcollector in #4
- update README, LICENSE-CODE, pyproject.toml files by @questcollector in #5
- package version update and add integrated test with autogen-agentchat CodeExecutorAgent by @questcollector in #6
New Contributors
- @questcollector made their first contribution in #1
Full Changelog: https://github.com/questcollector/autogen-kubernetes/commits/v0.4.0.dev10