Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency setting of the DockerCommandLineCodeExecutor is missing. Also, error message is incorrect. #5281

Open
Lailiangken opened this issue Jan 31, 2025 · 0 comments

Comments

@Lailiangken
Copy link

What happened?

I apologize if some of the following is difficult to understand due to automatic translation.
Also, sorry if I have the wrong category.

Situation;.
I was trying to build a DooD environment in a WSL2 (Ubuntu) environment and use the CodeExecutor feature.

Error encountered;.
ImportError seems to be detected and stops.
“Missing dependecies for DockerCommandLineCodeExecutor. Please ensure the autogen-ext package was installed with the 'docker' extra. Please ensure the autogen-ext package was installed with the 'docker' extra.
This occurred even after re-installing the package and verifying that the host's Docker was successfully mounted.

What did you expect to happen?

Please ensure the autogen-ext package was installed with the 'docker' extra.
I thought it would be executable after re-installing the above Extra.

How can we reproduce it (as minimally and precisely as possible)?

I'll put up the configuration file after my struggle
dockerfile;

FROM python:3.12-slim
RUN apt-get update && apt-get install -y \
    build-essential \
    python3-dev \
    libyaml-dev \
    gcc \
    make \
    pkg-config \
    docker.io \
    docker-compose \
    curl \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -U pip setuptools wheel && \
    pip install --no-cache-dir -r requirements.txt
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
ENV TZ=Asia/Tokyo
EXPOSE 8502

docker-compose.yml;

  services:
    app:
      build: 
        context: .
        dockerfile: Dockerfile
      image: app
      container_name: app
      privileged: true 
      ports:
        - "8502:8502"
      volumes:
        - type: bind
          source: /var/run/docker.sock
          target: /var/run/docker.sock
        - type: bind
          source: .
          target: /app
        - type: volume
          source: workspace
          target: /workspace
      env_file:
        - .env
      environment:
        - STREAMLIT_SERVER_ADDRESS=0.0.0.0
        - DOCKER_HOST=unix:///var/run/docker.sock

      command: streamlit run group_chat_app.py --server.address=0.0.0.0 --server.port 8502
      networks:
        - app-network
      restart: unless-stopped

  networks:
    app-network:
      driver: bridge

  volumes:
    workspace:

requirements.txt;

# Core dependencies
langchain
langchain-community
pandas
python-dotenv
openai


# UI
streamlit

# AutoGen related
autogen-core
autogen-agentchat
autogen-ext[openai,azure]
autogen-ext[docker]

# Docker related
PyYAML<7.0,>=5.4

AutoGen version

0.4.4

Which package was this bug in

Extensions

Model used

No response

Python version

Python3.12-slim

Operating system

Ubuntu22.08(WSL2)

Any additional info you think would be helpful for fixing this bug

After trying various things on the Docker side, I thought the ErrorMessage was not correct, so I checked the code and thought it was an ImportError for asyncio_atexit and tried it, which solved the problem.
With that in mind, I would appreciate some confirmation.

  1. please add asyncio_atexit to the dependency of autogen_ext[docker].
  2. for autogen_ext/code_executors/docker/_docker_code_executor.py, please make the error message a bit clearer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant