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

tt-studio v1 Release #72

Merged
merged 61 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9acdd34
Anirud/front end UI changes (#21)
anirudTT Aug 13, 2024
8579168
Anirud/license headers (#25)
anirudTT Sep 10, 2024
59fad38
Initial Backend Work
Aug 20, 2024
2f24916
Adds depends_on for backend
Sep 5, 2024
94b8455
Changes PDF parsing to use plain strategy
Sep 6, 2024
1a0f4e2
Removes WIP prepopulate code
Sep 6, 2024
9ec83d0
Removes duplicate pyjwt dependency
Sep 6, 2024
68c549e
Restores docker-compose.yml to match staging
Sep 6, 2024
62151e3
Adds singletons for Chroma client and embedding function
Sep 9, 2024
93465af
Initializes Chroma/embed model in apps ready call
Sep 9, 2024
a051f77
Updates views/chroma to use new singletons
Sep 9, 2024
4425474
Fixes base image version issue from rebase
Sep 11, 2024
63999f2
Fixes issue of first-run failure
Sep 11, 2024
8cba590
Adds an up status endpoint
Sep 11, 2024
8ed3932
Adds service healthy check for backend API
Sep 11, 2024
f55bbd1
Changes backend API healthcheck to be more tolerant
Sep 16, 2024
bc6ad36
Adds react-query, alert-dialog to packages
Sep 6, 2024
5dbec21
Updates vite config to match TS config `@` alias
Sep 6, 2024
8d24a0c
Adds Axios functions for rag management
Sep 6, 2024
7a43652
Adds react-query provider
Sep 6, 2024
c4d2701
Adds confirm dialog component
Sep 6, 2024
4b07ac0
Adds form for creating new data source
Sep 6, 2024
64f479c
Adds route for RAG management
Sep 6, 2024
4826bf9
Adds page for managing RAG data sources
Sep 6, 2024
4e2e1d3
Adds data source selector to ChatComponent
Sep 6, 2024
e4921b6
Adds RAG management link to Navbar
Sep 6, 2024
5ed2303
Fixes import path to fetch collections function
Sep 6, 2024
3dd8ba7
Adds initial value for data source collections
Sep 6, 2024
df7ce33
Fixes TS errors in Vite config
Sep 9, 2024
4a886ff
Fixes TS errors in existing components
Sep 9, 2024
0c6d63f
Fixes Navbar after rebase
Sep 10, 2024
d6ff74f
Changes table description to match existing table
Sep 10, 2024
335ca7b
Updates package-lock.json
Sep 10, 2024
73b8c5f
Fixes missing list key error
Sep 10, 2024
929de5d
Adds header information to files
Sep 10, 2024
a1d311f
Updates button colors to match models deployed table
Sep 16, 2024
9346a00
Change RAG data source form to text
Sep 16, 2024
c4ba97b
Adds help text for RAG management
Sep 16, 2024
3bfdbce
Fixes consistence of 'datasource' spelling
Sep 16, 2024
b8a240b
Adds colored buttons to Confirm Dialog
Sep 16, 2024
ebd0e07
add rag_context to dummy_echo model for testing (#30)
tstescoTT Sep 17, 2024
0c3e301
Anirud/update license on rag components (#47)
anirudTT Sep 19, 2024
bb668d8
Anirud/re update license headers(#51)
anirudTT Sep 19, 2024
caa6062
feat(NavBar): add tooltips and separators (#45)
anirudTT Sep 21, 2024
3599460
feat(chat-ui): update scroll behavior and UI enhancements (#46)
anirudTT Sep 21, 2024
678eecd
github-actions-for-automated-license-header-addition (#71)
anirudTT Oct 28, 2024
d4a7689
Anirud/v1 end to end testing (#70)
anirudTT Oct 29, 2024
7a997eb
anirud/legal-suggestions (#75)
anirudTT Nov 7, 2024
9c3b2e6
remove falcon 7b model from tt studio (#81)
anirudTT Nov 15, 2024
02ad5f6
36 sets up linter (#80)
anirudTT Nov 18, 2024
5fb9fe0
Anirud/how to run llama (#79)
anirudTT Nov 20, 2024
9087589
Anirud/refactor startup script (#87)
anirudTT Nov 27, 2024
049c9c4
removed logo and font for licensing until instructed
sbennettTT Dec 9, 2024
18b8deb
removed original logo backup file
sbennettTT Dec 9, 2024
d85f0f8
vLLM(#83)
anirudTT Dec 13, 2024
0ebc423
Update README.md (#106)
anirudTT Dec 13, 2024
cb9c328
minor fixes to name and navbar active class (#108)
anirudTT Dec 17, 2024
beeacf6
replace docker-compose with docker compose (#109)
anirudTT Dec 18, 2024
dd8c205
switch out docker bridge network name (#115)
anirudTT Dec 19, 2024
1abdcad
Updates vLLM setup instructions #110(#112)
anirudTT Dec 19, 2024
15cef3e
fix history panel colors in light mode (#119)
anirudTT Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/backend-license-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Check SPDX Licenses

on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- "main"
- "staging"
types:
- opened
- reopened
- synchronize
- assigned
- review_requested

jobs:
check-spdx-licenses:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
cache: "pip"
python-version: "3.8"
- name: Install copyright check tool
run: pip install git+https://github.com/espressif/check-copyright.git@master
- name: Check SPDX licenses
id: check_spdx_licenses
run: |
set +e
output=$(python -m check_copyright --verbose --dry-run --config ./check_copyright_config.yaml . 2>&1)
exit_code=$?
clean_output=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g')
echo "CLEAN_OUTPUT<<EOF" >> $GITHUB_ENV
echo "$clean_output" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "EXIT_CODE=$exit_code" >> $GITHUB_ENV
exit 0
- name: Debug Extracted Files
run: |
echo "Extracted Files:"
echo "$CLEAN_OUTPUT"
- name: Extract Files
id: extract_files
run: |
set +e
files=$(echo "$CLEAN_OUTPUT" | awk '
/Files which failed the copyright check:/, /Additional information about this hook and copyright headers may be found here:/ {
if ($0 !~ /Files which failed the copyright check:/ && $0 !~ /Additional information about this hook and copyright headers may be found here:/) print
}
/Some files are without a copyright note and a license header needs to be added:/, /Additional information about this hook and copyright headers may be found here:/ {
if ($0 !~ /Some files are without a copyright note and a license header needs to be added:/ && $0 !~ /Additional information about this hook and copyright headers may be found here:/) print
}' | sed 's/^ *//' | sed '/^$/d' | grep '^.')
echo "FILES<<EOF" >> $GITHUB_ENV
echo "$files" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "Extracted Files: $files"
exit 0
- name: Debug Extracted Files
run: |
echo "Extracted Files:"
echo "$FILES"

# Extract and clean file paths
- name: Extract File Paths
if: env.FILES != ''
run: |
# Extract lines starting with './' but ignore any paths following "Modified files:" until a stop marker
files_clean=$(echo "$FILES" | awk '/^Modified files:/ {ignore = 1} /^Above is a list of files/ {ignore = 0} !ignore && /^\.\// {print}' | sort | uniq)
# Save the cleaned files into a new environment variable 'FILES_CLEAN'
echo "FILES_CLEAN<<EOF" >> $GITHUB_ENV
echo "$files_clean" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "Extracted Paths: $files_clean"
- name: Debug Extracted Paths
run: |
echo "Extracted Paths:"
echo "$FILES_CLEAN"
echo "---------------------------------"
- name: Comment on PR or Issue
if: env.FILES_CLEAN != ''
uses: actions/github-script@v7
with:
script: |
const formattedOutput = process.env.FILES_CLEAN;
const issueNumber = context.issue.number || context.payload.pull_request.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
if (formattedOutput) {
const commentBody = `Our automated SPDX license verification process has discovered that the following files are missing a license header:\n\`\`\`\n${formattedOutput}\n\`\`\`\nPlease ensure each indicated file includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Your attention and cooperation in updating these files are greatly appreciated. Thank you.`;
await github.rest.issues.createComment({
issue_number: issueNumber,
owner: owner,
repo: repo,
body: commentBody
});
core.setFailed("SPDX license issues found.");
} else {
console.log("No SPDX license issues found.");
}
148 changes: 148 additions & 0 deletions .github/workflows/frontend-lint-license-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Front-End Linter SPDX Licenses Checker

on:
push:
branches:
- main
pull_request:
branches:
- "main"
- "staging"
types:
- opened
- reopened
- synchronize
- assigned
- review_requested

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
working-directory: app/frontend
run: npm install

- name: Run ESLint with Auto-fix
working-directory: app/frontend
run: |
set +e
npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors

# Run ESLint and Capture Output
- name: Run ESLint and Capture Output
working-directory: app/frontend
id: run_eslint
run: |
set +e
output=$(npm run lint --silent 2>&1)
exit_code=$?
echo "$output"
clean_output=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g') # Remove ANSI escape codes
echo "CLEAN_OUTPUT<<EOF" >> $GITHUB_ENV
echo "$clean_output" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

grouped_errors=""
current_file=""
errors_for_file=""
has_errors=false
missing_lc_headers=false
lc_flagged_files=""

while IFS= read -r line; do
if echo "$line" | grep -q '^\s*\/'; then
if [ "$has_errors" = true ]; then
grouped_errors+="$current_file\n$errors_for_file\n------------------------------------------------------------------------------------------------------------------------------------------\n"
errors_for_file=""
has_errors=false
fi
current_file=$(echo "$line" | sed 's/\n//g')
elif echo "$line" | grep -q 'error'; then
errors_for_file+=" $line\n"
has_errors=true

if echo "$line" | grep -q 'missing header'; then
missing_lc_headers=true
errors_for_file+="!Flagged: LC header missing\n"
lc_flagged_files+="${current_file}\n"
fi
fi
done <<< "$clean_output"

if [ "$has_errors" = true ]; then
grouped_errors+="$current_file\n$errors_for_file\n"
fi

if [ -n "$grouped_errors" ]; then
echo "Errors found."
echo "GROUPED_ERRORS<<EOF" >> $GITHUB_ENV
echo -e "$grouped_errors" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "HAS_ERRORS=true" >> $GITHUB_ENV
else
echo "No relevant errors found."
echo "HAS_ERRORS=false" >> $GITHUB_ENV
fi

if [ "$missing_lc_headers" = true ]; then
echo "LC headers missing in one or more files."
echo "MISSING_LC_HEADERS=true" >> $GITHUB_ENV
echo "LC_FLAGGED_FILES<<EOF" >> $GITHUB_ENV
echo -e "$(echo -e "$lc_flagged_files" | sed '/^\s*$/d')" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
else
echo "MISSING_LC_HEADERS=false" >> $GITHUB_ENV
fi

exit 0

# Comment on PR with ESLint Errors and LC Headers
- name: Comment on PR with ESLint Errors and LC Headers
if: env.MISSING_LC_HEADERS == 'true' # Ensure we only comment if there are missing license headers
uses: actions/github-script@v7
with:
script: |
const lintErrors = process.env.GROUPED_ERRORS;
const issueNumber = context.payload.pull_request.number;
const owner = context.repo.owner;
const repo = context.repo.repo;

let commentBody = "";

if (process.env.MISSING_LC_HEADERS === 'true') {
const flaggedFiles = process.env.LC_FLAGGED_FILES.trim();
commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier to maintain licensing compliance.`;
}

if (lintErrors && process.env.MISSING_LC_HEADERS === 'true') {
commentBody += `\n\n## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`;
}

if (commentBody.trim() && issueNumber) {
await github.rest.issues.createComment({
issue_number: issueNumber,
owner: owner,
repo: repo,
body: commentBody
});
} else {
console.log("No relevant errors to report.");
}

- name: Fail the Workflow if LC Headers Are Missing
if: env.MISSING_LC_HEADERS == 'true'
run: |
echo "Failing the workflow because LC headers are missing."
exit 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
__pycache__
*egg-info
*.whl
.venv/

# Virtual Environment
env
Expand Down Expand Up @@ -37,3 +38,6 @@ db.sqlite3

# unignore
!requirements.txt
!app/frontend/third-party-licenses.txt
!requirements-dev.txt

9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
41 changes: 41 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Frequently Asked Questions

## Table of Contents
1. [Frontend Does Not Load](#frontend-does-not-load)
2. [Module not found](#module-not-found-error)

## Frontend Does Not Load

If the frontend app has not loaded despite running `docker compose up --build`, there is likely an issue with docker using cached files. Check if the `node_modules` directory has been created in `tt-studio/app/frontend`. If this directory is missing, this usually means that `npm (Node Package Manager)` did not successfully run and docker has skipped running this since it used layer caching. To resolve run the following:

```bash
docker compose build --no-cache
docker compose up
```

## Module not found error

This error often occurs due to missing or corrupted dependencies. Here's a quick fix:

1. Delete `node_modules` and `package-lock.json`:


```shellscript
rm -rf node_modules package-lock.json
```

2. Reinstall dependencies:


```shellscript
cd frontend
npm i
```

3. Re-run App using docker:


```shellscript
docker compose down
docker compose up --build
```
Loading
Loading