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

add(app): AnythingLLM #4430

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

add(app): AnythingLLM #4430

wants to merge 14 commits into from

Conversation

cori
Copy link
Contributor

@cori cori commented Aug 15, 2024

Turns out i could have just added a couple of commits to the original PR.

After much faffing I decided trying to get AnythingLLM all the way set up from install with no manual steps was going to be super-hacky, so This Is Fine ™️

Maybe the rumored hooks will offer a solution to the challenges i ran into here.

Summary by CodeRabbit

  • New Features
    • Introduced a configuration file for the AnythingLLM application, enabling essential settings for deployment and usage.
    • Added a Docker Compose configuration for easy deployment and management of the application in a containerized environment.
    • Included a description file outlining the key features and functionalities of the AnythingLLM application, enhancing user onboarding and understanding.
    • Created a README file to clarify the purpose and structure of the storage directory for improved data management.

Copy link
Contributor

coderabbitai bot commented Aug 15, 2024

Walkthrough

The recent updates introduce essential configuration and deployment files for the AnythingLLM application. A new config.json organizes application settings, while the docker-compose.yml file facilitates containerized deployment and management. Additionally, a README.md file clarifies the purpose of the storage directory, and a description.md file outlines the application's features and user onboarding process.

Changes

Files Change Summary
apps/anything-llm/config.json, apps/anything-llm/docker-compose.yml, apps/anything-llm/data/storage/README.md, apps/anything-llm/metadata/description.md New files introduced for application configuration, container deployment, storage management, and feature overview.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cori
Copy link
Contributor Author

cori commented Aug 15, 2024

Oh yeah those fields.

I'll wait to see if someone has any suggestions before choosing myself.

@JigSawFr JigSawFr marked this pull request as draft August 18, 2024 20:58
@JigSawFr JigSawFr self-assigned this Aug 18, 2024
@JigSawFr
Copy link
Collaborator

Oh yeah those fields.

I'll wait to see if someone has any suggestions before choosing myself.

Hello @cori as I seen it's linux timestamp with "000" at end. :)

@JigSawFr JigSawFr changed the title [App] AnythingLLM add(app): AnythingLLM Aug 18, 2024
@cori cori force-pushed the app/AnythingLLM branch from 8ee10ff to be7ac32 Compare August 28, 2024 12:28
@cori
Copy link
Contributor Author

cori commented Aug 29, 2024

I got the dates answer i was looking for once the docs were updated (and it pretty much matched my instincts anyway).

I'm running into one problem while testing this app - during install it tries to create a SQLite DB in the app-data folder and can't access it on first start - the container goes into a restart loop that only resolves on app restart, which isn't a great first-install experience. I'm going to try to work that out before undrafting this.

@cori
Copy link
Contributor Author

cori commented Aug 31, 2024

@coderabbitai review

I think this is ready, and i think an incremental CodeRabbitting will be sufficient to catch any ... insufficiencies.

This last issue was an interesting little problem; AnythingLLM's Prisma client needed access to the ${APP_DATA_DIR}-defined volume for it's storage location, but when it tried to access that path on install / first run it wasn't there. When I exmained the runtipi installation after the failure the location was present, and simply restarting the app from the dashboard allowed Prisma to find the location, create the db file, and run it's migrations. But that's not a good user experience, and this app already has a bit of an install oddity (around needing to manually switch to multiuser mode after setup),

I added a phantom directory in that location in the app's config (by including an explanatory README) and Tipi / Docker then created the location earlier in the process and it was there when Prisma needed it.

Not sure if this is a known pattern - I knew about the data directory for configuration but did not associate that with any order-of-operations changes.

@cori cori marked this pull request as ready for review August 31, 2024 15:15
Copy link
Contributor

coderabbitai bot commented Aug 31, 2024

@cori: The approach you've taken by adding a README file to ensure the creation of the storage directory is a practical and common pattern. It effectively ensures that the directory is available when Prisma needs it, without introducing additional complexity. This method is widely used in similar scenarios, especially in containerized environments, and should work well in ensuring a smooth installation process for the AnythingLLM app.

Great job in resolving this issue! It looks like the solution you've implemented should provide a better first-install experience for users.

Analysis chain
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for the README file added in the PR to understand the changes made by the user.
fd README --exec cat

Length of output: 66374

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cori
Copy link
Contributor Author

cori commented Aug 31, 2024

lol that wasn’t really why I wrote that comment or asked CR for a re-review but I’m glad it approves.

cori-gallimaufries and others added 13 commits September 3, 2024 07:47
this was a plain copy-paste from Mintplex's source, but sure, the
comment's fair.
and update image tag
the storage path seems unavailable on first start and the container
throws and error message but exits with exit code 0. A manual restart
fixes and the source docker-compose file has threstart set to `always`
Placing a file in the app's destination volume for the SQLite database
the app needs to create appears to force Tipi to materialize the folder
at a point in the process where AnythingLLM's Prisma client could access
it on first run.

Without this, the Prisma client tried to create the file at a
as-yet-nonexistant path and failed. Tipi subsequently created the volume
location (b/c it was there on the host after Prisma failed) and a simple
app restart allowed Prisma to run its migrations on the file it could
now create.

steps:

- attempt an init service
- try getting rid of the env var for the storage and stop depending on
the init service
- try an init service again; removing the env var did nothing
- materialize the file?
- remove the volume init service
- try nesting the storage volume inside data
- along with precreating the file? or maybe i won't need that?
- try without preseeding the file
- what if we materialize a different file?
- non-debugging `restart` flag
@cori
Copy link
Contributor Author

cori commented Nov 27, 2024

given the new policy for PRs I will not be grumpy if y'all just close this, but i'll leave it here in case someone's motivated.

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

Successfully merging this pull request may close these issues.

4 participants