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

Trouble Implementing Container Mode with Separate UI and Code Execution Service #437

Open
bsavocad opened this issue Oct 25, 2024 · 2 comments

Comments

@bsavocad
Copy link

We’re trying to set up container mode for our application by splitting the UI into one container and the code execution service into another. However, we’re running into issues connecting the two containers.

What We’ve Tried:

1 Building the UI Container:

  • Successfully built the first container hosting the UI.
  • It works fine when running locally without separating the code execution service.

2 Creating the Code Execution Service Container:

  • Attempted to create a second container for the code execution service.
  • Having trouble getting the UI in the first container to communicate with this second container.

3 Editing environment.py:

  • Adjusted environment.py to point to the correct URL and ports for the code execution service.
  • Despite these changes, the connection between the UI and the code execution service still isn’t working.

Issues We’re Facing:

  • The UI can’t connect to the code execution service in the second container.
  • Getting errors about the UI not being able to communicate with the external service.
  • Attached logs and error messages for more context (see attached files).

We’re Looking For:

  • Guidance on how to properly configure both containers so the UI and code execution service can communicate.
  • Confirmation if we need to do anything else when modifying environment.py or other config files.
  • Suggestions or resources to help us fix this connection issue.
  • Guidance on how to manage the session_id-kernel_id.json in this case

thanks in advance!

@liqul
Copy link
Contributor

liqul commented Oct 28, 2024

To put it more accurately, I believe you want to put the main process of Taskweaver in one container and the code executor in another container. The UI is simply an interface to chat with the main process which involves the planner and code generator. When the code is generated, it is passed to the executor which resides in the container to run the code. So, the UI is a small part of the whole thing.

The main process connects to the executor through a few ports. The executor is a Jupyter kernel process that needs 5 ports, see here which is the function of establishing the connection. The ports are defined inside the executor container and put in a file named ports.json.

So, if you need to have two containers, I believe you need somehow let the main process in one container reach the ports defined in ports.json in another container.

@bsavocad
Copy link
Author

we're actively working on finding a solution for this issue. Once we have something solid, we'll be sure to share it here soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants