TaskWeaver icon indicating copy to clipboard operation
TaskWeaver copied to clipboard

Creating a custom dockerfile

Open arhaang13 opened this issue 1 year ago • 8 comments
trafficstars

Hi,

I created custom plugins and I now want to build the dockerfile and run the same using chainlit how do i do so. I am trying to deploy the same using docker on a remote server.

Thanks

arhaang13 avatar Jun 20 '24 00:06 arhaang13

We don't support execution inside a 'remote' container now.

liqul avatar Jun 20 '24 02:06 liqul

Hi,

I am basically trying to deploy a custom UI page for taskWeaver. I changed the app.py file and chainlit.md file. But the UI still did not change. Can you help me out with the same.

Then, I want to deploy it using docker. So I was trying to build the dockerfile inside the all_in_one_container.

Please help me out with the same.

Thank you!

arhaang13 avatar Jun 20 '24 13:06 arhaang13

Have you re-build the docker image after making those changes? The script is here. You may want to change the name of the image in the script, by changing

version="0.2"
imageName="taskweavercontainers/taskweaver-all-in-one"

Once the script is ready, just run it to build the new image.

liqul avatar Jun 21 '24 09:06 liqul

Thanks. I have another question.

I want to add my custom logo instead of the TaskWeaver logo. I cannot find the place where the logo's image is being used in the chainlit frontend. Can you help out with the same,

Thank you!

arhaang13 avatar Jun 26 '24 12:06 arhaang13

I guess you can find it under playground/UI/public?

liqul avatar Jun 27 '24 06:06 liqul

I am facing the same issue. With chainlit.md updated, the changes are not reflected in the front end. I am using my own docker file. I rebuilt the image after the changes. And where does app.py import chainlit.md file for the welcome messages? Is there a way to overwrite them/disable.

my docker file

# Use an official Python runtime as a parent image
FROM python:3.10

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install the chainlit library
RUN pip install chainlit==1.1.202

# Copy the current directory contents into the container at /app
COPY . .

# Expose port 8000 for the application
EXPOSE 8000

# Define environment variable
ENV PYTHONUNBUFFERED=1

# List files in the working directory to ensure the necessary files are copied
RUN ls -la /app/TaskWeaver/playground/UI

# Command to run the application
CMD ["chainlit", "run", "/app/TaskWeaver/playground/UI/app.py"]

GihanMora avatar Jul 05 '24 13:07 GihanMora

I am facing the same issue. With chainlit.md updated, the changes are not reflected in the front end. I am using my own docker file. I rebuilt the image after the changes. And where does app.py import chainlit.md file for the welcome messages? Is there a way to overwrite them/disable.

my docker file

# Use an official Python runtime as a parent image
FROM python:3.10

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install the chainlit library
RUN pip install chainlit==1.1.202

# Copy the current directory contents into the container at /app
COPY . .

# Expose port 8000 for the application
EXPOSE 8000

# Define environment variable
ENV PYTHONUNBUFFERED=1

# List files in the working directory to ensure the necessary files are copied
RUN ls -la /app/TaskWeaver/playground/UI

# Command to run the application
CMD ["chainlit", "run", "/app/TaskWeaver/playground/UI/app.py"]

The problem is that you run chainlit in a directory other than the /xxx/playground/UI/. So chainlit will create its own chainlit.md in your current working directory. So, the solution is firstly changing your directory to /xxx/playground/UI/ and then starting chainlit from there.

liqul avatar Jul 08 '24 02:07 liqul

Have you re-build the docker image after making those changes? The script is here. You may want to change the name of the image in the script, by changing

version="0.2"
imageName="taskweavercontainers/taskweaver-all-in-one"

Once the script is ready, just run it to build the new image.

I cloned the repo: git clone https://github.com/microsoft/TaskWeaver.git

made this change: inside docker/all_in_one_container/Dockerfile and update the last line from ENTRYPOINT ["/app/entrypoint.sh"] to ENTRYPOINT ["/app/entrypoint_chainlit.sh"]

then went to scripts/build_all_in_one.sh and update this line to version="0.2" to version="latest"

then I do cd scripts and run sh build_all_in_one.sh then I run the image

docker run -it --net=host -e LLM_API_BASE=base_url
-e LLM_API_KEY=api_key
-e LLM_API_TYPE=azure
-e LLM_MODEL=gpt-4o
--name taskweaver taskweavercontainers/taskweaver-all-in-one:latest

when I went to http://localhost:8000/ I didn't see the markdown and when I ask a prompt, I get this in the log and markdown isn't loaded properly

2024-10-22 11:16:27 - Step.init() got an unexpected keyword argument 'root'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/chainlit/utils.py", line 44, in wrapper
    return await user_function(**params_values)
  File "/usr/local/lib/python3.10/site-packages/chainlit/callbacks.py", line 118, in with_parent_id
    await func(message)
  File "/app/playground/UI/app.py", line 403, in main
    async with cl.Step(name="", show_input=True, root=True) as root_step:
TypeError: Step.init() got an unexpected keyword argument 'root'

Image

dev-sabir avatar Oct 23 '24 09:10 dev-sabir