Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.67k stars 860 forks source link

Speed up the building time? #276

Closed chenjuneking closed 1 year ago

chenjuneking commented 1 year ago

Was there any way to speed up the building time? I found it took too much time to build the wheel package, it tooks more than 30 minutes each time.

ramnes commented 1 year ago

What build time exactly? How to reproduce the behavior you're mentioning?

willydouhard commented 1 year ago

In my understand probably poetry build?

chenjuneking commented 1 year ago

In my understand probably poetry build?

Yes, it took about 40 minutes to build the package on my laptop(Lenovo R9000K with windows 11, Git-Bash).

ramnes commented 1 year ago

Alright, so the workaround is to remove src/chainlit/frontend/node_modules before building.

On a typical setup, we have a lot of files in this directory, and Poetry doesn't like this: https://github.com/python-poetry/poetry/issues/7644

We probably should move the frontend somewhere else while still including it in the distribution somehow?

chenjuneking commented 1 year ago

I agree to move the frontend out of the scope of poetry, like this:

- chainlit
  - cypress
  - chainlit
    - chainlit
      - db
      - client
      - __init__.py
      - __main__.py
    - pyproject.toml
    - poetry.lock
  - frontend
    - public
    - src
      - App.tsx

What do you think?

willydouhard commented 1 year ago

I agree but we would have to add some logic in the build to move the built front end folder in the wheel

chenjuneking commented 1 year ago

309